diff options
author | 2014-10-27 14:51:01 -0700 | |
---|---|---|
committer | 2014-10-27 14:51:01 -0700 | |
commit | 77b1307c1f5dac019575a6d431d5ce657370c4fb (patch) | |
tree | 2cc52fe0d28b143d0498fb8ddceb44b312013988 /src/gpu/GrGpu.cpp | |
parent | fa4689d56384da5bb264a480e636fac126fb93ca (diff) |
Scissor rect on drawinfo
BUG=skia:
Review URL: https://codereview.chromium.org/678683005
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r-- | src/gpu/GrGpu.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 221aaec070..5325aaeb3f 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -300,14 +300,19 @@ const GrIndexBuffer* GrGpu::getQuadIndexBuffer() const { bool GrGpu::setupClipAndFlushState(DrawType type, const GrDeviceCoordTexture* dstCopy, - GrDrawState::AutoRestoreEffects* are, - const SkRect* devBounds) { - GrDrawState::AutoRestoreStencil asr; - if (!fClipMaskManager.setupClipping(this->getClip(), are, &asr, devBounds)) { + const SkRect* devBounds, + GrDrawState::AutoRestoreEffects* are) { + ScissorState scissorState; + GrDrawState::AutoRestoreStencil ars; + if (!fClipMaskManager.setupClipping(this->getClip(), + devBounds, + are, + &ars, + &scissorState)) { return false; } - if (!this->flushGraphicsState(type, dstCopy)) { + if (!this->flushGraphicsState(type, scissorState, dstCopy)) { return false; } @@ -347,7 +352,9 @@ void GrGpu::onDraw(const DrawInfo& info) { this->handleDirtyContext(); GrDrawState::AutoRestoreEffects are; if (!this->setupClipAndFlushState(PrimTypeToDrawType(info.primitiveType()), - info.getDstCopy(), &are, info.getDevBounds())) { + info.getDstCopy(), + info.getDevBounds(), + &are)) { return; } this->onGpuDraw(info); @@ -357,7 +364,7 @@ void GrGpu::onStencilPath(const GrPath* path, SkPath::FillType fill) { this->handleDirtyContext(); GrDrawState::AutoRestoreEffects are; - if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are, NULL)) { + if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, NULL, &are)) { return; } @@ -372,7 +379,7 @@ void GrGpu::onDrawPath(const GrPath* path, SkPath::FillType fill, drawState()->setDefaultVertexAttribs(); GrDrawState::AutoRestoreEffects are; - if (!this->setupClipAndFlushState(kDrawPath_DrawType, dstCopy, &are, NULL)) { + if (!this->setupClipAndFlushState(kDrawPath_DrawType, dstCopy, NULL, &are)) { return; } @@ -388,7 +395,7 @@ void GrGpu::onDrawPaths(const GrPathRange* pathRange, drawState()->setDefaultVertexAttribs(); GrDrawState::AutoRestoreEffects are; - if (!this->setupClipAndFlushState(kDrawPaths_DrawType, dstCopy, &are, NULL)) { + if (!this->setupClipAndFlushState(kDrawPaths_DrawType, dstCopy, NULL, &are)) { return; } |