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

Side by Side Diff: src/gpu/GrClipMaskManager.cpp

Issue 156843005: Set scissor to clip bounding box when using GrConvexPolyEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrClipMaskManager.h" 9 #include "GrClipMaskManager.h"
10 #include "GrAAConvexPathRenderer.h" 10 #include "GrAAConvexPathRenderer.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 effect.reset(GrConvexPolyEffect::Create(GrConvexPolyEffect::kFil lNoAA_EdgeType, p)); 167 effect.reset(GrConvexPolyEffect::Create(GrConvexPolyEffect::kFil lNoAA_EdgeType, p));
168 } 168 }
169 } else { 169 } else {
170 GrConvexPolyEffect::EdgeType type = isAA ? GrConvexPolyEffect::kFill AA_EdgeType : 170 GrConvexPolyEffect::EdgeType type = isAA ? GrConvexPolyEffect::kFill AA_EdgeType :
171 GrConvexPolyEffect::kFill NoAA_EdgeType; 171 GrConvexPolyEffect::kFill NoAA_EdgeType;
172 effect.reset(GrConvexPolyEffect::Create(type, p)); 172 effect.reset(GrConvexPolyEffect::Create(type, p));
173 } 173 }
174 if (effect) { 174 if (effect) {
175 are->set(fGpu->drawState()); 175 are->set(fGpu->drawState());
176 fGpu->drawState()->addCoverageEffect(effect); 176 fGpu->drawState()->addCoverageEffect(effect);
177 fGpu->disableScissor(); 177 SkIRect scissorSpaceIBounds(clipSpaceIBounds);
bsalomon 2014/02/06 22:16:01 It turns out we were already doing this in the ste
robertphillips 2014/02/07 13:42:11 That's a better answer then them analyzing our ste
178 scissorSpaceIBounds.offset(-clipDataIn->fOrigin);
179 fGpu->enableScissor(scissorSpaceIBounds);
178 this->setGpuStencil(); 180 this->setGpuStencil();
179 return true; 181 return true;
180 } 182 }
181 } 183 }
182 184
183 #if GR_AA_CLIP 185 #if GR_AA_CLIP
184 // If MSAA is enabled we can do everything in the stencil buffer. 186 // If MSAA is enabled we can do everything in the stencil buffer.
185 if (0 == rt->numSamples() && requiresAA) { 187 if (0 == rt->numSamples() && requiresAA) {
186 GrTexture* result = NULL; 188 GrTexture* result = NULL;
187 189
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 1062
1061 // TODO: dynamically attach a stencil buffer 1063 // TODO: dynamically attach a stencil buffer
1062 int stencilBits = 0; 1064 int stencilBits = 0;
1063 GrStencilBuffer* stencilBuffer = 1065 GrStencilBuffer* stencilBuffer =
1064 drawState.getRenderTarget()->getStencilBuffer(); 1066 drawState.getRenderTarget()->getStencilBuffer();
1065 if (NULL != stencilBuffer) { 1067 if (NULL != stencilBuffer) {
1066 stencilBits = stencilBuffer->bits(); 1068 stencilBits = stencilBuffer->bits();
1067 this->adjustStencilParams(settings, clipMode, stencilBits); 1069 this->adjustStencilParams(settings, clipMode, stencilBits);
1068 } 1070 }
1069 } 1071 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698