Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: core/fpdfapi/fpdf_render/fpdf_render_image.cpp

Issue 2025043002: remove some calls to dib (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render.cpp ('k') | core/fxge/dib/fx_dib_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_render/fpdf_render_image.cpp
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
index d3fbb7990cb353f6c5b59102b39a2ce9e8556a8c..acfb20314a23b88429c62c78245ddb0b48085351 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -48,7 +48,15 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
if (blend_mode == FXDIB_BLEND_NORMAL) {
if (!pDIBitmap->IsAlphaMask()) {
if (bitmap_alpha < 255) {
+#ifdef _SKIA_SUPPORT_
+ void* dummy;
+ CFX_Matrix m(pDIBitmap->GetWidth(), 0, 0, -pDIBitmap->GetHeight(), left,
+ top + pDIBitmap->GetHeight());
+ m_pDevice->StartDIBits(pDIBitmap, bitmap_alpha, 0, &m, 0, dummy);
+ return;
+#else
pDIBitmap->MultiplyAlpha(bitmap_alpha);
+#endif
}
if (m_pDevice->SetDIBits(pDIBitmap, left, top)) {
return;
@@ -693,6 +701,9 @@ FX_BOOL CPDF_ImageRenderer::DrawMaskedImage() {
}
bitmap_device2.GetBitmap()->ConvertFormat(FXDIB_8bppMask);
bitmap_device1.GetBitmap()->MultiplyAlpha(bitmap_device2.GetBitmap());
+#ifdef _SKIA_SUPPORT_
+ bitmap_device1.PreMultiply(); // convert unpremultiplied to premultiplied
+#endif
if (m_BitmapAlpha < 255) {
bitmap_device1.GetBitmap()->MultiplyAlpha(m_BitmapAlpha);
}
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render.cpp ('k') | core/fxge/dib/fx_dib_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698