| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/include/cpdf_page.h" | 7 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" | 11 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" |
| 12 #include "core/fpdfapi/fpdf_page/pageint.h" | 12 #include "core/fpdfapi/fpdf_page/pageint.h" |
| 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 14 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 14 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
| 15 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" | 15 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" |
| 16 #include "core/fpdfapi/fpdf_render/cpdf_pagerendercache.h" | 16 #include "core/fpdfapi/fpdf_render/cpdf_pagerendercache.h" |
| 17 #include "third_party/base/stl_util.h" | 17 #include "third_party/base/stl_util.h" |
| 18 | 18 |
| 19 CPDF_Page::CPDF_Page(CPDF_Document* pDocument, | 19 CPDF_Page::CPDF_Page(CPDF_Document* pDocument, |
| 20 CPDF_Dictionary* pPageDict, | 20 CPDF_Dictionary* pPageDict, |
| 21 bool bPageCache) | 21 bool bPageCache) |
| 22 : m_PageWidth(100), | 22 : m_PageWidth(100), |
| 23 m_PageHeight(100), | 23 m_PageHeight(100), |
| 24 m_pView(nullptr), |
| 24 m_pPageRender(bPageCache ? new CPDF_PageRenderCache(this) : nullptr) { | 25 m_pPageRender(bPageCache ? new CPDF_PageRenderCache(this) : nullptr) { |
| 25 m_pFormDict = pPageDict; | 26 m_pFormDict = pPageDict; |
| 26 m_pDocument = pDocument; | 27 m_pDocument = pDocument; |
| 27 if (!pPageDict) | 28 if (!pPageDict) |
| 28 return; | 29 return; |
| 29 | 30 |
| 30 CPDF_Object* pageAttr = GetPageAttr("Resources"); | 31 CPDF_Object* pageAttr = GetPageAttr("Resources"); |
| 31 m_pResources = pageAttr ? pageAttr->GetDict() : nullptr; | 32 m_pResources = pageAttr ? pageAttr->GetDict() : nullptr; |
| 32 m_pPageResources = m_pResources; | 33 m_pPageResources = m_pResources; |
| 33 CPDF_Object* pRotate = GetPageAttr("Rotate"); | 34 CPDF_Object* pRotate = GetPageAttr("Rotate"); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 y2 = yPos; | 161 y2 = yPos; |
| 161 break; | 162 break; |
| 162 } | 163 } |
| 163 display_matrix.Set( | 164 display_matrix.Set( |
| 164 ((FX_FLOAT)(x2 - x0)) / m_PageWidth, ((FX_FLOAT)(y2 - y0)) / m_PageWidth, | 165 ((FX_FLOAT)(x2 - x0)) / m_PageWidth, ((FX_FLOAT)(y2 - y0)) / m_PageWidth, |
| 165 ((FX_FLOAT)(x1 - x0)) / m_PageHeight, | 166 ((FX_FLOAT)(x1 - x0)) / m_PageHeight, |
| 166 ((FX_FLOAT)(y1 - y0)) / m_PageHeight, (FX_FLOAT)x0, (FX_FLOAT)y0); | 167 ((FX_FLOAT)(y1 - y0)) / m_PageHeight, (FX_FLOAT)x0, (FX_FLOAT)y0); |
| 167 matrix = m_PageMatrix; | 168 matrix = m_PageMatrix; |
| 168 matrix.Concat(display_matrix); | 169 matrix.Concat(display_matrix); |
| 169 } | 170 } |
| OLD | NEW |