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
94d935ee
Kaydet (Commit)
94d935ee
authored
Ara 11, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: fdo#87242 reuse vcl clip for cairo during animations
Change-Id: I0a26d4c4092226732620c3852b0402ee45d4fa1d
üst
f88b5ab8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
cairo_canvashelper.hxx
canvas/source/cairo/cairo_canvashelper.hxx
+3
-0
cairo_canvashelper_text.cxx
canvas/source/cairo/cairo_canvashelper_text.cxx
+22
-3
No files found.
canvas/source/cairo/cairo_canvashelper.hxx
Dosyayı görüntüle @
94d935ee
...
...
@@ -310,6 +310,9 @@ namespace cairocanvas
::
cairo
::
CairoSharedPtr
mpCairo
;
::
cairo
::
SurfaceSharedPtr
mpSurface
;
::
basegfx
::
B2ISize
maSize
;
void
clip_cairo_from_dev
(
::
OutputDevice
&
rOutDev
);
};
/// also needed from SpriteHelper
...
...
canvas/source/cairo/cairo_canvashelper_text.cxx
Dosyayı görüntüle @
94d935ee
...
...
@@ -176,12 +176,15 @@ namespace cairocanvas
{
private
:
OutputDevice
*
mpVirtualDevice
;
cairo_t
*
mpCairo
;
bool
mbMappingWasEnabled
;
public
:
DeviceSettingsGuard
(
OutputDevice
*
pVirtualDevice
)
DeviceSettingsGuard
(
OutputDevice
*
pVirtualDevice
,
cairo_t
*
pCairo
)
:
mpVirtualDevice
(
pVirtualDevice
)
,
mpCairo
(
pCairo
)
,
mbMappingWasEnabled
(
mpVirtualDevice
->
IsMapModeEnabled
())
{
cairo_save
(
mpCairo
);
mpVirtualDevice
->
Push
();
mpVirtualDevice
->
EnableMapMode
(
false
);
}
...
...
@@ -190,6 +193,7 @@ namespace cairocanvas
{
mpVirtualDevice
->
EnableMapMode
(
mbMappingWasEnabled
);
mpVirtualDevice
->
Pop
();
cairo_restore
(
mpCairo
);
}
};
...
...
@@ -229,6 +233,17 @@ namespace cairocanvas
return
true
;
}
//set the clip of the rOutDev to the cairo surface
void
CanvasHelper
::
clip_cairo_from_dev
(
::
OutputDevice
&
rOutDev
)
{
vcl
::
Region
aRegion
(
rOutDev
.
GetClipRegion
());
if
(
!
aRegion
.
IsEmpty
()
&&
!
aRegion
.
IsNull
())
{
doPolyPolygonImplementation
(
aRegion
.
GetAsB2DPolyPolygon
(),
Clip
,
mpCairo
.
get
(),
NULL
,
mpSurfaceProvider
,
rendering
::
FillRule_EVEN_ODD
);
}
}
uno
::
Reference
<
rendering
::
XCachedPrimitive
>
CanvasHelper
::
drawText
(
const
rendering
::
XCanvas
*
pOwner
,
const
rendering
::
StringContext
&
text
,
const
uno
::
Reference
<
rendering
::
XCanvasFont
>&
xFont
,
...
...
@@ -249,7 +264,7 @@ namespace cairocanvas
if
(
mpVirtualDevice
)
{
DeviceSettingsGuard
aGuard
(
mpVirtualDevice
.
get
());
DeviceSettingsGuard
aGuard
(
mpVirtualDevice
.
get
()
,
mpCairo
.
get
()
);
#if defined CAIRO_HAS_WIN32_SURFACE
// FIXME: Some kind of work-araound...
...
...
@@ -283,6 +298,8 @@ namespace cairocanvas
// TODO(F2): alpha
mpVirtualDevice
->
SetLayoutMode
(
nLayoutMode
);
clip_cairo_from_dev
(
*
mpVirtualDevice
);
OSL_TRACE
(
":cairocanvas::CanvasHelper::drawText(O,t,f,v,r,d): %s"
,
OUStringToOString
(
text
.
Text
.
copy
(
text
.
StartPosition
,
text
.
Length
),
RTL_TEXTENCODING_UTF8
).
getStr
());
...
...
@@ -310,7 +327,7 @@ namespace cairocanvas
if
(
mpVirtualDevice
)
{
DeviceSettingsGuard
aGuard
(
mpVirtualDevice
.
get
());
DeviceSettingsGuard
aGuard
(
mpVirtualDevice
.
get
()
,
mpCairo
.
get
()
);
#if defined CAIRO_HAS_WIN32_SURFACE
// FIXME: Some kind of work-araound...
...
...
@@ -326,6 +343,8 @@ namespace cairocanvas
if
(
!
setupTextOutput
(
*
mpVirtualDevice
,
pOwner
,
aOutpos
,
viewState
,
renderState
,
xLayoutedText
->
getFont
()
)
)
return
uno
::
Reference
<
rendering
::
XCachedPrimitive
>
(
NULL
);
// no output necessary
clip_cairo_from_dev
(
*
mpVirtualDevice
);
// TODO(F2): What about the offset scalings?
pTextLayout
->
draw
(
mpCairo
,
*
mpVirtualDevice
,
aOutpos
,
viewState
,
renderState
);
}
...
...
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