Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: src/gpu/GrGpu.cpp

Issue 676983003: Clip mask manager sets stencil on draw type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 65100489f4b7ad01c94b83734440334bdd46a65d..d8ffe6745d3271f05321ed1e3e64e0a66368674c 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;
}

Powered by Google App Engine
This is Rietveld 408576698