summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-23 20:29:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-24 20:21:17 +0200
commit787f2c04d742a69802fcd5fad486ad4334226f48 (patch)
tree0f8f9a538b5d66bbb15cb3e4869c13940a0b9cb5 /canvas
parent770892a387361067d23ab08ed38690c50b8b9395 (diff)
remove now unnecessary cairo/virtual-device syncing
Change-Id: I0dc88b1e7c6c1ac336bbfb772c8ebced5e1b432c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94737 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/cairo/cairo_canvashelper.hxx3
-rw-r--r--canvas/source/cairo/cairo_canvashelper_text.cxx35
2 files changed, 3 insertions, 35 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper.hxx b/canvas/source/cairo/cairo_canvashelper.hxx
index d540aba7d933..21dbf79d7788 100644
--- a/canvas/source/cairo/cairo_canvashelper.hxx
+++ b/canvas/source/cairo/cairo_canvashelper.hxx
@@ -257,9 +257,6 @@ namespace cairocanvas
::cairo::CairoSharedPtr mpCairo;
::cairo::SurfaceSharedPtr mpSurface;
::basegfx::B2ISize maSize;
-
- void clip_cairo_from_dev(::OutputDevice const & rOutDev);
-
};
/// also needed from SpriteHelper
diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx
index b7c101ef3956..830388775670 100644
--- a/canvas/source/cairo/cairo_canvashelper_text.cxx
+++ b/canvas/source/cairo/cairo_canvashelper_text.cxx
@@ -150,15 +150,12 @@ namespace cairocanvas
{
private:
VclPtr<OutputDevice> mpVirtualDevice;
- cairo_t *mpCairo;
bool mbMappingWasEnabled;
public:
- DeviceSettingsGuard(OutputDevice *pVirtualDevice, cairo_t *pCairo)
+ DeviceSettingsGuard(OutputDevice *pVirtualDevice)
: mpVirtualDevice(pVirtualDevice)
- , mpCairo(pCairo)
, mbMappingWasEnabled(mpVirtualDevice->IsMapModeEnabled())
{
- cairo_save(mpCairo);
mpVirtualDevice->Push();
mpVirtualDevice->EnableMapMode(false);
}
@@ -167,7 +164,6 @@ namespace cairocanvas
{
mpVirtualDevice->EnableMapMode(mbMappingWasEnabled);
mpVirtualDevice->Pop();
- cairo_restore(mpCairo);
}
};
@@ -209,17 +205,6 @@ namespace cairocanvas
return true;
}
- //set the clip of the rOutDev to the cairo surface
- void CanvasHelper::clip_cairo_from_dev(::OutputDevice const & rOutDev)
- {
- vcl::Region aRegion(rOutDev.GetClipRegion());
- if (!aRegion.IsEmpty() && !aRegion.IsNull())
- {
- doPolyPolygonImplementation(aRegion.GetAsB2DPolyPolygon(), Clip, mpCairo.get(),
- nullptr, 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,
@@ -240,13 +225,8 @@ namespace cairocanvas
if( mpVirtualDevice )
{
- DeviceSettingsGuard aGuard(mpVirtualDevice.get(), mpCairo.get());
+ DeviceSettingsGuard aGuard(mpVirtualDevice.get());
-#if defined CAIRO_HAS_WIN32_SURFACE
- // FIXME: Some kind of work-around...
- cairo_rectangle (mpCairo.get(), 0, 0, 0, 0);
- cairo_fill(mpCairo.get());
-#endif
::Point aOutpos;
if( !setupTextOutput( *mpVirtualDevice, pOwner, aOutpos, viewState, renderState, xFont ) )
return uno::Reference< rendering::XCachedPrimitive >(nullptr); // no output necessary
@@ -273,8 +253,6 @@ namespace cairocanvas
// TODO(F2): alpha
mpVirtualDevice->SetLayoutMode( nLayoutMode );
- clip_cairo_from_dev(*mpVirtualDevice);
-
rtl::Reference pTextLayout( new TextLayout(text, textDirection, 0, CanvasFont::Reference(dynamic_cast< CanvasFont* >( xFont.get() )), mpSurfaceProvider) );
pTextLayout->draw(*mpVirtualDevice, aOutpos, viewState, renderState);
}
@@ -299,13 +277,8 @@ namespace cairocanvas
if( mpVirtualDevice )
{
- DeviceSettingsGuard aGuard(mpVirtualDevice.get(), mpCairo.get());
+ DeviceSettingsGuard aGuard(mpVirtualDevice.get());
-#if defined CAIRO_HAS_WIN32_SURFACE
- // FIXME: Some kind of work-around...
- cairo_rectangle(mpCairo.get(), 0, 0, 0, 0);
- cairo_fill(mpCairo.get());
-#endif
// TODO(T3): Race condition. We're taking the font
// from xLayoutedText, and then calling draw() at it,
// without exclusive access. Move setupTextOutput(),
@@ -315,8 +288,6 @@ namespace cairocanvas
if( !setupTextOutput( *mpVirtualDevice, pOwner, aOutpos, viewState, renderState, xLayoutedText->getFont() ) )
return uno::Reference< rendering::XCachedPrimitive >(nullptr); // no output necessary
- clip_cairo_from_dev(*mpVirtualDevice);
-
// TODO(F2): What about the offset scalings?
pTextLayout->draw(*mpVirtualDevice, aOutpos, viewState, renderState);
}