From d21f22e2c07d61bf15ee3af91869901adb6f0cde Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 2 Sep 2016 17:34:21 -0700 Subject: Make CPDF_ClipPath have a CPDF_ClipPathData rather than inheriting. Make Data private to the ClipPath class which manages it transparently for its callers. This prevents the callers from having to remember to make a copy before dirtying the shared data, since the operations that modify state will do this under the covers for us. Review-Url: https://codereview.chromium.org/2301263003 --- core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp') diff --git a/core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp b/core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp index d869bc20b3..03dd22c134 100644 --- a/core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_shadingobject.cpp @@ -35,10 +35,9 @@ CPDF_PageObject::Type CPDF_ShadingObject::GetType() const { } void CPDF_ShadingObject::Transform(const CFX_Matrix& matrix) { - if (m_ClipPath) { - m_ClipPath.GetPrivateCopy(); + if (m_ClipPath) m_ClipPath.Transform(matrix); - } + m_Matrix.Concat(matrix); if (m_ClipPath) { CalcBoundingBox(); -- cgit v1.2.3