| 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_shadingobject.h" | 7 #include "core/fpdfapi/fpdf_page/include/cpdf_shadingobject.h" |
| 8 | 8 |
| 9 #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h" | 9 #include "core/fpdfapi/fpdf_page/cpdf_shadingpattern.h" |
| 10 #include "core/fpdfapi/fpdf_page/pageint.h" | 10 #include "core/fpdfapi/fpdf_page/pageint.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 obj->m_Matrix = m_Matrix; | 29 obj->m_Matrix = m_Matrix; |
| 30 return obj; | 30 return obj; |
| 31 } | 31 } |
| 32 | 32 |
| 33 CPDF_PageObject::Type CPDF_ShadingObject::GetType() const { | 33 CPDF_PageObject::Type CPDF_ShadingObject::GetType() const { |
| 34 return SHADING; | 34 return SHADING; |
| 35 } | 35 } |
| 36 | 36 |
| 37 void CPDF_ShadingObject::Transform(const CFX_Matrix& matrix) { | 37 void CPDF_ShadingObject::Transform(const CFX_Matrix& matrix) { |
| 38 if (m_ClipPath) { | 38 if (m_ClipPath) { |
| 39 m_ClipPath.GetPrivateCopy(); | 39 m_ClipPath.MakePrivateCopy(); |
| 40 m_ClipPath.Transform(matrix); | 40 m_ClipPath.Transform(matrix); |
| 41 } | 41 } |
| 42 m_Matrix.Concat(matrix); | 42 m_Matrix.Concat(matrix); |
| 43 if (m_ClipPath) { | 43 if (m_ClipPath) { |
| 44 CalcBoundingBox(); | 44 CalcBoundingBox(); |
| 45 } else { | 45 } else { |
| 46 matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom); | 46 matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 61 | 61 |
| 62 void CPDF_ShadingObject::CalcBoundingBox() { | 62 void CPDF_ShadingObject::CalcBoundingBox() { |
| 63 if (!m_ClipPath) | 63 if (!m_ClipPath) |
| 64 return; | 64 return; |
| 65 CFX_FloatRect rect = m_ClipPath.GetClipBox(); | 65 CFX_FloatRect rect = m_ClipPath.GetClipBox(); |
| 66 m_Left = rect.left; | 66 m_Left = rect.left; |
| 67 m_Bottom = rect.bottom; | 67 m_Bottom = rect.bottom; |
| 68 m_Right = rect.right; | 68 m_Right = rect.right; |
| 69 m_Top = rect.top; | 69 m_Top = rect.top; |
| 70 } | 70 } |
| OLD | NEW |