diff options
author | Cary Clark <caryclark@skia.org> | 2017-07-05 11:57:38 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-05 20:58:39 +0000 |
commit | d95f175a1d238b3d610ab54e554e9af081e92ce7 (patch) | |
tree | 10264bbb1253e58bbde8be3bde087c63d4576158 /core/fxge/skia | |
parent | ecc238c9487288e1f3bfe8973245011f2eb0bcf2 (diff) | |
download | pdfium-d95f175a1d238b3d610ab54e554e9af081e92ce7.tar.xz |
maintain ClipBox
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 <npm@chromium.org>
Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'core/fxge/skia')
-rw-r--r-- | core/fxge/skia/fx_skia_device.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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; } |