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 "core/fxcrt/include/fx_system.h" | 7 #include "core/fxcrt/include/fx_system.h" |
8 #include "core/fxge/include/fx_ge.h" | 8 #include "core/fxge/include/fx_ge.h" |
9 | 9 |
10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 10 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 return FALSE; | 131 return FALSE; |
132 | 132 |
133 CGContextSaveGState(ctx); | 133 CGContextSaveGState(ctx); |
134 CGContextSetTextDrawingMode(ctx, kCGTextFillClip); | 134 CGContextSetTextDrawingMode(ctx, kCGTextFillClip); |
135 CGRect rect_cg; | 135 CGRect rect_cg; |
136 CGImageRef pImageCG = nullptr; | 136 CGImageRef pImageCG = nullptr; |
137 if (m_pClipRgn) { | 137 if (m_pClipRgn) { |
138 rect_cg = | 138 rect_cg = |
139 CGRectMake(m_pClipRgn->GetBox().left, m_pClipRgn->GetBox().top, | 139 CGRectMake(m_pClipRgn->GetBox().left, m_pClipRgn->GetBox().top, |
140 m_pClipRgn->GetBox().Width(), m_pClipRgn->GetBox().Height()); | 140 m_pClipRgn->GetBox().Width(), m_pClipRgn->GetBox().Height()); |
141 const CFX_DIBitmap* pClipMask = m_pClipRgn->GetMask(); | 141 const CFX_DIBitmap* pClipMask = m_pClipRgn->GetMask().GetObject(); |
142 if (pClipMask) { | 142 if (pClipMask) { |
143 CGDataProviderRef pClipMaskDataProvider = CGDataProviderCreateWithData( | 143 CGDataProviderRef pClipMaskDataProvider = CGDataProviderCreateWithData( |
144 nullptr, pClipMask->GetBuffer(), | 144 nullptr, pClipMask->GetBuffer(), |
145 pClipMask->GetPitch() * pClipMask->GetHeight(), _DoNothing); | 145 pClipMask->GetPitch() * pClipMask->GetHeight(), _DoNothing); |
146 CGFloat decode_f[2] = {255.f, 0.f}; | 146 CGFloat decode_f[2] = {255.f, 0.f}; |
147 pImageCG = CGImageMaskCreate( | 147 pImageCG = CGImageMaskCreate( |
148 pClipMask->GetWidth(), pClipMask->GetHeight(), 8, 8, | 148 pClipMask->GetWidth(), pClipMask->GetHeight(), 8, 8, |
149 pClipMask->GetPitch(), pClipMaskDataProvider, decode_f, FALSE); | 149 pClipMask->GetPitch(), pClipMaskDataProvider, decode_f, FALSE); |
150 CGDataProviderRelease(pClipMaskDataProvider); | 150 CGDataProviderRelease(pClipMaskDataProvider); |
151 } | 151 } |
(...skipping 19 matching lines...) Expand all Loading... |
171 if (m_pPlatformFont) { | 171 if (m_pPlatformFont) { |
172 CQuartz2D& quartz2d = | 172 CQuartz2D& quartz2d = |
173 static_cast<CApplePlatform*>(CFX_GEModule::Get()->GetPlatformData()) | 173 static_cast<CApplePlatform*>(CFX_GEModule::Get()->GetPlatformData()) |
174 ->m_quartz2d; | 174 ->m_quartz2d; |
175 quartz2d.DestroyFont(m_pPlatformFont); | 175 quartz2d.DestroyFont(m_pPlatformFont); |
176 m_pPlatformFont = nullptr; | 176 m_pPlatformFont = nullptr; |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ | 180 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ |
OLD | NEW |