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

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp

Issue 1570873005: Tidy up shading patterns (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: || Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "render_int.h" 7 #include "render_int.h"
8 8
9 #include "core/include/fpdfapi/fpdf_pageobj.h" 9 #include "core/include/fpdfapi/fpdf_pageobj.h"
10 #include "core/include/fpdfapi/fpdf_render.h" 10 #include "core/include/fpdfapi/fpdf_render.h"
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 delete pPatternBitmap; 1180 delete pPatternBitmap;
1181 } 1181 }
1182 void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj, 1182 void CPDF_RenderStatus::DrawPathWithPattern(CPDF_PathObject* pPathObj,
1183 const CFX_Matrix* pObj2Device, 1183 const CFX_Matrix* pObj2Device,
1184 CPDF_Color* pColor, 1184 CPDF_Color* pColor,
1185 FX_BOOL bStroke) { 1185 FX_BOOL bStroke) {
1186 CPDF_Pattern* pattern = pColor->GetPattern(); 1186 CPDF_Pattern* pattern = pColor->GetPattern();
1187 if (!pattern) { 1187 if (!pattern) {
1188 return; 1188 return;
1189 } 1189 }
1190 if (pattern->m_PatternType == PATTERN_TILING) { 1190 if (pattern->m_PatternType == CPDF_Pattern::TILING) {
1191 DrawTilingPattern((CPDF_TilingPattern*)pattern, pPathObj, pObj2Device, 1191 DrawTilingPattern(static_cast<CPDF_TilingPattern*>(pattern), pPathObj,
1192 bStroke); 1192 pObj2Device, bStroke);
1193 } else { 1193 } else {
1194 DrawShadingPattern((CPDF_ShadingPattern*)pattern, pPathObj, pObj2Device, 1194 DrawShadingPattern(static_cast<CPDF_ShadingPattern*>(pattern), pPathObj,
1195 bStroke); 1195 pObj2Device, bStroke);
1196 } 1196 }
1197 } 1197 }
1198 void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj, 1198 void CPDF_RenderStatus::ProcessPathPattern(CPDF_PathObject* pPathObj,
1199 const CFX_Matrix* pObj2Device, 1199 const CFX_Matrix* pObj2Device,
1200 int& filltype, 1200 int& filltype,
1201 FX_BOOL& bStroke) { 1201 FX_BOOL& bStroke) {
1202 if (filltype) { 1202 if (filltype) {
1203 CPDF_Color& FillColor = *pPathObj->m_ColorState.GetFillColor(); 1203 CPDF_Color& FillColor = *pPathObj->m_ColorState.GetFillColor();
1204 if (FillColor.m_pCS && FillColor.m_pCS->GetFamily() == PDFCS_PATTERN) { 1204 if (FillColor.m_pCS && FillColor.m_pCS->GetFamily() == PDFCS_PATTERN) {
1205 DrawPathWithPattern(pPathObj, pObj2Device, &FillColor, FALSE); 1205 DrawPathWithPattern(pPathObj, pObj2Device, &FillColor, FALSE);
1206 filltype = 0; 1206 filltype = 0;
1207 } 1207 }
1208 } 1208 }
1209 if (bStroke) { 1209 if (bStroke) {
1210 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor(); 1210 CPDF_Color& StrokeColor = *pPathObj->m_ColorState.GetStrokeColor();
1211 if (StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) { 1211 if (StrokeColor.m_pCS && StrokeColor.m_pCS->GetFamily() == PDFCS_PATTERN) {
1212 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE); 1212 DrawPathWithPattern(pPathObj, pObj2Device, &StrokeColor, TRUE);
1213 bStroke = FALSE; 1213 bStroke = FALSE;
1214 } 1214 }
1215 } 1215 }
1216 } 1216 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698