| Index: src/gpu/GrClipMaskManager.cpp
|
| diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
|
| index 0738108ab8b6cd015776a60e09359d10a920e51c..1916ab848a83e4e23853b4b317955f0145e53003 100644
|
| --- a/src/gpu/GrClipMaskManager.cpp
|
| +++ b/src/gpu/GrClipMaskManager.cpp
|
| @@ -211,9 +211,9 @@ bool GrClipMaskManager::installClipEffects(const GrReducedClip::ElementList& ele
|
| // sort out what kind of clip mask needs to be created: alpha, stencil,
|
| // scissor, or entirely software
|
| bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
|
| + GrDrawTarget::DrawInfo* drawInfo,
|
| GrDrawState::AutoRestoreEffects* are,
|
| - GrDrawState::AutoRestoreStencil* asr,
|
| - const SkRect* devBounds) {
|
| + GrDrawState::AutoRestoreStencil* asStencil) {
|
| fCurrClipMaskType = kNone_ClipMaskType;
|
|
|
| GrReducedClip::ElementList elements(16);
|
| @@ -249,8 +249,7 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
|
| }
|
|
|
| if (ignoreClip) {
|
| - fGpu->disableScissor();
|
| - this->setDrawStateStencil(asr);
|
| + this->setDrawStateStencil(asStencil);
|
| return true;
|
| }
|
|
|
| @@ -265,17 +264,16 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
|
| if (elements.count() <= 4) {
|
| SkVector clipToRTOffset = { SkIntToScalar(-clipDataIn->fOrigin.fX),
|
| SkIntToScalar(-clipDataIn->fOrigin.fY) };
|
| + const SkRect* devBounds = drawInfo->getDevBounds();
|
| if (elements.isEmpty() ||
|
| (requiresAA && this->installClipEffects(elements, are, clipToRTOffset, devBounds))) {
|
| SkIRect scissorSpaceIBounds(clipSpaceIBounds);
|
| scissorSpaceIBounds.offset(-clipDataIn->fOrigin);
|
| if (NULL == devBounds ||
|
| !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) {
|
| - fGpu->enableScissor(scissorSpaceIBounds);
|
| - } else {
|
| - fGpu->disableScissor();
|
| + drawInfo->enableScissor(scissorSpaceIBounds);
|
| }
|
| - this->setDrawStateStencil(asr);
|
| + this->setDrawStateStencil(asStencil);
|
| return true;
|
| }
|
| }
|
| @@ -306,8 +304,7 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
|
| rtSpaceMaskBounds.offset(-clipDataIn->fOrigin);
|
| are->set(fGpu->drawState());
|
| setup_drawstate_aaclip(fGpu, result, rtSpaceMaskBounds);
|
| - fGpu->disableScissor();
|
| - this->setDrawStateStencil(asr);
|
| + this->setDrawStateStencil(asStencil);
|
| return true;
|
| }
|
| // if alpha clip mask creation fails fall through to the non-AA code paths
|
| @@ -334,8 +331,8 @@ bool GrClipMaskManager::setupClipping(const GrClipData* clipDataIn,
|
| // use both stencil and scissor test to the bounds for the final draw.
|
| SkIRect scissorSpaceIBounds(clipSpaceIBounds);
|
| scissorSpaceIBounds.offset(clipSpaceToStencilSpaceOffset);
|
| - fGpu->enableScissor(scissorSpaceIBounds);
|
| - this->setDrawStateStencil(asr);
|
| + drawInfo->enableScissor(scissorSpaceIBounds);
|
| + this->setDrawStateStencil(asStencil);
|
| return true;
|
| }
|
|
|
|
|