Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../../../include/fpdfapi/fpdf_render.h" | 7 #include "../../../include/fpdfapi/fpdf_render.h" |
| 8 #include "../../../include/fpdfapi/fpdf_pageobj.h" | 8 #include "../../../include/fpdfapi/fpdf_pageobj.h" |
| 9 #include "../../../include/fxge/fx_ge.h" | 9 #include "../../../include/fxge/fx_ge.h" |
| 10 #include "../fpdf_page/pageint.h" | 10 #include "../fpdf_page/pageint.h" |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 861 buffer.Initialize(m_pContext, m_pDevice, &clip_rect, m_pCurObj, 150); | 861 buffer.Initialize(m_pContext, m_pDevice, &clip_rect, m_pCurObj, 150); |
| 862 CFX_AffineMatrix FinalMatrix = *pMatrix; | 862 CFX_AffineMatrix FinalMatrix = *pMatrix; |
| 863 FinalMatrix.Concat(*buffer.GetMatrix()); | 863 FinalMatrix.Concat(*buffer.GetMatrix()); |
| 864 CFX_DIBitmap* pBitmap = buffer.GetBitmap(); | 864 CFX_DIBitmap* pBitmap = buffer.GetBitmap(); |
| 865 if (pBitmap->GetBuffer() == NULL) { | 865 if (pBitmap->GetBuffer() == NULL) { |
| 866 return; | 866 return; |
| 867 } | 867 } |
| 868 pBitmap->Clear(background); | 868 pBitmap->Clear(background); |
| 869 int fill_mode = m_Options.m_Flags; | 869 int fill_mode = m_Options.m_Flags; |
| 870 switch (pPattern->m_ShadingType) { | 870 switch (pPattern->m_ShadingType) { |
| 871 case 1: | 871 case kInvalidShading: |
| 872 case kMaxShading: | |
| 873 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.
| |
| 874 case kFunctionBasedShading: | |
| 872 DrawFuncShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, | 875 DrawFuncShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, pColorSpace, |
| 873 alpha); | 876 alpha); |
| 874 break; | 877 break; |
| 875 case 2: | 878 case kAxialShading: |
| 876 DrawAxialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, | 879 DrawAxialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, |
| 877 pColorSpace, alpha); | 880 pColorSpace, alpha); |
| 878 break; | 881 break; |
| 879 case 3: | 882 case kRadialShading: |
| 880 DrawRadialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, | 883 DrawRadialShading(pBitmap, &FinalMatrix, pDict, pFuncs, nFuncs, |
| 881 pColorSpace, alpha); | 884 pColorSpace, alpha); |
| 882 break; | 885 break; |
| 883 case 4: { | 886 case kFreeFormGouraudTriangleMeshShading: { |
| 884 DrawFreeGouraudShading(pBitmap, &FinalMatrix, | 887 DrawFreeGouraudShading(pBitmap, &FinalMatrix, |
| 885 ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs, | 888 ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs, |
| 886 pColorSpace, alpha); | 889 pColorSpace, alpha); |
| 887 } break; | 890 } break; |
| 888 case 5: { | 891 case kLatticeFormGouraudTriangleMeshShading: { |
| 889 DrawLatticeGouraudShading(pBitmap, &FinalMatrix, | 892 DrawLatticeGouraudShading(pBitmap, &FinalMatrix, |
| 890 ToStream(pPattern->m_pShadingObj), pFuncs, | 893 ToStream(pPattern->m_pShadingObj), pFuncs, |
| 891 nFuncs, pColorSpace, alpha); | 894 nFuncs, pColorSpace, alpha); |
| 892 } break; | 895 } break; |
| 893 case 6: | 896 case kCoonsPatchMeshShading: |
| 894 case 7: { | 897 case kTensorProductPatchMeshShading: { |
| 895 DrawCoonPatchMeshes(pPattern->m_ShadingType - 6, pBitmap, &FinalMatrix, | 898 DrawCoonPatchMeshes( |
| 896 ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs, | 899 pPattern->m_ShadingType == kTensorProductPatchMeshShading, pBitmap, |
| 897 pColorSpace, fill_mode, alpha); | 900 &FinalMatrix, ToStream(pPattern->m_pShadingObj), pFuncs, nFuncs, |
| 901 pColorSpace, fill_mode, alpha); | |
| 898 } break; | 902 } break; |
| 899 } | 903 } |
| 900 if (bAlphaMode) { | 904 if (bAlphaMode) { |
| 901 pBitmap->LoadChannel(FXDIB_Red, pBitmap, FXDIB_Alpha); | 905 pBitmap->LoadChannel(FXDIB_Red, pBitmap, FXDIB_Alpha); |
| 902 } | 906 } |
| 903 if (m_Options.m_ColorMode == RENDER_COLOR_GRAY) { | 907 if (m_Options.m_ColorMode == RENDER_COLOR_GRAY) { |
| 904 pBitmap->ConvertColorScale(m_Options.m_ForeColor, m_Options.m_BackColor); | 908 pBitmap->ConvertColorScale(m_Options.m_ForeColor, m_Options.m_BackColor); |
| 905 } | 909 } |
| 906 buffer.OutputToDevice(); | 910 buffer.OutputToDevice(); |
| 907 } | 911 } |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1203 } | 1207 } |
| 1204 } | 1208 } |
| 1205 if (bStroke) { | 1209 if (bStroke) { |
| 1206 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); | 1210 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); |
| 1207 if (StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) { | 1211 if (StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) { |
| 1208 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); | 1212 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); |
| 1209 bStroke = FALSE; | 1213 bStroke = FALSE; |
| 1210 } | 1214 } |
| 1211 } | 1215 } |
| 1212 } | 1216 } |
| OLD | NEW |