Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1079)

Unified Diff: core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp

Issue 1908903003: Only call shading code with streams. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 6ac380e43a3890f8a8d1e8ebad3b31bf709b4588..aa7abfd873025a32a8deb7a5006750ef655136bd 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -889,21 +889,33 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
pColorSpace, alpha);
break;
case kFreeFormGouraudTriangleMeshShading: {
- DrawFreeGouraudShading(pBitmap, &FinalMatrix,
- ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs,
- pColorSpace, alpha);
+ // The shading object can be a stream or a dictionary. We do not handle
+ // the case of dictionary at the moment.
+ if (pPattern->m_pShadingObj->IsStream()) {
Tom Sepez 2016/04/21 16:24:24 nit: maybe if (CPFD_Stream* pStream = pPattern->m_
dsinclair 2016/04/21 16:56:00 Done.
+ DrawFreeGouraudShading(pBitmap, &FinalMatrix,
+ ToStream(pPattern->m_pShadingObj), pFuncs,
Tom Sepez 2016/04/21 16:24:24 nit: then you can write pStream, pFuncts, and
dsinclair 2016/04/21 16:56:00 Done.
+ nFuncs, pColorSpace, alpha);
+ }
} break;
case kLatticeFormGouraudTriangleMeshShading: {
- DrawLatticeGouraudShading(pBitmap, &FinalMatrix,
- ToStream(pPattern->m_pShadingObj), pFuncs,
- nFuncs, pColorSpace, alpha);
+ // The shading object can be a stream or a dictionary. We do not handle
+ // the case of dictionary at the moment.
+ if (pPattern->m_pShadingObj->IsStream()) {
+ DrawLatticeGouraudShading(pBitmap, &FinalMatrix,
+ ToStream(pPattern->m_pShadingObj), pFuncs,
+ nFuncs, pColorSpace, alpha);
+ }
} break;
case kCoonsPatchMeshShading:
case kTensorProductPatchMeshShading: {
- DrawCoonPatchMeshes(
- pPattern->m_ShadingType == kTensorProductPatchMeshShading, pBitmap,
- &FinalMatrix, ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs,
- pColorSpace, fill_mode, alpha);
+ // The shading object can be a stream or a dictionary. We do not handle
+ // the case of dictionary at the moment.
+ if (pPattern->m_pShadingObj->IsStream()) {
+ DrawCoonPatchMeshes(
+ pPattern->m_ShadingType == kTensorProductPatchMeshShading, pBitmap,
+ &FinalMatrix, ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs,
+ pColorSpace, fill_mode, alpha);
+ }
} break;
}
if (bAlphaMode) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698