summaryrefslogtreecommitdiff
path: root/core/fxge/fx_dib.h
diff options
context:
space:
mode:
authorcaryclark <caryclark@google.com>2016-11-22 12:44:25 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-22 12:44:25 -0800
commit687fbde2e4ee13637cb3fd9b1fec39a436ef73d7 (patch)
tree9c0d588a6494957b1bfeb12944c6f41e07a01711 /core/fxge/fx_dib.h
parent89a2d92549d25df6786d53de5671eb141e1fd3e2 (diff)
downloadpdfium-687fbde2e4ee13637cb3fd9b1fec39a436ef73d7.tar.xz
handle antialiased rendering as premultiplied
Transparencies and bitmap patterns need to be unpremultiplied after Skia renders them so that PDFium can use its own compositing. Also added some linear (i.e. axial) gradient support, although its unclear if any of the test corpus uses this feature. R=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2520073003
Diffstat (limited to 'core/fxge/fx_dib.h')
-rw-r--r--core/fxge/fx_dib.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h
index daf2cdf9a5..1719ae13e5 100644
--- a/core/fxge/fx_dib.h
+++ b/core/fxge/fx_dib.h
@@ -371,20 +371,25 @@ class CFX_DIBitmap : public CFX_DIBSource {
bool ConvertColorScale(uint32_t forecolor, uint32_t backcolor);
-#ifdef _SKIA_SUPPORT_PATHS_
- bool IsMarkedForUnPreMultiply() const { return m_bUnPreMultiply; }
-
- void MarkForUnPreMultiply(bool mark) { m_bUnPreMultiply = mark; }
+#if defined _SKIA_SUPPORT_ || _SKIA_SUPPORT_PATHS_
+ void PreMultiply();
+#endif
+#if defined _SKIA_SUPPORT_PATHS_
+ void UnPreMultiply();
#endif
protected:
bool GetGrayData(void* pIccTransform = nullptr);
+#if defined _SKIA_SUPPORT_PATHS_
+ enum class Format { kCleared, kPreMultiplied, kUnPreMultiplied };
+#endif
+
uint8_t* m_pBuffer;
- bool m_bExtBuf;
-#ifdef _SKIA_SUPPORT_PATHS_
- bool m_bUnPreMultiply;
+#if defined _SKIA_SUPPORT_PATHS_
+ Format m_nFormat;
#endif
+ bool m_bExtBuf;
};
class CFX_DIBExtractor {