From d95f175a1d238b3d610ab54e554e9af081e92ce7 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 5 Jul 2017 11:57:38 -0400 Subject: maintain ClipBox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GetClipBox returned wrong clip bounds Found tracing through looking for other bugs. GetClipBox is used by graphics outside of Skia so it needs to be kept up to date. R=dsinclair@chromium.org,npm@chromium.org Bug: 736703 Change-Id: I2b3fdfe91053848243e5b486a2615a233654c5a9 Reviewed-on: https://pdfium-review.googlesource.com/7274 Reviewed-by: Nicolás Peña Commit-Queue: Cary Clark --- core/fxge/skia/fx_skia_device.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 2d60f74e86..d0fe11d9b6 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -1990,12 +1990,22 @@ uint8_t* CFX_SkiaDeviceDriver::GetBuffer() const { } bool CFX_SkiaDeviceDriver::GetClipBox(FX_RECT* pRect) { +#ifdef _SKIA_SUPPORT_PATHS_ + if (!m_pClipRgn) { + pRect->left = pRect->top = 0; + pRect->right = GetDeviceCaps(FXDC_PIXEL_WIDTH); + pRect->bottom = GetDeviceCaps(FXDC_PIXEL_HEIGHT); + return true; + } + *pRect = m_pClipRgn->GetBox(); +#else // TODO(caryclark) call m_canvas->getClipDeviceBounds() instead pRect->left = 0; pRect->top = 0; const SkImageInfo& canvasSize = m_pCanvas->imageInfo(); pRect->right = canvasSize.width(); pRect->bottom = canvasSize.height(); +#endif return true; } -- cgit v1.2.3