aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2014-10-27 07:17:17 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-27 07:17:17 -0700
commit7afb5aa201e4b59397cbd8480e121d7501a227e7 (patch)
tree105ea35461c85dbc0ad90327c37be8134d5bb0b5 /src/gpu/GrGpu.cpp
parentc8306779b8a484ac05e84d1580c393e9e24460ee (diff)
Clip mask manager sets stencil on draw type
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r--src/gpu/GrGpu.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 65100489f4..d8ffe6745d 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -298,10 +298,12 @@ const GrIndexBuffer* GrGpu::getQuadIndexBuffer() const {
////////////////////////////////////////////////////////////////////////////////
-bool GrGpu::setupClipAndFlushState(DrawType type, const GrDeviceCoordTexture* dstCopy,
+bool GrGpu::setupClipAndFlushState(DrawType type,
+ const GrDeviceCoordTexture* dstCopy,
GrDrawState::AutoRestoreEffects* are,
+ GrDrawState::AutoRestoreStencil* ars,
const SkRect* devBounds) {
- if (!fClipMaskManager.setupClipping(this->getClip(), are, devBounds)) {
+ if (!fClipMaskManager.setupClipping(this->getClip(), are, ars, devBounds)) {
return false;
}
@@ -344,8 +346,9 @@ void GrGpu::geometrySourceWillPop(const GeometrySrcState& restoredState) {
void GrGpu::onDraw(const DrawInfo& info) {
this->handleDirtyContext();
GrDrawState::AutoRestoreEffects are;
+ GrDrawState::AutoRestoreStencil asr;
if (!this->setupClipAndFlushState(PrimTypeToDrawType(info.primitiveType()),
- info.getDstCopy(), &are, info.getDevBounds())) {
+ info.getDstCopy(), &are, &asr, info.getDevBounds())) {
return;
}
this->onGpuDraw(info);
@@ -355,7 +358,8 @@ void GrGpu::onStencilPath(const GrPath* path, SkPath::FillType fill) {
this->handleDirtyContext();
GrDrawState::AutoRestoreEffects are;
- if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are, NULL)) {
+ GrDrawState::AutoRestoreStencil asr;
+ if (!this->setupClipAndFlushState(kStencilPath_DrawType, NULL, &are, &asr, NULL)) {
return;
}
@@ -370,7 +374,8 @@ void GrGpu::onDrawPath(const GrPath* path, SkPath::FillType fill,
drawState()->setDefaultVertexAttribs();
GrDrawState::AutoRestoreEffects are;
- if (!this->setupClipAndFlushState(kDrawPath_DrawType, dstCopy, &are, NULL)) {
+ GrDrawState::AutoRestoreStencil asr;
+ if (!this->setupClipAndFlushState(kDrawPath_DrawType, dstCopy, &are, &asr, NULL)) {
return;
}
@@ -386,7 +391,8 @@ void GrGpu::onDrawPaths(const GrPathRange* pathRange,
drawState()->setDefaultVertexAttribs();
GrDrawState::AutoRestoreEffects are;
- if (!this->setupClipAndFlushState(kDrawPaths_DrawType, dstCopy, &are, NULL)) {
+ GrDrawState::AutoRestoreStencil asr;
+ if (!this->setupClipAndFlushState(kDrawPaths_DrawType, dstCopy, &are, &asr, NULL)) {
return;
}