diff options
Diffstat (limited to 'vcl/skia/x11/cairotextrender.cxx')
-rw-r--r-- | vcl/skia/x11/cairotextrender.cxx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/vcl/skia/x11/cairotextrender.cxx b/vcl/skia/x11/cairotextrender.cxx index 7c2402b2c869..f3cc30b709fe 100644 --- a/vcl/skia/x11/cairotextrender.cxx +++ b/vcl/skia/x11/cairotextrender.cxx @@ -38,7 +38,6 @@ cairo_t* SkiaX11CairoTextRender::getCairoContext() if (!surface) return nullptr; cairo_t* cr = cairo_create(surface); - // TODO cairo_surface_destroy(surface); return cr; } @@ -56,7 +55,6 @@ void SkiaX11CairoTextRender::getSurfaceOffset(double& nDX, double& nDY) void SkiaX11CairoTextRender::releaseCairoContext(cairo_t* cr) { - // XXX: lfrb: GLES 2.0 doesn't support GL_UNSIGNED_INT_8_8_8_8_REV SkiaSalGraphicsImpl* pImpl = dynamic_cast<SkiaSalGraphicsImpl*>(mrParent.GetImpl()); if (!pImpl) { @@ -70,19 +68,15 @@ void SkiaX11CairoTextRender::releaseCairoContext(cairo_t* cr) 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 tools::Rectangle aClipRect = pImpl->getClipRegion().GetBoundRect(); - SalTwoRect aRect(0, 0, nWidth, nHeight, aClipRect.Left(), aClipRect.Top(), nWidth, nHeight); - // Cairo surface data is ARGB with premultiplied alpha and is Y-inverted - // TODO - // SkiaTexture aTexture( nWidth, nHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pSrc ); - // pImpl->PreDraw(); - // pImpl->DrawAlphaTexture( aTexture, aRect, true, true ); - // pImpl->PostDraw(); - // abort(); + SkBitmap bitmap; + if (!bitmap.installPixels(SkImageInfo::MakeN32Premul(nWidth, nHeight), pSrc, nWidth * 4)) + abort(); + pImpl->drawBitmap(aRect, bitmap); + bitmap.reset(); cairo_destroy(cr); } |