From bec4ea1e64b8049c572dd088c9c09a94f49b2353 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 29 Feb 2016 13:23:13 -0800 Subject: Pass rect by const reference in SetClip_Rect(). R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1745243002 . --- xfa/src/fdp/src/fde/fde_gedevice.cpp | 9 ++++----- xfa/src/fxgraphics/src/fx_graphics.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'xfa') diff --git a/xfa/src/fdp/src/fde/fde_gedevice.cpp b/xfa/src/fdp/src/fde/fde_gedevice.cpp index b2be47c659..c0d665d6a5 100644 --- a/xfa/src/fdp/src/fde/fde_gedevice.cpp +++ b/xfa/src/fdp/src/fde/fde_gedevice.cpp @@ -71,11 +71,10 @@ void CFDE_FxgeDevice::RestoreState(FDE_HDEVICESTATE hState) { } FX_BOOL CFDE_FxgeDevice::SetClipRect(const CFX_RectF& rtClip) { m_rtClip = rtClip; - FX_RECT rt((int32_t)FXSYS_floor(rtClip.left), - (int32_t)FXSYS_floor(rtClip.top), - (int32_t)FXSYS_ceil(rtClip.right()), - (int32_t)FXSYS_ceil(rtClip.bottom())); - return m_pDevice->SetClip_Rect(&rt); + return m_pDevice->SetClip_Rect(FX_RECT((int32_t)FXSYS_floor(rtClip.left), + (int32_t)FXSYS_floor(rtClip.top), + (int32_t)FXSYS_ceil(rtClip.right()), + (int32_t)FXSYS_ceil(rtClip.bottom()))); } const CFX_RectF& CFDE_FxgeDevice::GetClipRect() { return m_rtClip; diff --git a/xfa/src/fxgraphics/src/fx_graphics.cpp b/xfa/src/fxgraphics/src/fx_graphics.cpp index 301bd7c356..602382725f 100644 --- a/xfa/src/fxgraphics/src/fx_graphics.cpp +++ b/xfa/src/fxgraphics/src/fx_graphics.cpp @@ -485,11 +485,11 @@ FX_ERR CFX_Graphics::SetClipRect(const CFX_RectF& rect) { case FX_CONTEXT_Device: { if (!_renderDevice) return FX_ERR_Property_Invalid; - FX_RECT r(FXSYS_round(rect.left), FXSYS_round(rect.top), - FXSYS_round(rect.right()), FXSYS_round(rect.bottom())); - FX_BOOL result = _renderDevice->SetClip_Rect(&r); - if (!result) + if (!_renderDevice->SetClip_Rect( + FX_RECT(FXSYS_round(rect.left), FXSYS_round(rect.top), + FXSYS_round(rect.right()), FXSYS_round(rect.bottom())))) { return FX_ERR_Method_Not_Supported; + } return FX_ERR_Succeeded; } default: { return FX_ERR_Property_Invalid; } -- cgit v1.2.3