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

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

Issue 1418623011: Give names to the shading types (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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
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..964b98bb791bc5e8230f0c7db6a9710879644e7f 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -868,33 +868,34 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
pBitmap->Clear(background);
int fill_mode = m_Options.m_Flags;
switch (pPattern->m_ShadingType) {
- case 1:
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698