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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_parser.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/include/fpdfapi/fpdf_resource.h ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp » ('j') | 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 "core/src/fpdfapi/fpdf_page/pageint.h" 7 #include "core/src/fpdfapi/fpdf_page/pageint.h"
8 8
9 #include "core/include/fpdfapi/fpdf_module.h" 9 #include "core/include/fpdfapi/fpdf_module.h"
10 #include "core/include/fpdfapi/fpdf_page.h" 10 #include "core/include/fpdfapi/fpdf_page.h"
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 CPDF_ColorSpace* pCS); 1095 CPDF_ColorSpace* pCS);
1096 1096
1097 void CPDF_StreamContentParser::Handle_ShadeFill() { 1097 void CPDF_StreamContentParser::Handle_ShadeFill() {
1098 if (m_Options.m_bTextOnly) { 1098 if (m_Options.m_bTextOnly) {
1099 return; 1099 return;
1100 } 1100 }
1101 CPDF_Pattern* pPattern = FindPattern(GetString(0), TRUE); 1101 CPDF_Pattern* pPattern = FindPattern(GetString(0), TRUE);
1102 if (!pPattern) { 1102 if (!pPattern) {
1103 return; 1103 return;
1104 } 1104 }
1105 if (pPattern->m_PatternType != PATTERN_SHADING) { 1105 if (pPattern->m_PatternType != CPDF_Pattern::SHADING) {
1106 return; 1106 return;
1107 } 1107 }
1108 CPDF_ShadingPattern* pShading = (CPDF_ShadingPattern*)pPattern; 1108 CPDF_ShadingPattern* pShading = static_cast<CPDF_ShadingPattern*>(pPattern);
1109 if (!pShading->m_bShadingObj) { 1109 if (!pShading->m_bShadingObj) {
1110 return; 1110 return;
1111 } 1111 }
1112 if (!pShading->Load()) { 1112 if (!pShading->Load()) {
1113 return; 1113 return;
1114 } 1114 }
1115 CPDF_ShadingObject* pObj = new CPDF_ShadingObject; 1115 CPDF_ShadingObject* pObj = new CPDF_ShadingObject;
1116 pObj->m_pShading = pShading; 1116 pObj->m_pShading = pShading;
1117 SetGraphicStates(pObj, FALSE, FALSE, FALSE); 1117 SetGraphicStates(pObj, FALSE, FALSE, FALSE);
1118 pObj->m_Matrix = m_pCurStates->m_CTM; 1118 pObj->m_Matrix = m_pCurStates->m_CTM;
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 m_pObjectList->m_ObjectList.AddTail(pPathObj); 1518 m_pObjectList->m_ObjectList.AddTail(pPathObj);
1519 } 1519 }
1520 if (PathClipType) { 1520 if (PathClipType) {
1521 if (!matrix.IsIdentity()) { 1521 if (!matrix.IsIdentity()) {
1522 Path.Transform(&matrix); 1522 Path.Transform(&matrix);
1523 matrix.SetIdentity(); 1523 matrix.SetIdentity();
1524 } 1524 }
1525 m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, TRUE); 1525 m_pCurStates->m_ClipPath.AppendPath(Path, PathClipType, TRUE);
1526 } 1526 }
1527 } 1527 }
OLDNEW
« no previous file with comments | « core/include/fpdfapi/fpdf_resource.h ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698