diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-02-01 12:08:43 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-02-02 14:56:17 +0000 |
commit | 1a1ee2f6e5b8215ad5f7bcdcb13f5fdce5784b2e (patch) | |
tree | 3d4bb458a4966b3f17a4b8e3f2e3615e9ddc3f16 /vcl/unx | |
parent | 11389cff11723c9f69317228cd2d6b1fef34b9aa (diff) |
move CairoTextRender cleanup to callers
so releaseCairoContext is a mirror of getCairoContext, so callers that don't
need to flush can drop that explicit call
Not sure, now that I see it, how there's been no sign of any problem with no
damage of the affected text area under gtk3
Change-Id: I8e508160be4102c64a0ecdf5591b6999f9171c36
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/gdi/cairotextrender.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/openglx11cairotextrender.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/x11cairotextrender.cxx | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index 3c958492cf52..747791d1b3c8 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -344,9 +344,7 @@ void CairoTextRender::DrawServerFontLayout( const ServerFontLayout& rLayout ) aI = aNext; } - cairo_surface_flush(cairo_get_target(cr)); releaseCairoContext(cr); - cairo_destroy(cr); } const FontCharMapPtr CairoTextRender::GetFontCharMap() const diff --git a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx index d5350e9cd5eb..0c8ac0d5ac1f 100644 --- a/vcl/unx/generic/gdi/openglx11cairotextrender.cxx +++ b/vcl/unx/generic/gdi/openglx11cairotextrender.cxx @@ -60,11 +60,15 @@ void OpenGLX11CairoTextRender::releaseCairoContext(cairo_t* cr) // XXX: lfrb: GLES 2.0 doesn't support GL_UNSIGNED_INT_8_8_8_8_REV OpenGLSalGraphicsImpl *pImpl = dynamic_cast< OpenGLSalGraphicsImpl* >(mrParent.GetImpl()); if(!pImpl) + { + cairo_destroy(cr); return; + } cairo_surface_t* pSurface = cairo_get_target(cr); int nWidth = cairo_image_surface_get_width( pSurface ); int nHeight = cairo_image_surface_get_height( pSurface ); + cairo_surface_flush(pSurface); unsigned char *pSrc = cairo_image_surface_get_data( pSurface ); // XXX: lfrb: GLES 2.0 doesn't support GL_UNSIGNED_INT_8_8_8_8_REV @@ -78,6 +82,8 @@ void OpenGLX11CairoTextRender::releaseCairoContext(cairo_t* cr) pImpl->PreDraw(); pImpl->DrawAlphaTexture( aTexture, aRect, true, true ); pImpl->PostDraw(); + + cairo_destroy(cr); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/x11cairotextrender.cxx b/vcl/unx/generic/gdi/x11cairotextrender.cxx index dc1797fa239d..5a2b095c121c 100644 --- a/vcl/unx/generic/gdi/x11cairotextrender.cxx +++ b/vcl/unx/generic/gdi/x11cairotextrender.cxx @@ -146,8 +146,9 @@ size_t X11CairoTextRender::GetHeight() const return 1; } -void X11CairoTextRender::releaseCairoContext(cairo_t* /*cr*/) +void X11CairoTextRender::releaseCairoContext(cairo_t* cr) { + cairo_destroy(cr); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |