Chromium Code Reviews| 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 #if _FXM_PLATFORM_ == _FX_PLATFORM_WINDOWS_ | |
|
Lei Zhang
2015/05/20 21:43:16
Hans: do you know if Clang for Windows will suppor
hans
2015/05/20 21:53:07
It doesn't support it currently, and I don't see i
Tom Sepez
2015/05/21 00:07:23
Remove it and HFTB.
Lei Zhang
2015/05/21 00:14:08
Do you want to ask Jun about this? He may know why
| |
| 76 #pragma optimize( "", off ) | 77 #pragma optimize( "", off ) |
| 78 #endif | |
| 77 FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine) | 79 FX_BOOL CPDF_PSProc::Execute(CPDF_PSEngine* pEngine) |
| 78 { | 80 { |
| 79 int size = m_Operators.GetSize(); | 81 int size = m_Operators.GetSize(); |
| 80 for (int i = 0; i < size; i ++) { | 82 for (int i = 0; i < size; i ++) { |
| 81 PDF_PSOP op = (PDF_PSOP)(FX_UINTPTR)m_Operators[i]; | 83 PDF_PSOP op = (PDF_PSOP)(FX_UINTPTR)m_Operators[i]; |
| 82 if (op == PSOP_PROC) { | 84 if (op == PSOP_PROC) { |
| 83 i ++; | 85 i ++; |
| 84 } else if (op == PSOP_CONST) { | 86 } else if (op == PSOP_CONST) { |
| 85 pEngine->Push(*(FX_FLOAT*)m_Operators[i + 1]); | 87 pEngine->Push(*(FX_FLOAT*)m_Operators[i + 1]); |
| 86 i ++; | 88 i ++; |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 100 ((CPDF_PSProc*)m_Operators[i - 3])->Execute(pEngine); | 102 ((CPDF_PSProc*)m_Operators[i - 3])->Execute(pEngine); |
| 101 } else { | 103 } else { |
| 102 ((CPDF_PSProc*)m_Operators[i - 1])->Execute(pEngine); | 104 ((CPDF_PSProc*)m_Operators[i - 1])->Execute(pEngine); |
| 103 } | 105 } |
| 104 } else { | 106 } else { |
| 105 pEngine->DoOperator(op); | 107 pEngine->DoOperator(op); |
| 106 } | 108 } |
| 107 } | 109 } |
| 108 return TRUE; | 110 return TRUE; |
| 109 } | 111 } |
| 112 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | |
| 110 #pragma optimize( "", on ) | 113 #pragma optimize( "", on ) |
| 114 #endif | |
| 111 CPDF_PSEngine::CPDF_PSEngine() | 115 CPDF_PSEngine::CPDF_PSEngine() |
| 112 { | 116 { |
| 113 m_StackCount = 0; | 117 m_StackCount = 0; |
| 114 } | 118 } |
| 115 CPDF_PSEngine::~CPDF_PSEngine() | 119 CPDF_PSEngine::~CPDF_PSEngine() |
| 116 { | 120 { |
| 117 } | 121 } |
| 118 void CPDF_PSEngine::Push(FX_FLOAT v) | 122 void CPDF_PSEngine::Push(FX_FLOAT v) |
| 119 { | 123 { |
| 120 if (m_StackCount == 100) { | 124 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 ++) { | 902 for (int i = 0; i < m_nOutputs; i ++) { |
| 899 if (results[i] < m_pRanges[i * 2]) { | 903 if (results[i] < m_pRanges[i * 2]) { |
| 900 results[i] = m_pRanges[i * 2]; | 904 results[i] = m_pRanges[i * 2]; |
| 901 } else if (results[i] > m_pRanges[i * 2 + 1]) { | 905 } else if (results[i] > m_pRanges[i * 2 + 1]) { |
| 902 results[i] = m_pRanges[i * 2 + 1]; | 906 results[i] = m_pRanges[i * 2 + 1]; |
| 903 } | 907 } |
| 904 } | 908 } |
| 905 } | 909 } |
| 906 return TRUE; | 910 return TRUE; |
| 907 } | 911 } |
| OLD | NEW |