diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-07 11:52:14 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-07 14:17:00 +0000 |
commit | 4ac876084bb89b6460b31e090a666b395f66b1e8 (patch) | |
tree | dd8652d4fbf83141ce15c0bf95c9a9b193079cd3 /canvas/source | |
parent | 5e59fe98ce4b29dd75e9d484a7f0d43b575709e8 (diff) |
mpSurface->getCairo() == mpCairo
so make that clearer, and we only need to pass a Cairo context
not a surface here
Change-Id: If385dbd4e8a546fa18c2f93650428fe0ed0c76fc
Diffstat (limited to 'canvas/source')
-rw-r--r-- | canvas/source/cairo/cairo_canvashelper_text.cxx | 12 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_textlayout.cxx | 4 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_textlayout.hxx | 2 |
3 files changed, 8 insertions, 10 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index c9c370210918..5530eede33a9 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -299,8 +299,8 @@ namespace cairocanvas { #if defined CAIRO_HAS_WIN32_SURFACE // FIXME: Some kind of work-araound... - cairo_rectangle (mpSurface->getCairo().get(), 0, 0, 0, 0); - cairo_fill(mpSurface->getCairo().get()); + cairo_rectangle (mpCairo.get(), 0, 0, 0, 0); + cairo_fill(mpCairo.get()); #endif ::Point aOutpos; if( !setupTextOutput( *mpVirtualDevice, pOwner, aOutpos, viewState, renderState, xFont ) ) @@ -333,7 +333,7 @@ namespace cairocanvas RTL_TEXTENCODING_UTF8 ).getStr()); rtl::Reference< TextLayout > pTextLayout( new TextLayout(text, textDirection, 0, CanvasFont::Reference(dynamic_cast< CanvasFont* >( xFont.get() )), mpSurfaceProvider) ); - pTextLayout->draw( mpSurface, *mpVirtualDevice, aOutpos, viewState, renderState ); + pTextLayout->draw(mpCairo, *mpVirtualDevice, aOutpos, viewState, renderState); } return uno::Reference< rendering::XCachedPrimitive >(NULL); @@ -358,8 +358,8 @@ namespace cairocanvas { #if defined CAIRO_HAS_WIN32_SURFACE // FIXME: Some kind of work-araound... - cairo_rectangle( mpSurface->getCairo().get(), 0, 0, 0, 0); - cairo_fill(mpSurface->getCairo().get()); + 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, @@ -371,7 +371,7 @@ namespace cairocanvas return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary // TODO(F2): What about the offset scalings? - pTextLayout->draw( mpSurface, *mpVirtualDevice, aOutpos, viewState, renderState ); + pTextLayout->draw(mpCairo, *mpVirtualDevice, aOutpos, viewState, renderState); } } else diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 8b1101283a62..892830e14f1e 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -337,7 +337,7 @@ namespace cairocanvas * * @return true, if successful **/ - bool TextLayout::draw( SurfaceSharedPtr& pSurface, + bool TextLayout::draw( CairoSharedPtr& pSCairo, OutputDevice& rOutDev, const Point& rOutpos, const rendering::ViewState& viewState, @@ -486,8 +486,6 @@ namespace cairocanvas # error Native API needed. #endif - CairoSharedPtr pSCairo = pSurface->getCairo(); - cairo_set_font_face( pSCairo.get(), font_face); // create default font options. cairo_get_font_options() does not retrieve the surface defaults, diff --git a/canvas/source/cairo/cairo_textlayout.hxx b/canvas/source/cairo/cairo_textlayout.hxx index 4509b5213761..25296fcad90f 100644 --- a/canvas/source/cairo/cairo_textlayout.hxx +++ b/canvas/source/cairo/cairo_textlayout.hxx @@ -81,7 +81,7 @@ namespace cairocanvas virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - bool draw( ::cairo::SurfaceSharedPtr& pSurface, + bool draw( ::cairo::CairoSharedPtr& pSCairo, OutputDevice& rOutDev, const Point& rOutpos, const ::com::sun::star::rendering::ViewState& viewState, |