mpSurface->getCairo() == mpCairo
so make that clearer, and we only need to pass a Cairo context not a surface here Change-Id: If385dbd4e8a546fa18c2f93650428fe0ed0c76fc
This commit is contained in:
@@ -299,8 +299,8 @@ namespace cairocanvas
|
|||||||
{
|
{
|
||||||
#if defined CAIRO_HAS_WIN32_SURFACE
|
#if defined CAIRO_HAS_WIN32_SURFACE
|
||||||
// FIXME: Some kind of work-araound...
|
// FIXME: Some kind of work-araound...
|
||||||
cairo_rectangle (mpSurface->getCairo().get(), 0, 0, 0, 0);
|
cairo_rectangle (mpCairo.get(), 0, 0, 0, 0);
|
||||||
cairo_fill(mpSurface->getCairo().get());
|
cairo_fill(mpCairo.get());
|
||||||
#endif
|
#endif
|
||||||
::Point aOutpos;
|
::Point aOutpos;
|
||||||
if( !setupTextOutput( *mpVirtualDevice, pOwner, aOutpos, viewState, renderState, xFont ) )
|
if( !setupTextOutput( *mpVirtualDevice, pOwner, aOutpos, viewState, renderState, xFont ) )
|
||||||
@@ -333,7 +333,7 @@ namespace cairocanvas
|
|||||||
RTL_TEXTENCODING_UTF8 ).getStr());
|
RTL_TEXTENCODING_UTF8 ).getStr());
|
||||||
|
|
||||||
rtl::Reference< TextLayout > pTextLayout( new TextLayout(text, textDirection, 0, CanvasFont::Reference(dynamic_cast< CanvasFont* >( xFont.get() )), mpSurfaceProvider) );
|
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);
|
return uno::Reference< rendering::XCachedPrimitive >(NULL);
|
||||||
@@ -358,8 +358,8 @@ namespace cairocanvas
|
|||||||
{
|
{
|
||||||
#if defined CAIRO_HAS_WIN32_SURFACE
|
#if defined CAIRO_HAS_WIN32_SURFACE
|
||||||
// FIXME: Some kind of work-araound...
|
// FIXME: Some kind of work-araound...
|
||||||
cairo_rectangle( mpSurface->getCairo().get(), 0, 0, 0, 0);
|
cairo_rectangle(mpCairo.get(), 0, 0, 0, 0);
|
||||||
cairo_fill(mpSurface->getCairo().get());
|
cairo_fill(mpCairo.get());
|
||||||
#endif
|
#endif
|
||||||
// TODO(T3): Race condition. We're taking the font
|
// TODO(T3): Race condition. We're taking the font
|
||||||
// from xLayoutedText, and then calling draw() at it,
|
// from xLayoutedText, and then calling draw() at it,
|
||||||
@@ -371,7 +371,7 @@ namespace cairocanvas
|
|||||||
return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary
|
return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary
|
||||||
|
|
||||||
// TODO(F2): What about the offset scalings?
|
// TODO(F2): What about the offset scalings?
|
||||||
pTextLayout->draw( mpSurface, *mpVirtualDevice, aOutpos, viewState, renderState );
|
pTextLayout->draw(mpCairo, *mpVirtualDevice, aOutpos, viewState, renderState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -337,7 +337,7 @@ namespace cairocanvas
|
|||||||
*
|
*
|
||||||
* @return true, if successful
|
* @return true, if successful
|
||||||
**/
|
**/
|
||||||
bool TextLayout::draw( SurfaceSharedPtr& pSurface,
|
bool TextLayout::draw( CairoSharedPtr& pSCairo,
|
||||||
OutputDevice& rOutDev,
|
OutputDevice& rOutDev,
|
||||||
const Point& rOutpos,
|
const Point& rOutpos,
|
||||||
const rendering::ViewState& viewState,
|
const rendering::ViewState& viewState,
|
||||||
@@ -486,8 +486,6 @@ namespace cairocanvas
|
|||||||
# error Native API needed.
|
# error Native API needed.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CairoSharedPtr pSCairo = pSurface->getCairo();
|
|
||||||
|
|
||||||
cairo_set_font_face( pSCairo.get(), font_face);
|
cairo_set_font_face( pSCairo.get(), font_face);
|
||||||
|
|
||||||
// create default font options. cairo_get_font_options() does not retrieve the surface defaults,
|
// create default font options. cairo_get_font_options() does not retrieve the surface defaults,
|
||||||
|
@@ -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 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;
|
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,
|
OutputDevice& rOutDev,
|
||||||
const Point& rOutpos,
|
const Point& rOutpos,
|
||||||
const ::com::sun::star::rendering::ViewState& viewState,
|
const ::com::sun::star::rendering::ViewState& viewState,
|
||||||
|
Reference in New Issue
Block a user