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

Unified Diff: core/fpdfapi/render/cpdf_renderstatus.cpp

Issue 2520073003: handle antialiased rendering as premultiplied (Closed)
Patch Set: missed an ifdef Created 4 years, 1 month 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 | « no previous file | core/fxge/dib/fx_dib_main.cpp » ('j') | core/fxge/skia/fx_skia_device.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/render/cpdf_renderstatus.cpp
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 7c389ef37c664a08bdfda7b3f468dbf37b280237..8c708093d519d06e2ab0205951ddb79f6e6a9c7b 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -876,6 +876,9 @@ std::unique_ptr<CFX_DIBitmap> DrawPatternBitmap(
CFX_FxgeDevice bitmap_device;
bitmap_device.Attach(pBitmap.get(), false, nullptr, false);
pBitmap->Clear(0);
+#if defined _SKIA_SUPPORT_PATHS_
+ pBitmap->SetIsOffscreen(true);
+#endif
CFX_FloatRect cell_bbox = pPattern->bbox();
pPattern->pattern_to_form()->TransformRect(cell_bbox);
pObject2Device->TransformRect(cell_bbox);
@@ -893,6 +896,9 @@ std::unique_ptr<CFX_DIBitmap> DrawPatternBitmap(
CPDF_RenderContext context(pDoc, pCache);
context.AppendLayer(pPattern->form(), &mtPattern2Bitmap);
context.Render(&bitmap_device, &options, nullptr);
+#if defined _SKIA_SUPPORT_PATHS_
+ pBitmap->UnPreMultiply();
+#endif
return pBitmap;
}
@@ -1516,6 +1522,9 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
return true;
CFX_DIBitmap* bitmap = bitmap_device.GetBitmap();
bitmap->Clear(0);
+#ifdef _SKIA_SUPPORT_PATHS_
+ bitmap->SetIsOffscreen(true);
+#endif
CFX_Matrix new_matrix = *pObj2Device;
new_matrix.TranslateI(-rect.left, -rect.top);
new_matrix.Scale(scaleX, scaleY);
« no previous file with comments | « no previous file | core/fxge/dib/fx_dib_main.cpp » ('j') | core/fxge/skia/fx_skia_device.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698