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

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

Issue 2111553003: fix skia unit tests (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix luminosity device bitmap depth Created 4 years, 6 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
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 272c779fe83869bf07e3768fc996b011b33955ed..10fd5f3f1550f739ed6a24a60b13f84e5fbb5087 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -27,6 +27,10 @@
#include "core/fxcrt/include/fx_safe_types.h"
#include "core/fxge/include/fx_ge.h"
+#ifdef _SKIA_SUPPORT_
+#include "core/fxge/skia/fx_skia_device.h"
+#endif
+
FX_BOOL CPDF_RenderStatus::ProcessImage(const CPDF_ImageObject* pImageObj,
const CFX_Matrix* pObj2Device) {
CPDF_ImageRenderer render;
@@ -58,6 +62,10 @@ void CPDF_RenderStatus::CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
pDIBitmap->MultiplyAlpha(bitmap_alpha);
#endif
}
+#ifdef _SKIA_SUPPORT_
+ static_cast<CFX_SkiaDeviceDriver*>(m_pDevice->GetDeviceDriver())
+ ->PreMultiply(pDIBitmap);
+#endif
if (m_pDevice->SetDIBits(pDIBitmap, left, top)) {
return;
}
@@ -920,7 +928,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
int width = pClipRect->right - pClipRect->left;
int height = pClipRect->bottom - pClipRect->top;
FXDIB_Format format;
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || defined _SKIA_SUPPORT_
format = bLuminosity ? FXDIB_Rgb32 : FXDIB_8bppMask;
#else
format = bLuminosity ? FXDIB_Rgb : FXDIB_8bppMask;
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_render/fpdf_render_loadimage_embeddertest.cpp » ('j') | core/fxge/skia/fx_skia_device.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698