From a27d49a3e9eafd7fd911a0a6039ce80284ccb463 Mon Sep 17 00:00:00 2001 From: caryclark Date: Wed, 6 Jul 2016 10:20:25 -0700 Subject: copy graphics state fully The dash parameters where not copied; the copy could point at random data and cause corpus tests to hang when testing Skia. PDFium measures text directly by calling FreeType. Turn off hinting altogether in Skia so that drawn text matches the metrics that PDFium measures. Premultiply bits retrieved from images, and check to see that the device bits are always premultiplied. Look for null graphics state and matrices. R=thestig@chromium.org,dsinclair@chromium.org BUG=pdfium:532 Review-Url: https://codereview.chromium.org/2120353004 --- core/fxge/ge/fx_ge_device.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/fxge/ge/fx_ge_device.cpp') diff --git a/core/fxge/ge/fx_ge_device.cpp b/core/fxge/ge/fx_ge_device.cpp index 00cc541c22..9bb950beed 100644 --- a/core/fxge/ge/fx_ge_device.cpp +++ b/core/fxge/ge/fx_ge_device.cpp @@ -7,6 +7,10 @@ #include "core/fxge/include/fx_ge.h" #include "core/fxge/include/ifx_renderdevicedriver.h" +#if defined _SKIA_SUPPORT_ +#include "third_party/skia/include/core/SkTypes.h" +#endif + CFX_RenderDevice::CFX_RenderDevice() : m_pBitmap(nullptr), m_Width(0), @@ -20,6 +24,11 @@ CFX_RenderDevice::~CFX_RenderDevice() { delete m_pDeviceDriver; } +void CFX_RenderDevice::Flush() { + delete m_pDeviceDriver; + m_pDeviceDriver = nullptr; +} + void CFX_RenderDevice::SetDeviceDriver(IFX_RenderDeviceDriver* pDriver) { delete m_pDeviceDriver; m_pDeviceDriver = pDriver; @@ -480,3 +489,10 @@ FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) { void CFX_RenderDevice::CancelDIBits(void* handle) { m_pDeviceDriver->CancelDIBits(handle); } + +#ifdef _SKIA_SUPPORT_ + +void CFX_RenderDevice::DebugVerifyBitmapIsPreMultiplied() const { + SkASSERT(0); +} +#endif -- cgit v1.2.3