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

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

Issue 2292363002: Make CPDF_GraphState have a CPDF_GraphStateData instead of 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
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_textobject.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render.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/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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 } 874 }
875 } 875 }
876 876
877 void CPDF_StreamContentParser::Handle_SetFlat() { 877 void CPDF_StreamContentParser::Handle_SetFlat() {
878 m_pCurStates->m_GeneralState.GetPrivateCopy()->m_Flatness = GetNumber(0); 878 m_pCurStates->m_GeneralState.GetPrivateCopy()->m_Flatness = GetNumber(0);
879 } 879 }
880 880
881 void CPDF_StreamContentParser::Handle_BeginImageData() {} 881 void CPDF_StreamContentParser::Handle_BeginImageData() {}
882 882
883 void CPDF_StreamContentParser::Handle_SetLineJoin() { 883 void CPDF_StreamContentParser::Handle_SetLineJoin() {
884 m_pCurStates->m_GraphState.GetPrivateCopy()->m_LineJoin = 884 m_pCurStates->m_GraphState.SetLineJoin(
885 (CFX_GraphStateData::LineJoin)GetInteger(0); 885 static_cast<CFX_GraphStateData::LineJoin>(GetInteger(0)));
886 } 886 }
887 887
888 void CPDF_StreamContentParser::Handle_SetLineCap() { 888 void CPDF_StreamContentParser::Handle_SetLineCap() {
889 m_pCurStates->m_GraphState.GetPrivateCopy()->m_LineCap = 889 m_pCurStates->m_GraphState.SetLineCap(
890 (CFX_GraphStateData::LineCap)GetInteger(0); 890 static_cast<CFX_GraphStateData::LineCap>(GetInteger(0)));
891 } 891 }
892 892
893 void CPDF_StreamContentParser::Handle_SetCMYKColor_Fill() { 893 void CPDF_StreamContentParser::Handle_SetCMYKColor_Fill() {
894 if (m_ParamCount != 4) 894 if (m_ParamCount != 4)
895 return; 895 return;
896 896
897 FX_FLOAT values[4]; 897 FX_FLOAT values[4];
898 for (int i = 0; i < 4; i++) { 898 for (int i = 0; i < 4; i++) {
899 values[i] = GetNumber(3 - i); 899 values[i] = GetNumber(3 - i);
900 } 900 }
(...skipping 22 matching lines...) Expand all
923 923
924 void CPDF_StreamContentParser::Handle_MoveTo() { 924 void CPDF_StreamContentParser::Handle_MoveTo() {
925 if (m_ParamCount != 2) 925 if (m_ParamCount != 2)
926 return; 926 return;
927 927
928 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_MOVETO); 928 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_MOVETO);
929 ParsePathObject(); 929 ParsePathObject();
930 } 930 }
931 931
932 void CPDF_StreamContentParser::Handle_SetMiterLimit() { 932 void CPDF_StreamContentParser::Handle_SetMiterLimit() {
933 m_pCurStates->m_GraphState.GetPrivateCopy()->m_MiterLimit = GetNumber(0); 933 m_pCurStates->m_GraphState.SetMiterLimit(GetNumber(0));
934 } 934 }
935 935
936 void CPDF_StreamContentParser::Handle_MarkPlace() {} 936 void CPDF_StreamContentParser::Handle_MarkPlace() {}
937 937
938 void CPDF_StreamContentParser::Handle_EndPath() { 938 void CPDF_StreamContentParser::Handle_EndPath() {
939 AddPathObject(0, FALSE); 939 AddPathObject(0, FALSE);
940 } 940 }
941 941
942 void CPDF_StreamContentParser::Handle_SaveGraphState() { 942 void CPDF_StreamContentParser::Handle_SaveGraphState() {
943 std::unique_ptr<CPDF_AllStates> pStates(new CPDF_AllStates); 943 std::unique_ptr<CPDF_AllStates> pStates(new CPDF_AllStates);
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 m_pCurStates->m_TextY = m_pCurStates->m_TextLineY; 1392 m_pCurStates->m_TextY = m_pCurStates->m_TextLineY;
1393 } 1393 }
1394 1394
1395 void CPDF_StreamContentParser::Handle_CurveTo_23() { 1395 void CPDF_StreamContentParser::Handle_CurveTo_23() {
1396 AddPathPoint(m_PathCurrentX, m_PathCurrentY, FXPT_BEZIERTO); 1396 AddPathPoint(m_PathCurrentX, m_PathCurrentY, FXPT_BEZIERTO);
1397 AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO); 1397 AddPathPoint(GetNumber(3), GetNumber(2), FXPT_BEZIERTO);
1398 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO); 1398 AddPathPoint(GetNumber(1), GetNumber(0), FXPT_BEZIERTO);
1399 } 1399 }
1400 1400
1401 void CPDF_StreamContentParser::Handle_SetLineWidth() { 1401 void CPDF_StreamContentParser::Handle_SetLineWidth() {
1402 FX_FLOAT width = GetNumber(0); 1402 m_pCurStates->m_GraphState.SetLineWidth(GetNumber(0));
1403 m_pCurStates->m_GraphState.GetPrivateCopy()->m_LineWidth = width;
1404 } 1403 }
1405 1404
1406 void CPDF_StreamContentParser::Handle_Clip() { 1405 void CPDF_StreamContentParser::Handle_Clip() {
1407 m_PathClipType = FXFILL_WINDING; 1406 m_PathClipType = FXFILL_WINDING;
1408 } 1407 }
1409 1408
1410 void CPDF_StreamContentParser::Handle_EOClip() { 1409 void CPDF_StreamContentParser::Handle_EOClip() {
1411 m_PathClipType = FXFILL_ALTERNATE; 1410 m_PathClipType = FXFILL_ALTERNATE;
1412 } 1411 }
1413 1412
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 } else { 1683 } else {
1685 PDF_ReplaceAbbr(pElement); 1684 PDF_ReplaceAbbr(pElement);
1686 } 1685 }
1687 } 1686 }
1688 break; 1687 break;
1689 } 1688 }
1690 default: 1689 default:
1691 break; 1690 break;
1692 } 1691 }
1693 } 1692 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_textobject.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698