| 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 "pageint.h" | 7 #include "pageint.h" |
| 8 | 8 |
| 9 #include "core/include/fpdfapi/fpdf_page.h" | 9 #include "core/include/fpdfapi/fpdf_page.h" |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 CPDF_Pattern::~CPDF_Pattern() {} | 38 CPDF_Pattern::~CPDF_Pattern() {} |
| 39 CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc, | 39 CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc, |
| 40 CPDF_Object* pPatternObj, | 40 CPDF_Object* pPatternObj, |
| 41 const CFX_Matrix* parentMatrix) | 41 const CFX_Matrix* parentMatrix) |
| 42 : CPDF_Pattern(parentMatrix) { | 42 : CPDF_Pattern(parentMatrix) { |
| 43 m_PatternType = PATTERN_TILING; | 43 m_PatternType = PATTERN_TILING; |
| 44 m_pPatternObj = pPatternObj; | 44 m_pPatternObj = pPatternObj; |
| 45 m_pDocument = pDoc; | 45 m_pDocument = pDoc; |
| 46 CPDF_Dictionary* pDict = m_pPatternObj->GetDict(); | 46 CPDF_Dictionary* pDict = m_pPatternObj->GetDict(); |
| 47 ASSERT(pDict != NULL); | 47 ASSERT(pDict); |
| 48 m_Pattern2Form = pDict->GetMatrix("Matrix"); | 48 m_Pattern2Form = pDict->GetMatrix("Matrix"); |
| 49 m_bColored = pDict->GetInteger("PaintType") == 1; | 49 m_bColored = pDict->GetInteger("PaintType") == 1; |
| 50 if (parentMatrix) { | 50 if (parentMatrix) { |
| 51 m_Pattern2Form.Concat(*parentMatrix); | 51 m_Pattern2Form.Concat(*parentMatrix); |
| 52 } | 52 } |
| 53 m_pForm = NULL; | 53 m_pForm = NULL; |
| 54 } | 54 } |
| 55 CPDF_TilingPattern::~CPDF_TilingPattern() { | 55 CPDF_TilingPattern::~CPDF_TilingPattern() { |
| 56 delete m_pForm; | 56 delete m_pForm; |
| 57 m_pForm = NULL; | 57 m_pForm = NULL; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 81 CPDF_Object* pPatternObj, | 81 CPDF_Object* pPatternObj, |
| 82 FX_BOOL bShading, | 82 FX_BOOL bShading, |
| 83 const CFX_Matrix* parentMatrix) | 83 const CFX_Matrix* parentMatrix) |
| 84 : CPDF_Pattern(parentMatrix) { | 84 : CPDF_Pattern(parentMatrix) { |
| 85 m_PatternType = PATTERN_SHADING; | 85 m_PatternType = PATTERN_SHADING; |
| 86 m_pPatternObj = bShading ? NULL : pPatternObj; | 86 m_pPatternObj = bShading ? NULL : pPatternObj; |
| 87 m_pDocument = pDoc; | 87 m_pDocument = pDoc; |
| 88 m_bShadingObj = bShading; | 88 m_bShadingObj = bShading; |
| 89 if (!bShading) { | 89 if (!bShading) { |
| 90 CPDF_Dictionary* pDict = m_pPatternObj->GetDict(); | 90 CPDF_Dictionary* pDict = m_pPatternObj->GetDict(); |
| 91 ASSERT(pDict != NULL); | 91 ASSERT(pDict); |
| 92 m_Pattern2Form = pDict->GetMatrix("Matrix"); | 92 m_Pattern2Form = pDict->GetMatrix("Matrix"); |
| 93 m_pShadingObj = pDict->GetElementValue("Shading"); | 93 m_pShadingObj = pDict->GetElementValue("Shading"); |
| 94 if (parentMatrix) { | 94 if (parentMatrix) { |
| 95 m_Pattern2Form.Concat(*parentMatrix); | 95 m_Pattern2Form.Concat(*parentMatrix); |
| 96 } | 96 } |
| 97 } else { | 97 } else { |
| 98 m_pShadingObj = pPatternObj; | 98 m_pShadingObj = pPatternObj; |
| 99 } | 99 } |
| 100 m_ShadingType = kInvalidShading; | 100 m_ShadingType = kInvalidShading; |
| 101 m_pCS = NULL; | 101 m_pCS = NULL; |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } | 324 } |
| 325 } | 325 } |
| 326 stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits * | 326 stream.m_BitStream.SkipBits(stream.m_nComps * stream.m_nCompBits * |
| 327 color_count); | 327 color_count); |
| 328 if (bGouraud) | 328 if (bGouraud) |
| 329 stream.m_BitStream.ByteAlign(); | 329 stream.m_BitStream.ByteAlign(); |
| 330 } | 330 } |
| 331 rect.Transform(pMatrix); | 331 rect.Transform(pMatrix); |
| 332 return rect; | 332 return rect; |
| 333 } | 333 } |
| OLD | NEW |