diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-01-11 09:11:09 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-01-11 09:11:09 -0800 |
commit | 492961df3011ccc25646eae12ac6e6dcfe7f26da (patch) | |
tree | 0d0e5f5155becdb51f70243a7821b0bbc44014fb /core/src/fpdfapi/fpdf_render | |
parent | 3f1c71f5a6ea058e3eec611c9dcc759b374dcb80 (diff) | |
download | pdfium-492961df3011ccc25646eae12ac6e6dcfe7f26da.tar.xz |
Merge to XFA: Tidy up shading patterns
Original Review URL: https://codereview.chromium.org/1570873005 .
(cherry picked from commit a07804a3b16c10fa2011ef56d1dacefb7d21e4f6)
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1577893002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp | 12 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp | 10 |
2 files changed, 12 insertions, 10 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp index 640adb14da..3f7347b8f1 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp @@ -522,12 +522,14 @@ FX_BOOL CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) { m_pRenderStatus->m_bDropObjects, NULL, TRUE); CFX_Matrix patternDevice = *pObj2Device; patternDevice.Translate((FX_FLOAT)-rect.left, (FX_FLOAT)-rect.top); - if (m_pPattern->m_PatternType == PATTERN_TILING) { - bitmap_render.DrawTilingPattern((CPDF_TilingPattern*)m_pPattern, - m_pImageObject, &patternDevice, FALSE); + if (m_pPattern->m_PatternType == CPDF_Pattern::TILING) { + bitmap_render.DrawTilingPattern( + static_cast<CPDF_TilingPattern*>(m_pPattern), m_pImageObject, + &patternDevice, FALSE); } else { - bitmap_render.DrawShadingPattern((CPDF_ShadingPattern*)m_pPattern, - m_pImageObject, &patternDevice, FALSE); + bitmap_render.DrawShadingPattern( + static_cast<CPDF_ShadingPattern*>(m_pPattern), m_pImageObject, + &patternDevice, FALSE); } } { diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index 718fa73009..8cee178369 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -1187,12 +1187,12 @@ void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, if (!pattern) { return; } - if (pattern->m_PatternType == PATTERN_TILING) { - DrawTilingPattern((CPDF_TilingPattern*)pattern, pPathObj, pObj2Device, - bStroke); + if (pattern->m_PatternType == CPDF_Pattern::TILING) { + DrawTilingPattern(static_cast<CPDF_TilingPattern*>(pattern), pPathObj, + pObj2Device, bStroke); } else { - DrawShadingPattern((CPDF_ShadingPattern*)pattern, pPathObj, pObj2Device, - bStroke); + DrawShadingPattern(static_cast<CPDF_ShadingPattern*>(pattern), pPathObj, + pObj2Device, bStroke); } } void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, |