diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-26 20:50:56 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-26 20:50:56 +0000 |
commit | 53a91f2eb0f4b82aaaf37699fd8d99be5871c2ac (patch) | |
tree | 0da5d86d555ceac5e50f6052b9f3c894ee4fcb82 /core/fxge/skia/fx_skia_device.cpp | |
parent | 29d56a4476071b9aafd1fd7af725ee193bdec952 (diff) | |
download | pdfium-53a91f2eb0f4b82aaaf37699fd8d99be5871c2ac.tar.xz |
Implement CFX_RenderDevice::GetFlipMatrix().
Consolidate matrix transforms from several places.
Change-Id: I2febcaed69afd1cf3eabf68f27ffe24301f07ca2
Reviewed-on: https://pdfium-review.googlesource.com/c/44631
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/skia/fx_skia_device.cpp')
-rw-r--r-- | core/fxge/skia/fx_skia_device.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 2067243c04..1cda61f4fe 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -2247,8 +2247,8 @@ bool CFX_SkiaDeviceDriver::SetDIBits(const RetainPtr<CFX_DIBBase>& pBitmap, return true; #ifdef _SKIA_SUPPORT_ - CFX_Matrix m(pBitmap->GetWidth(), 0, 0, -pBitmap->GetHeight(), left, - top + pBitmap->GetHeight()); + CFX_Matrix m = CFX_RenderDevice::GetFlipMatrix( + pBitmap->GetWidth(), pBitmap->GetHeight(), left, top); std::unique_ptr<CFX_ImageRenderer> dummy; return StartDIBits(pBitmap, 0xFF, argb, m, 0, &dummy, blend_type); #endif // _SKIA_SUPPORT_ @@ -2280,9 +2280,9 @@ bool CFX_SkiaDeviceDriver::StretchDIBits(const RetainPtr<CFX_DIBBase>& pSource, m_pCache->FlushForDraw(); if (!m_pBitmap->GetBuffer()) return true; - CFX_Matrix m(dest_width, 0, 0, -dest_height, dest_left, - dest_top + dest_height); + CFX_Matrix m = CFX_RenderDevice::GetFlipMatrix(dest_width, dest_height, + dest_left, dest_top); m_pCanvas->save(); SkRect skClipRect = SkRect::MakeLTRB(pClipRect->left, pClipRect->bottom, pClipRect->right, pClipRect->top); @@ -2501,8 +2501,9 @@ bool CFX_SkiaDeviceDriver::SetBitsWithMask( BlendMode blend_type) { if (!m_pBitmap || !m_pBitmap->GetBuffer()) return true; - CFX_Matrix m(pBitmap->GetWidth(), 0, 0, -pBitmap->GetHeight(), dest_left, - dest_top + pBitmap->GetHeight()); + + CFX_Matrix m = CFX_RenderDevice::GetFlipMatrix( + pBitmap->GetWidth(), pBitmap->GetHeight(), dest_left, dest_top); return DrawBitsWithMask(pBitmap, pMask, bitmap_alpha, m, blend_type); } |