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

Side by Side Diff: core/fpdfapi/fpdf_page/fpdf_page_parser.cpp

Issue 2294133002: Make CPDF_ColorState have a CFX_ColorStateData rather than inheriting (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, nits. Created 4 years, 3 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
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/fpdfapi/fpdf_page/pageint.h" 7 #include "core/fpdfapi/fpdf_page/pageint.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 679
680 void CPDF_StreamContentParser::Handle_ConcatMatrix() { 680 void CPDF_StreamContentParser::Handle_ConcatMatrix() {
681 CFX_Matrix new_matrix(GetNumber(5), GetNumber(4), GetNumber(3), GetNumber(2), 681 CFX_Matrix new_matrix(GetNumber(5), GetNumber(4), GetNumber(3), GetNumber(2),
682 GetNumber(1), GetNumber(0)); 682 GetNumber(1), GetNumber(0));
683 new_matrix.Concat(m_pCurStates->m_CTM); 683 new_matrix.Concat(m_pCurStates->m_CTM);
684 m_pCurStates->m_CTM = new_matrix; 684 m_pCurStates->m_CTM = new_matrix;
685 OnChangeTextMatrix(); 685 OnChangeTextMatrix();
686 } 686 }
687 687
688 void CPDF_StreamContentParser::Handle_SetColorSpace_Fill() { 688 void CPDF_StreamContentParser::Handle_SetColorSpace_Fill() {
689 CFX_ByteString csname = GetString(0); 689 CPDF_ColorSpace* pCS = FindColorSpace(GetString(0));
690 CPDF_ColorSpace* pCS = FindColorSpace(csname); 690 if (!pCS)
691 if (!pCS) {
692 return; 691 return;
693 } 692
694 m_pCurStates->m_ColorState.GetPrivateCopy()->m_FillColor.SetColorSpace(pCS); 693 m_pCurStates->m_ColorState.GetMutableFillColor()->SetColorSpace(pCS);
695 } 694 }
696 695
697 void CPDF_StreamContentParser::Handle_SetColorSpace_Stroke() { 696 void CPDF_StreamContentParser::Handle_SetColorSpace_Stroke() {
698 CFX_ByteString csname = GetString(0); 697 CPDF_ColorSpace* pCS = FindColorSpace(GetString(0));
699 CPDF_ColorSpace* pCS = FindColorSpace(csname); 698 if (!pCS)
700 if (!pCS) {
701 return; 699 return;
702 } 700
703 m_pCurStates->m_ColorState.GetPrivateCopy()->m_StrokeColor.SetColorSpace(pCS); 701 m_pCurStates->m_ColorState.GetMutableStrokeColor()->SetColorSpace(pCS);
704 } 702 }
705 703
706 void CPDF_StreamContentParser::Handle_SetDash() { 704 void CPDF_StreamContentParser::Handle_SetDash() {
707 CPDF_Array* pArray = ToArray(GetObject(1)); 705 CPDF_Array* pArray = ToArray(GetObject(1));
708 if (!pArray) 706 if (!pArray)
709 return; 707 return;
710 708
711 m_pCurStates->SetLineDash(pArray, GetNumber(0), 1.0f); 709 m_pCurStates->SetLineDash(pArray, GetNumber(0), 1.0f);
712 } 710 }
713 711
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 } else { 1681 } else {
1684 PDF_ReplaceAbbr(pElement); 1682 PDF_ReplaceAbbr(pElement);
1685 } 1683 }
1686 } 1684 }
1687 break; 1685 break;
1688 } 1686 }
1689 default: 1687 default:
1690 break; 1688 break;
1691 } 1689 }
1692 } 1690 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_graphicstates.cpp ('k') | core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698