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

Side by Side Diff: xfa/src/fdp/src/fde/fde_gedevice.cpp

Issue 1745243002: Pass rect by const reference in SetClip_Rect(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "xfa/src/fdp/src/fde/fde_devbasic.h" 9 #include "xfa/src/fdp/src/fde/fde_devbasic.h"
10 #include "xfa/src/fdp/src/fde/fde_gedevice.h" 10 #include "xfa/src/fdp/src/fde/fde_gedevice.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return NULL; 61 return NULL;
62 } 62 }
63 void CFDE_FxgeDevice::RestoreState(FDE_HDEVICESTATE hState) { 63 void CFDE_FxgeDevice::RestoreState(FDE_HDEVICESTATE hState) {
64 m_pDevice->RestoreState(); 64 m_pDevice->RestoreState();
65 const FX_RECT& rt = m_pDevice->GetClipBox(); 65 const FX_RECT& rt = m_pDevice->GetClipBox();
66 m_rtClip.Set((FX_FLOAT)rt.left, (FX_FLOAT)rt.top, (FX_FLOAT)rt.Width(), 66 m_rtClip.Set((FX_FLOAT)rt.left, (FX_FLOAT)rt.top, (FX_FLOAT)rt.Width(),
67 (FX_FLOAT)rt.Height()); 67 (FX_FLOAT)rt.Height());
68 } 68 }
69 FX_BOOL CFDE_FxgeDevice::SetClipRect(const CFX_RectF& rtClip) { 69 FX_BOOL CFDE_FxgeDevice::SetClipRect(const CFX_RectF& rtClip) {
70 m_rtClip = rtClip; 70 m_rtClip = rtClip;
71 FX_RECT rt((int32_t)FXSYS_floor(rtClip.left), 71 return m_pDevice->SetClip_Rect(FX_RECT((int32_t)FXSYS_floor(rtClip.left),
72 (int32_t)FXSYS_floor(rtClip.top), 72 (int32_t)FXSYS_floor(rtClip.top),
73 (int32_t)FXSYS_ceil(rtClip.right()), 73 (int32_t)FXSYS_ceil(rtClip.right()),
74 (int32_t)FXSYS_ceil(rtClip.bottom())); 74 (int32_t)FXSYS_ceil(rtClip.bottom())));
75 return m_pDevice->SetClip_Rect(&rt);
76 } 75 }
77 const CFX_RectF& CFDE_FxgeDevice::GetClipRect() { 76 const CFX_RectF& CFDE_FxgeDevice::GetClipRect() {
78 return m_rtClip; 77 return m_rtClip;
79 } 78 }
80 FX_BOOL CFDE_FxgeDevice::SetClipPath(const IFDE_Path* pClip) { 79 FX_BOOL CFDE_FxgeDevice::SetClipPath(const IFDE_Path* pClip) {
81 return FALSE; 80 return FALSE;
82 } 81 }
83 IFDE_Path* CFDE_FxgeDevice::GetClipPath() const { 82 IFDE_Path* CFDE_FxgeDevice::GetClipPath() const {
84 return NULL; 83 return NULL;
85 } 84 }
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 dev.DrawCosmeticLine(pt0.x, pt0.y, pt1.x, pt1.y, cr0); 561 dev.DrawCosmeticLine(pt0.x, pt0.y, pt1.x, pt1.y, cr0);
563 pt1.x += dx; 562 pt1.x += dx;
564 pt0.y += dy; 563 pt0.y += dy;
565 a0 += da; 564 a0 += da;
566 r0 += dr; 565 r0 += dr;
567 g0 += dg; 566 g0 += dg;
568 b0 += db; 567 b0 += db;
569 } 568 }
570 return WrapTexture(pLinearBrush->GetWrapMode(), &bmp, pPath, pMatrix); 569 return WrapTexture(pLinearBrush->GetWrapMode(), &bmp, pPath, pMatrix);
571 } 570 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698