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

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

Issue 2137543002: Use clipped bounds for reordering decisions (Closed) Base URL: https://chromium.googlesource.com/skia.git@lessstencil
Patch Set: fix windows warning Created 4 years, 5 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') | src/gpu/GrClipMaskManager.cpp » ('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 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 "GrClip.h" 8 #include "GrClip.h"
9 9
10 #include "GrClipMaskManager.h" 10 #include "GrClipMaskManager.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 } 38 }
39 if (isIntersectionOfRects) { 39 if (isIntersectionOfRects) {
40 *isIntersectionOfRects = true; 40 *isIntersectionOfRects = true;
41 } 41 }
42 } 42 }
43 43
44 bool GrFixedClip::apply(GrContext*, const GrPipelineBuilder& pipelineBuilder, 44 bool GrFixedClip::apply(GrContext*, const GrPipelineBuilder& pipelineBuilder,
45 GrDrawContext* drawContext, 45 GrDrawContext* drawContext,
46 const SkRect* devBounds, GrAppliedClip* out) const { 46 const SkRect* devBounds, GrAppliedClip* out) const {
47 SkASSERT(!fDeviceBounds.isLargest());
47 if (fScissorState.enabled()) { 48 if (fScissorState.enabled()) {
48 SkIRect tightScissor; 49 SkIRect tightScissor;
49 if (!tightScissor.intersect(fScissorState.rect(), 50 if (!tightScissor.intersect(fScissorState.rect(),
50 SkIRect::MakeWH(drawContext->width(), drawCo ntext->height()))) { 51 SkIRect::MakeWH(drawContext->width(), drawCo ntext->height()))) {
51 return false; 52 return false;
52 } 53 }
53 if (devBounds && !devBounds->intersects(SkRect::Make(tightScissor))) { 54 if (devBounds && !devBounds->intersects(SkRect::Make(tightScissor))) {
54 return false; 55 return false;
55 } 56 }
56 out->makeScissoredStencil(fHasStencilClip, tightScissor); 57 if (fHasStencilClip) {
58 out->makeScissoredStencil(tightScissor, &fDeviceBounds);
59 } else {
60 out->makeScissored(tightScissor);
61 }
57 return true; 62 return true;
58 } 63 }
59 64
60 out->makeStencil(fHasStencilClip); 65 out->makeStencil(fHasStencilClip, fDeviceBounds);
61 return true; 66 return true;
62 } 67 }
63 68
64 bool GrClipStackClip::quickContains(const SkRect& rect) const { 69 bool GrClipStackClip::quickContains(const SkRect& rect) const {
65 if (!fStack) { 70 if (!fStack) {
66 return true; 71 return true;
67 } 72 }
68 return fStack->quickContains(rect.makeOffset(SkIntToScalar(fOrigin.x()), 73 return fStack->quickContains(rect.makeOffset(SkIntToScalar(fOrigin.x()),
69 SkIntToScalar(fOrigin.y()))); 74 SkIntToScalar(fOrigin.y())));
70 } 75 }
(...skipping 12 matching lines...) Expand all
83 isIntersectionOfRects); 88 isIntersectionOfRects);
84 devBounds.roundOut(devResult); 89 devBounds.roundOut(devResult);
85 } 90 }
86 91
87 bool GrClipStackClip::apply(GrContext* context, 92 bool GrClipStackClip::apply(GrContext* context,
88 const GrPipelineBuilder& pipelineBuilder, GrDrawCont ext* drawContext, 93 const GrPipelineBuilder& pipelineBuilder, GrDrawCont ext* drawContext,
89 const SkRect* devBounds, GrAppliedClip* out) const { 94 const SkRect* devBounds, GrAppliedClip* out) const {
90 return GrClipMaskManager::SetupClipping(context, pipelineBuilder, drawContex t, 95 return GrClipMaskManager::SetupClipping(context, pipelineBuilder, drawContex t,
91 *this, devBounds, out); 96 *this, devBounds, out);
92 } 97 }
OLDNEW
« no previous file with comments | « include/gpu/GrClip.h ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698