| 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 "xfa/fde/fde_render.h" | 7 #include "xfa/fde/fde_render.h" |
| 8 | 8 |
| 9 #include "xfa/fde/fde_object.h" |
| 9 #include "xfa/fde/fde_renderdevice.h" | 10 #include "xfa/fde/fde_renderdevice.h" |
| 10 #include "xfa/fgas/crt/fgas_memory.h" | 11 #include "xfa/fgas/crt/fgas_memory.h" |
| 11 | 12 |
| 12 #define FDE_PATHRENDER_Stroke 1 | 13 #define FDE_PATHRENDER_Stroke 1 |
| 13 #define FDE_PATHRENDER_Fill 2 | 14 #define FDE_PATHRENDER_Fill 2 |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 class CFDE_RenderContext : public IFDE_RenderContext, public CFX_Target { | 18 class CFDE_RenderContext : public IFDE_RenderContext, public CFX_Target { |
| 18 public: | 19 public: |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 FXSYS_assert(pTextSet != NULL && hText != NULL); | 210 FXSYS_assert(pTextSet != NULL && hText != NULL); |
| 210 IFX_Font* pFont = pTextSet->GetFont(hText); | 211 IFX_Font* pFont = pTextSet->GetFont(hText); |
| 211 if (pFont == NULL) { | 212 if (pFont == NULL) { |
| 212 return; | 213 return; |
| 213 } | 214 } |
| 214 int32_t iCount = pTextSet->GetDisplayPos(hText, NULL, FALSE); | 215 int32_t iCount = pTextSet->GetDisplayPos(hText, NULL, FALSE); |
| 215 if (iCount < 1) { | 216 if (iCount < 1) { |
| 216 return; | 217 return; |
| 217 } | 218 } |
| 218 if (m_pSolidBrush == NULL) { | 219 if (m_pSolidBrush == NULL) { |
| 219 m_pSolidBrush = (IFDE_SolidBrush*)IFDE_Brush::Create(FDE_BRUSHTYPE_Solid); | 220 m_pSolidBrush = new CFDE_SolidBrush; |
| 220 if (m_pSolidBrush == NULL) { | 221 if (m_pSolidBrush == NULL) { |
| 221 return; | 222 return; |
| 222 } | 223 } |
| 223 } | 224 } |
| 224 if (m_pCharPos == NULL) { | 225 if (m_pCharPos == NULL) { |
| 225 m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, iCount); | 226 m_pCharPos = FX_Alloc(FXTEXT_CHARPOS, iCount); |
| 226 } else if (m_iCharPosCount < iCount) { | 227 } else if (m_iCharPosCount < iCount) { |
| 227 m_pCharPos = FX_Realloc(FXTEXT_CHARPOS, m_pCharPos, iCount); | 228 m_pCharPos = FX_Realloc(FXTEXT_CHARPOS, m_pCharPos, iCount); |
| 228 } | 229 } |
| 229 if (m_iCharPosCount < iCount) { | 230 if (m_iCharPosCount < iCount) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 rtClip.Offset(rtObj.left, rtObj.top); | 282 rtClip.Offset(rtObj.left, rtObj.top); |
| 282 m_Transform.TransformRect(rtClip); | 283 m_Transform.TransformRect(rtClip); |
| 283 const CFX_RectF& rtDevClip = m_pRenderDevice->GetClipRect(); | 284 const CFX_RectF& rtDevClip = m_pRenderDevice->GetClipRect(); |
| 284 rtClip.Intersect(rtDevClip); | 285 rtClip.Intersect(rtDevClip); |
| 285 hState = m_pRenderDevice->SaveState(); | 286 hState = m_pRenderDevice->SaveState(); |
| 286 return m_pRenderDevice->SetClipRect(rtClip); | 287 return m_pRenderDevice->SetClipRect(rtClip); |
| 287 } | 288 } |
| 288 void CFDE_RenderContext::RestoreClip(FDE_HDEVICESTATE hState) { | 289 void CFDE_RenderContext::RestoreClip(FDE_HDEVICESTATE hState) { |
| 289 m_pRenderDevice->RestoreState(hState); | 290 m_pRenderDevice->RestoreState(hState); |
| 290 } | 291 } |
| OLD | NEW |