summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_image.cpp10
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_loadimage_embeddertest.cpp7
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp7
3 files changed, 11 insertions, 13 deletions
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 272c779fe8..10fd5f3f15 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;
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_loadimage_embeddertest.cpp b/core/fpdfapi/fpdf_render/fpdf_render_loadimage_embeddertest.cpp
index bbaf7b389d..5c6a8c513f 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_loadimage_embeddertest.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_loadimage_embeddertest.cpp
@@ -7,12 +7,7 @@
class FPDFRenderLoadImageEmbeddertest : public EmbedderTest {};
-#if defined(_SKIA_SUPPORT_)
-#define MAYBE_Bug_554151 DISABLED_Bug_554151
-#else
-#define MAYBE_Bug_554151 Bug_554151
-#endif
-TEST_F(FPDFRenderLoadImageEmbeddertest, MAYBE_Bug_554151) {
+TEST_F(FPDFRenderLoadImageEmbeddertest, Bug_554151) {
// Test scanline downsampling with a BitsPerComponent of 4.
// Should not crash.
EXPECT_TRUE(OpenDocument("bug_554151.pdf"));
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp
index 48fe352fe7..176c923372 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern_embeddertest.cpp
@@ -7,12 +7,7 @@
class FPDFRenderPatternEmbeddertest : public EmbedderTest {};
-#if defined(_SKIA_SUPPORT_)
-#define MAYBE_LoadError_547706 DISABLED_LoadError_547706
-#else
-#define MAYBE_LoadError_547706 LoadError_547706
-#endif
-TEST_F(FPDFRenderPatternEmbeddertest, MAYBE_LoadError_547706) {
+TEST_F(FPDFRenderPatternEmbeddertest, LoadError_547706) {
// Test shading where object is a dictionary instead of a stream.
EXPECT_TRUE(OpenDocument("bug_547706.pdf"));
FPDF_PAGE page = LoadPage(0);