Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: xfa/fde/fde_render.cpp

Issue 1877383002: Only SolidBrush types are created, remove other brushes. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fde/fde_pen.h ('k') | xfa/fde/tto/fde_textout.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « xfa/fde/fde_pen.h ('k') | xfa/fde/tto/fde_textout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698