Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
c26e2c87
Kaydet (Commit)
c26e2c87
authored
Mar 04, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
move getCairoContext to GtkSalFrame and reuse
Change-Id: I8c50e6dd51299214ad622b253ffc401244653225
üst
f462c980
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
30 deletions
+22
-30
gtkframe.hxx
vcl/inc/unx/gtk/gtkframe.hxx
+1
-0
gtkgdi.hxx
vcl/inc/unx/gtk/gtkgdi.hxx
+1
-0
gtksalframe.cxx
vcl/unx/gtk/window/gtksalframe.cxx
+19
-18
gtk3salnativewidgets-gtk.cxx
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+1
-12
No files found.
vcl/inc/unx/gtk/gtkframe.hxx
Dosyayı görüntüle @
c26e2c87
...
@@ -341,6 +341,7 @@ public:
...
@@ -341,6 +341,7 @@ public:
#if GTK_CHECK_VERSION(3,0,0)
#if GTK_CHECK_VERSION(3,0,0)
// only for gtk3 ...
// only for gtk3 ...
cairo_t
*
getCairoContext
();
void
pushIgnoreDamage
();
void
pushIgnoreDamage
();
void
popIgnoreDamage
();
void
popIgnoreDamage
();
bool
isDuringRender
();
bool
isDuringRender
();
...
...
vcl/inc/unx/gtk/gtkgdi.hxx
Dosyayı görüntüle @
c26e2c87
...
@@ -58,6 +58,7 @@ public:
...
@@ -58,6 +58,7 @@ public:
static
void
signalSettingsNotify
(
GObject
*
,
GParamSpec
*
pSpec
,
gpointer
);
static
void
signalSettingsNotify
(
GObject
*
,
GParamSpec
*
pSpec
,
gpointer
);
cairo_t
*
getCairoContext
();
cairo_t
*
getCairoContext
();
void
clipRegion
(
cairo_t
*
cr
);
void
clipRegion
(
cairo_t
*
cr
);
private
:
private
:
...
...
vcl/unx/gtk/window/gtksalframe.cxx
Dosyayı görüntüle @
c26e2c87
...
@@ -3334,6 +3334,24 @@ gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpoi
...
@@ -3334,6 +3334,24 @@ gboolean GtkSalFrame::signalCrossing( GtkWidget*, GdkEventCrossing* pEvent, gpoi
}
}
#if GTK_CHECK_VERSION(3,0,0)
#if GTK_CHECK_VERSION(3,0,0)
cairo_t
*
GtkSalFrame
::
getCairoContext
()
{
basebmp
::
RawMemorySharedArray
data
=
m_aFrame
->
getBuffer
();
basegfx
::
B2IVector
size
=
m_aFrame
->
getSize
();
sal_Int32
nStride
=
m_aFrame
->
getScanlineStride
();
assert
(
cairo_format_stride_for_width
(
CAIRO_FORMAT_RGB24
,
size
.
getX
())
==
nStride
);
cairo_surface_t
*
target
=
cairo_image_surface_create_for_data
(
data
.
get
(),
CAIRO_FORMAT_RGB24
,
size
.
getX
(),
size
.
getY
(),
nStride
);
cairo_t
*
cr
=
cairo_create
(
target
);
cairo_surface_destroy
(
target
);
return
cr
;
// return gdk_cairo_create(gtk_widget_get_window(mpFrame->getWindow()));
}
void
GtkSalFrame
::
pushIgnoreDamage
()
void
GtkSalFrame
::
pushIgnoreDamage
()
{
{
m_nDuringRender
++
;
m_nDuringRender
++
;
...
@@ -3393,7 +3411,6 @@ void GtkSalFrame::renderArea( cairo_t *cr, cairo_rectangle_t *area )
...
@@ -3393,7 +3411,6 @@ void GtkSalFrame::renderArea( cairo_t *cr, cairo_rectangle_t *area )
basebmp
::
RawMemorySharedArray
data
=
m_aFrame
->
getBuffer
();
basebmp
::
RawMemorySharedArray
data
=
m_aFrame
->
getBuffer
();
basegfx
::
B2IVector
size
=
m_aFrame
->
getSize
();
basegfx
::
B2IVector
size
=
m_aFrame
->
getSize
();
sal_Int32
nStride
=
m_aFrame
->
getScanlineStride
();
long
ax
=
area
->
x
;
long
ax
=
area
->
x
;
long
ay
=
area
->
y
;
long
ay
=
area
->
y
;
...
@@ -3422,28 +3439,12 @@ void GtkSalFrame::renderArea( cairo_t *cr, cairo_rectangle_t *area )
...
@@ -3422,28 +3439,12 @@ void GtkSalFrame::renderArea( cairo_t *cr, cairo_rectangle_t *area )
cairo_save
(
cr
);
cairo_save
(
cr
);
unsigned
char
*
src
=
data
.
get
();
cairo_surface_t
*
pSurface
=
cairo_get_target
(
getCairoContext
());
assert
(
cairo_format_stride_for_width
(
CAIRO_FORMAT_RGB24
,
size
.
getX
())
==
nStride
);
cairo_surface_t
*
pSurface
=
cairo_image_surface_create_for_data
(
src
,
CAIRO_FORMAT_RGB24
,
size
.
getX
(),
size
.
getY
(),
nStride
);
/*
int cairo_stride = cairo_format_stride_for_width(CAIRO_FORMAT_RGB24, size.getX());
g_warning( "Fixed cairo status %d %d strides: %d vs %d, mask %d\n",
(int) cairo_status( cr ),
(int) cairo_surface_status( pSurface ),
(int) nStride,
(int) cairo_stride,
(int) (cairo_stride & (sizeof (uint32_t)-1)) );
*/
cairo_set_operator
(
cr
,
CAIRO_OPERATOR_OVER
);
cairo_set_operator
(
cr
,
CAIRO_OPERATOR_OVER
);
cairo_set_source_surface
(
cr
,
pSurface
,
0
,
0
);
cairo_set_source_surface
(
cr
,
pSurface
,
0
,
0
);
cairo_rectangle
(
cr
,
ax
,
ay
,
awidth
,
aheight
);
cairo_rectangle
(
cr
,
ax
,
ay
,
awidth
,
aheight
);
cairo_fill
(
cr
);
cairo_fill
(
cr
);
cairo_surface_destroy
(
pSurface
);
cairo_restore
(
cr
);
cairo_restore
(
cr
);
// Render red rectangles to show what was re-rendered ...
// Render red rectangles to show what was re-rendered ...
...
...
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
Dosyayı görüntüle @
c26e2c87
...
@@ -1586,18 +1586,7 @@ void GtkSalGraphics::copyArea( long nDestX, long nDestY,
...
@@ -1586,18 +1586,7 @@ void GtkSalGraphics::copyArea( long nDestX, long nDestY,
cairo_t
*
GtkSalGraphics
::
getCairoContext
()
cairo_t
*
GtkSalGraphics
::
getCairoContext
()
{
{
basebmp
::
RawMemorySharedArray
data
=
mpFrame
->
m_aFrame
->
getBuffer
();
return
mpFrame
->
getCairoContext
();
basegfx
::
B2IVector
size
=
mpFrame
->
m_aFrame
->
getSize
();
sal_Int32
nStride
=
mpFrame
->
m_aFrame
->
getScanlineStride
();
cairo_surface_t
*
target
=
cairo_image_surface_create_for_data
(
data
.
get
(),
CAIRO_FORMAT_RGB24
,
size
.
getX
(),
size
.
getY
(),
nStride
);
cairo_t
*
cr
=
cairo_create
(
target
);
cairo_surface_destroy
(
target
);
return
cr
;
// return gdk_cairo_create(gtk_widget_get_window(mpFrame->getWindow()));
}
}
void
GtkSalGraphics
::
clipRegion
(
cairo_t
*
cr
)
void
GtkSalGraphics
::
clipRegion
(
cairo_t
*
cr
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment