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

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

Issue 951653002: Enable rect clips (Closed) Base URL: https://skia.googlesource.com/skia.git@dt-on-down
Patch Set: rebase Created 5 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
« no previous file with comments | « include/gpu/GrClip.h ('k') | 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 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrClipMaskManager.h" 8 #include "GrClipMaskManager.h"
9 #include "GrAAConvexPathRenderer.h" 9 #include "GrAAConvexPathRenderer.h"
10 #include "GrAAHairLinePathRenderer.h" 10 #include "GrAAHairLinePathRenderer.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 SkIRect clipSpaceIBounds; 221 SkIRect clipSpaceIBounds;
222 bool requiresAA; 222 bool requiresAA;
223 GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); 223 GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
224 224
225 // GrDrawTarget should have filtered this for us 225 // GrDrawTarget should have filtered this for us
226 SkASSERT(rt); 226 SkASSERT(rt);
227 227
228 SkIRect clipSpaceRTIBounds = SkIRect::MakeWH(rt->width(), rt->height()); 228 SkIRect clipSpaceRTIBounds = SkIRect::MakeWH(rt->width(), rt->height());
229 const GrClip& clip = pipelineBuilder->clip(); 229 const GrClip& clip = pipelineBuilder->clip();
230 // TODO we shouldn't be ignoring the clip mask manager's clip. This is temp orary. 230 // TODO we shouldn't be ignoring the clip mask manager's clip. This is temp orary.
231 bool ignoreClip = clip.isWideOpen(clipSpaceRTIBounds) || 231 bool ignoreClip = clip.isWideOpen(clipSpaceRTIBounds);
232 GrClip::kIRect_ClipType == clip.clipType();
233 if (!ignoreClip) { 232 if (!ignoreClip) {
234 // The clip mask manager always draws with a single IRect so we special case that logic here 233 // The clip mask manager always draws with a single IRect so we special case that logic here
235 if (GrClip::kIRect_ClipType == clip.clipType()) { 234 if (GrClip::kIRect_ClipType == clip.clipType()) {
236 initialState = GrReducedClip::kAllIn_InitialState; 235 initialState = GrReducedClip::kAllIn_InitialState;
237 clipSpaceIBounds = clip.irect(); 236 clipSpaceIBounds = clip.irect();
238 SkNEW_INSERT_AT_LLIST_HEAD(&elements, 237 SkNEW_INSERT_AT_LLIST_HEAD(&elements,
239 Element, 238 Element,
240 (SkRect::Make(clipSpaceIBounds), 239 (SkRect::Make(clipSpaceIBounds),
241 SkRegion::kIntersect_Op, false)); 240 SkRegion::kIntersect_Op, false));
242 } else { 241 } else {
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 fAACache.setContext(clipTarget->getContext()); 1102 fAACache.setContext(clipTarget->getContext());
1104 } 1103 }
1105 1104
1106 void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBu ffer, 1105 void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBu ffer,
1107 GrStencilSettings* settings) { 1106 GrStencilSettings* settings) {
1108 if (stencilBuffer) { 1107 if (stencilBuffer) {
1109 int stencilBits = stencilBuffer->bits(); 1108 int stencilBits = stencilBuffer->bits();
1110 this->adjustStencilParams(settings, fClipMode, stencilBits); 1109 this->adjustStencilParams(settings, fClipMode, stencilBits);
1111 } 1110 }
1112 } 1111 }
OLDNEW
« no previous file with comments | « include/gpu/GrClip.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698