diff options
author | Lei Zhang <thestig@chromium.org> | 2018-04-09 20:24:35 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-09 20:24:35 +0000 |
commit | 0d8e530fbf898c1ba1ba4d3d91aa17e3fd4d8317 (patch) | |
tree | fbce19bfe65aa1a20ddba7337be2d1564c29e4ae /core/fpdfapi/render/cpdf_renderstatus.cpp | |
parent | 417f3442593713a87e723379438bea7d842e977a (diff) | |
download | pdfium-0d8e530fbf898c1ba1ba4d3d91aa17e3fd4d8317.tar.xz |
Pass FX_RECT by const-ref in rendering code.
Change-Id: I1232e6c61cbe696d90d87f461ebed0a7aea40893
Reviewed-on: https://pdfium-review.googlesource.com/29973
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_renderstatus.cpp')
-rw-r--r-- | core/fpdfapi/render/cpdf_renderstatus.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index 2d66f9c48b..1f9e60d29d 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -2035,7 +2035,7 @@ void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj, void CPDF_RenderStatus::DrawShading(const CPDF_ShadingPattern* pPattern, CFX_Matrix* pMatrix, - FX_RECT& clip_rect, + const FX_RECT& clip_rect, int alpha, bool bAlphaMode) { const auto& funcs = pPattern->GetFuncs(); @@ -2060,17 +2060,19 @@ void CPDF_RenderStatus::DrawShading(const CPDF_ShadingPattern* pPattern, (int32_t)(B * 255)); } } + FX_RECT clip_rect_bbox = clip_rect; if (pDict->KeyExist("BBox")) { - clip_rect.Intersect( + clip_rect_bbox.Intersect( pMatrix->TransformRect(pDict->GetRectFor("BBox")).GetOuterRect()); } if (m_pDevice->GetDeviceCaps(FXDC_RENDER_CAPS) & FXRC_SHADING && - m_pDevice->GetDeviceDriver()->DrawShading(pPattern, pMatrix, clip_rect, - alpha, bAlphaMode)) { + m_pDevice->GetDeviceDriver()->DrawShading( + pPattern, pMatrix, clip_rect_bbox, alpha, bAlphaMode)) { return; } CPDF_DeviceBuffer buffer; - buffer.Initialize(m_pContext.Get(), m_pDevice, &clip_rect, m_pCurObj, 150); + buffer.Initialize(m_pContext.Get(), m_pDevice, clip_rect_bbox, m_pCurObj, + 150); CFX_Matrix FinalMatrix = *pMatrix; FinalMatrix.Concat(*buffer.GetMatrix()); RetainPtr<CFX_DIBitmap> pBitmap = buffer.GetBitmap(); |