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 <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include "../../../include/fpdfapi/fpdf_page.h" | 9 #include "../../../include/fpdfapi/fpdf_page.h" |
10 #include "../../../include/fpdfapi/fpdf_module.h" | 10 #include "../../../include/fpdfapi/fpdf_module.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 for (int i = 0; i < size; i ++) { | 66 for (int i = 0; i < size; i ++) { |
67 if (m_Operators[i] == (FX_LPVOID)PSOP_PROC) { | 67 if (m_Operators[i] == (FX_LPVOID)PSOP_PROC) { |
68 delete (CPDF_PSProc*)m_Operators[i + 1]; | 68 delete (CPDF_PSProc*)m_Operators[i + 1]; |
69 i ++; | 69 i ++; |
70 } else if (m_Operators[i] == (FX_LPVOID)PSOP_CONST) { | 70 } else if (m_Operators[i] == (FX_LPVOID)PSOP_CONST) { |
71 FX_Free((FX_FLOAT*)m_Operators[i + 1]); | 71 FX_Free((FX_FLOAT*)m_Operators[i + 1]); |
72 i ++; | 72 i ++; |
73 } | 73 } |
74 } | 74 } |
75 } | 75 } |
76 #pragma optimize( "", off ) | |
77 FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine) | 76 FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine) |
78 { | 77 { |
79 int size = m_Operators.GetSize(); | 78 int size = m_Operators.GetSize(); |
80 for (int i = 0; i < size; i ++) { | 79 for (int i = 0; i < size; i ++) { |
81 PDF_PSOP op = (PDF_PSOP)(FX_UINTPTR)m_Operators[i]; | 80 PDF_PSOP op = (PDF_PSOP)(FX_UINTPTR)m_Operators[i]; |
82 if (op == PSOP_PROC) { | 81 if (op == PSOP_PROC) { |
83 i ++; | 82 i ++; |
84 } else if (op == PSOP_CONST) { | 83 } else if (op == PSOP_CONST) { |
85 pEngine->Push(*(FX_FLOAT*)m_Operators[i + 1]); | 84 pEngine->Push(*(FX_FLOAT*)m_Operators[i + 1]); |
86 i ++; | 85 i ++; |
(...skipping 13 matching lines...) Expand all Loading... |
100 ((CPDF_PSProc*)m_Operators[i - 3])->Execute(pEngine); | 99 ((CPDF_PSProc*)m_Operators[i - 3])->Execute(pEngine); |
101 } else { | 100 } else { |
102 ((CPDF_PSProc*)m_Operators[i - 1])->Execute(pEngine); | 101 ((CPDF_PSProc*)m_Operators[i - 1])->Execute(pEngine); |
103 } | 102 } |
104 } else { | 103 } else { |
105 pEngine->DoOperator(op); | 104 pEngine->DoOperator(op); |
106 } | 105 } |
107 } | 106 } |
108 return TRUE; | 107 return TRUE; |
109 } | 108 } |
110 #pragma optimize( "", on ) | |
111 CPDF_PSEngine::CPDF_PSEngine() | 109 CPDF_PSEngine::CPDF_PSEngine() |
112 { | 110 { |
113 m_StackCount = 0; | 111 m_StackCount = 0; |
114 } | 112 } |
115 CPDF_PSEngine::~CPDF_PSEngine() | 113 CPDF_PSEngine::~CPDF_PSEngine() |
116 { | 114 { |
117 } | 115 } |
118 void CPDF_PSEngine::Push(FX_FLOAT v) | 116 void CPDF_PSEngine::Push(FX_FLOAT v) |
119 { | 117 { |
120 if (m_StackCount == 100) { | 118 if (m_StackCount == 100) { |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 for (int i = 0; i < m_nOutputs; i ++) { | 896 for (int i = 0; i < m_nOutputs; i ++) { |
899 if (results[i] < m_pRanges[i * 2]) { | 897 if (results[i] < m_pRanges[i * 2]) { |
900 results[i] = m_pRanges[i * 2]; | 898 results[i] = m_pRanges[i * 2]; |
901 } else if (results[i] > m_pRanges[i * 2 + 1]) { | 899 } else if (results[i] > m_pRanges[i * 2 + 1]) { |
902 results[i] = m_pRanges[i * 2 + 1]; | 900 results[i] = m_pRanges[i * 2 + 1]; |
903 } | 901 } |
904 } | 902 } |
905 } | 903 } |
906 return TRUE; | 904 return TRUE; |
907 } | 905 } |
OLD | NEW |