| 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/page/cpdf_tilingpattern.h" | 7 #include "core/fpdfapi/page/cpdf_tilingpattern.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/page/cpdf_form.h" | 9 #include "core/fpdfapi/page/cpdf_form.h" |
| 10 #include "core/fpdfapi/parser/cpdf_dictionary.h" | 10 #include "core/fpdfapi/parser/cpdf_dictionary.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 CPDF_TilingPattern::~CPDF_TilingPattern() {} | 24 CPDF_TilingPattern::~CPDF_TilingPattern() {} |
| 25 | 25 |
| 26 CPDF_TilingPattern* CPDF_TilingPattern::AsTilingPattern() { | 26 CPDF_TilingPattern* CPDF_TilingPattern::AsTilingPattern() { |
| 27 return this; | 27 return this; |
| 28 } | 28 } |
| 29 | 29 |
| 30 CPDF_ShadingPattern* CPDF_TilingPattern::AsShadingPattern() { | 30 CPDF_ShadingPattern* CPDF_TilingPattern::AsShadingPattern() { |
| 31 return nullptr; | 31 return nullptr; |
| 32 } | 32 } |
| 33 | 33 |
| 34 FX_BOOL CPDF_TilingPattern::Load() { | 34 bool CPDF_TilingPattern::Load() { |
| 35 if (m_pForm) | 35 if (m_pForm) |
| 36 return TRUE; | 36 return true; |
| 37 | 37 |
| 38 CPDF_Dictionary* pDict = m_pPatternObj->GetDict(); | 38 CPDF_Dictionary* pDict = m_pPatternObj->GetDict(); |
| 39 if (!pDict) | 39 if (!pDict) |
| 40 return FALSE; | 40 return false; |
| 41 | 41 |
| 42 m_bColored = pDict->GetIntegerFor("PaintType") == 1; | 42 m_bColored = pDict->GetIntegerFor("PaintType") == 1; |
| 43 m_XStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumberFor("XStep")); | 43 m_XStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumberFor("XStep")); |
| 44 m_YStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumberFor("YStep")); | 44 m_YStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumberFor("YStep")); |
| 45 | 45 |
| 46 CPDF_Stream* pStream = m_pPatternObj->AsStream(); | 46 CPDF_Stream* pStream = m_pPatternObj->AsStream(); |
| 47 if (!pStream) | 47 if (!pStream) |
| 48 return FALSE; | 48 return false; |
| 49 | 49 |
| 50 m_pForm.reset(new CPDF_Form(m_pDocument, nullptr, pStream)); | 50 m_pForm.reset(new CPDF_Form(m_pDocument, nullptr, pStream)); |
| 51 m_pForm->ParseContent(nullptr, &m_ParentMatrix, nullptr); | 51 m_pForm->ParseContent(nullptr, &m_ParentMatrix, nullptr); |
| 52 m_BBox = pDict->GetRectFor("BBox"); | 52 m_BBox = pDict->GetRectFor("BBox"); |
| 53 return TRUE; | 53 return true; |
| 54 } | 54 } |
| OLD | NEW |