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.
This commit is contained in:
parent
b87ebdce21
commit
1d764bd787
8 changed files with 149 additions and 582 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue