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

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

Issue 183833003: Make GrConvexPolyEffect support inverse fills and non-AA rects (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: update GM width Created 6 years, 9 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 | « gm/convexpolyeffect.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.h » ('j') | 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } else if (isAA && SkClipStack::Element::kRRect_Type == type && !rt->isM ultisampled()) { 193 } else if (isAA && SkClipStack::Element::kRRect_Type == type && !rt->isM ultisampled()) {
194 const SkRRect& rrect = elements.tail()->getRRect(); 194 const SkRRect& rrect = elements.tail()->getRRect();
195 effect.reset(GrRRectEffect::Create(rrect)); 195 effect.reset(GrRRectEffect::Create(rrect));
196 } else if (isAA && SkClipStack::Element::kRect_Type == type && !rt->isMu ltisampled()) { 196 } else if (isAA && SkClipStack::Element::kRect_Type == type && !rt->isMu ltisampled()) {
197 // We only handle AA/non-MSAA rects here. Coverage effect AA isn't M SAA friendly and 197 // We only handle AA/non-MSAA rects here. Coverage effect AA isn't M SAA friendly and
198 // non-AA rect clips are handled by the scissor. 198 // non-AA rect clips are handled by the scissor.
199 SkRect rect = elements.tail()->getRect(); 199 SkRect rect = elements.tail()->getRect();
200 SkVector offset = { SkIntToScalar(-clipDataIn->fOrigin.fX), 200 SkVector offset = { SkIntToScalar(-clipDataIn->fOrigin.fX),
201 SkIntToScalar(-clipDataIn->fOrigin.fY) }; 201 SkIntToScalar(-clipDataIn->fOrigin.fY) };
202 rect.offset(offset); 202 rect.offset(offset);
203 effect.reset(GrConvexPolyEffect::CreateForAAFillRect(rect)); 203 effect.reset(GrConvexPolyEffect::Create(GrConvexPolyEffect::kFillAA_ EdgeType, rect));
204 // This should never fail. 204 // This should never fail.
205 SkASSERT(effect); 205 SkASSERT(effect);
206 } 206 }
207 if (effect) { 207 if (effect) {
208 are->set(fGpu->drawState()); 208 are->set(fGpu->drawState());
209 fGpu->drawState()->addCoverageEffect(effect); 209 fGpu->drawState()->addCoverageEffect(effect);
210 SkIRect scissorSpaceIBounds(clipSpaceIBounds); 210 SkIRect scissorSpaceIBounds(clipSpaceIBounds);
211 scissorSpaceIBounds.offset(-clipDataIn->fOrigin); 211 scissorSpaceIBounds.offset(-clipDataIn->fOrigin);
212 fGpu->enableScissor(scissorSpaceIBounds); 212 fGpu->enableScissor(scissorSpaceIBounds);
213 this->setGpuStencil(); 213 this->setGpuStencil();
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 1077
1078 // TODO: dynamically attach a stencil buffer 1078 // TODO: dynamically attach a stencil buffer
1079 int stencilBits = 0; 1079 int stencilBits = 0;
1080 GrStencilBuffer* stencilBuffer = 1080 GrStencilBuffer* stencilBuffer =
1081 drawState.getRenderTarget()->getStencilBuffer(); 1081 drawState.getRenderTarget()->getStencilBuffer();
1082 if (NULL != stencilBuffer) { 1082 if (NULL != stencilBuffer) {
1083 stencilBits = stencilBuffer->bits(); 1083 stencilBits = stencilBuffer->bits();
1084 this->adjustStencilParams(settings, clipMode, stencilBits); 1084 this->adjustStencilParams(settings, clipMode, stencilBits);
1085 } 1085 }
1086 } 1086 }
OLDNEW
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698