From 1d764bd787a20ab4b8d6edd79d3bc7db459e3eb0 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Tue, 27 Aug 2019 08:07:14 +0200 Subject: GRAPHICS: Vector renderer clipping rect related cleanups Selecting whether a clipping variant of a draw call needs to be used is no longer the responsibility to the caller. The clipping rect is now part of the state of the renderer. Also fix some of the draw calls to better apply the clipping rect. --- graphics/VectorRenderer.cpp | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to 'graphics/VectorRenderer.cpp') diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp index e92a09f8c9..e226e45475 100644 --- a/graphics/VectorRenderer.cpp +++ b/graphics/VectorRenderer.cpp @@ -32,34 +32,7 @@ namespace Graphics { /******************************************************************** * DRAWSTEP handling functions ********************************************************************/ -void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step, uint32 extra) { - - if (step.bgColor.set) - setBgColor(step.bgColor.r, step.bgColor.g, step.bgColor.b); - - if (step.fgColor.set) - setFgColor(step.fgColor.r, step.fgColor.g, step.fgColor.b); - - if (step.bevelColor.set) - setBevelColor(step.bevelColor.r, step.bevelColor.g, step.bevelColor.b); - - if (step.gradColor1.set && step.gradColor2.set) - setGradientColors(step.gradColor1.r, step.gradColor1.g, step.gradColor1.b, - step.gradColor2.r, step.gradColor2.g, step.gradColor2.b); - - setShadowOffset(_disableShadows ? 0 : step.shadow); - setBevel(step.bevel); - setGradientFactor(step.factor); - setStrokeWidth(step.stroke); - setFillMode((FillMode)step.fillMode); - - _dynamicData = extra; - - Common::Rect noClip = Common::Rect(0, 0, 0, 0); - (this->*(step.drawingCall))(area, step, noClip); -} - -void VectorRenderer::drawStepClip(const Common::Rect &area, const Common::Rect &clip, const DrawStep &step, uint32 extra) { +void VectorRenderer::drawStep(const Common::Rect &area, const Common::Rect &clip, const DrawStep &step, uint32 extra) { if (step.bgColor.set) setBgColor(step.bgColor.r, step.bgColor.g, step.bgColor.b); @@ -79,10 +52,11 @@ void VectorRenderer::drawStepClip(const Common::Rect &area, const Common::Rect & setGradientFactor(step.factor); setStrokeWidth(step.stroke); setFillMode((FillMode)step.fillMode); + setClippingRect(clip); _dynamicData = extra; - (this->*(step.drawingCall))(area, step, clip); + (this->*(step.drawingCall))(area, step); } int VectorRenderer::stepGetRadius(const DrawStep &step, const Common::Rect &area) { -- cgit v1.2.3