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

Side by Side Diff: core/src/fxge/ge/fx_ge_device.cpp

Issue 1745243002: Pass rect by const reference in SetClip_Rect(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: LTBR. Created 4 years, 9 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 | « core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp ('k') | fpdfsdk/src/fpdfformfill.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 "core/include/fxge/fx_ge.h" 7 #include "core/include/fxge/fx_ge.h"
8 8
9 CFX_RenderDevice::CFX_RenderDevice() { 9 CFX_RenderDevice::CFX_RenderDevice() {
10 m_pDeviceDriver = NULL; 10 m_pDeviceDriver = NULL;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 const CFX_PathData* pPathData, 84 const CFX_PathData* pPathData,
85 const CFX_Matrix* pObject2Device, 85 const CFX_Matrix* pObject2Device,
86 const CFX_GraphStateData* pGraphState) { 86 const CFX_GraphStateData* pGraphState) {
87 if (!m_pDeviceDriver->SetClip_PathStroke(pPathData, pObject2Device, 87 if (!m_pDeviceDriver->SetClip_PathStroke(pPathData, pObject2Device,
88 pGraphState)) { 88 pGraphState)) {
89 return FALSE; 89 return FALSE;
90 } 90 }
91 UpdateClipBox(); 91 UpdateClipBox();
92 return TRUE; 92 return TRUE;
93 } 93 }
94 FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT* pRect) { 94 FX_BOOL CFX_RenderDevice::SetClip_Rect(const FX_RECT& rect) {
95 CFX_PathData path; 95 CFX_PathData path;
96 path.AppendRect((FX_FLOAT)(pRect->left), (FX_FLOAT)(pRect->bottom), 96 path.AppendRect(rect.left, rect.bottom, rect.right, rect.top);
97 (FX_FLOAT)(pRect->right), (FX_FLOAT)(pRect->top)); 97 if (!SetClip_PathFill(&path, nullptr, FXFILL_WINDING))
98 if (!SetClip_PathFill(&path, NULL, FXFILL_WINDING)) {
99 return FALSE; 98 return FALSE;
100 } 99
101 UpdateClipBox(); 100 UpdateClipBox();
102 return TRUE; 101 return TRUE;
103 } 102 }
104 void CFX_RenderDevice::UpdateClipBox() { 103 void CFX_RenderDevice::UpdateClipBox() {
105 if (m_pDeviceDriver->GetClipBox(&m_ClipBox)) { 104 if (m_pDeviceDriver->GetClipBox(&m_ClipBox)) {
106 return; 105 return;
107 } 106 }
108 m_ClipBox.left = 0; 107 m_ClipBox.left = 0;
109 m_ClipBox.top = 0; 108 m_ClipBox.top = 0;
110 m_ClipBox.right = m_Width; 109 m_ClipBox.right = m_Width;
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix, 464 return m_pDeviceDriver->StartDIBits(pBitmap, bitmap_alpha, argb, pMatrix,
466 flags, handle, alpha_flag, pIccTransform, 465 flags, handle, alpha_flag, pIccTransform,
467 blend_mode); 466 blend_mode);
468 } 467 }
469 FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) { 468 FX_BOOL CFX_RenderDevice::ContinueDIBits(void* handle, IFX_Pause* pPause) {
470 return m_pDeviceDriver->ContinueDIBits(handle, pPause); 469 return m_pDeviceDriver->ContinueDIBits(handle, pPause);
471 } 470 }
472 void CFX_RenderDevice::CancelDIBits(void* handle) { 471 void CFX_RenderDevice::CancelDIBits(void* handle) {
473 m_pDeviceDriver->CancelDIBits(handle); 472 m_pDeviceDriver->CancelDIBits(handle);
474 } 473 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp ('k') | fpdfsdk/src/fpdfformfill.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698