Chromium Code Reviews| Index: core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp |
| diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp |
| index 4ed6c0767581d0824ce0a1352c2d6e4c14246018..467ffc900c0573353c34f48f4572ca324f3aa56d 100644 |
| --- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp |
| +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp |
| @@ -868,33 +868,37 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern, |
| pBitmap->Clear(background); |
| int fill_mode = m_Options.m_Flags; |
| switch (pPattern->m_ShadingType) { |
| - case 1: |
| + case kInvalidShading: |
| + case kMaxShading: |
| + return; |
|
dsinclair
2015/10/27 17:15:17
I added handling for the two extra types here, it
Tom Sepez
2015/10/27 17:17:13
Acknowledged.
|
| + case kFunctionBasedShading: |
| DrawFuncShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, |
| alpha); |
| break; |
| - case 2: |
| + case kAxialShading: |
| DrawAxialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, |
| pColorSpace, alpha); |
| break; |
| - case 3: |
| + case kRadialShading: |
| DrawRadialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, |
| pColorSpace, alpha); |
| break; |
| - case 4: { |
| + case kFreeFormGouraudTriangleMeshShading: { |
| DrawFreeGouraudShading(pBitmap, &FinalMatrix, |
| ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs, |
| pColorSpace, alpha); |
| } break; |
| - case 5: { |
| + case kLatticeFormGouraudTriangleMeshShading: { |
| DrawLatticeGouraudShading(pBitmap, &FinalMatrix, |
| ToStream(pPattern->m_pShadingObj), pFuncs, |
| nFuncs, pColorSpace, alpha); |
| } break; |
| - case 6: |
| - case 7: { |
| - DrawCoonPatchMeshes(pPattern->m_ShadingType - 6, pBitmap, &FinalMatrix, |
| - ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs, |
| - pColorSpace, fill_mode, alpha); |
| + case kCoonsPatchMeshShading: |
| + case kTensorProductPatchMeshShading: { |
| + DrawCoonPatchMeshes( |
| + pPattern->m_ShadingType == kTensorProductPatchMeshShading, pBitmap, |
| + &FinalMatrix, ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs, |
| + pColorSpace, fill_mode, alpha); |
| } break; |
| } |
| if (bAlphaMode) { |