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

Side by Side Diff: include/gpu/GrClip.h

Issue 2135673002: Don't scissor draws overlapping the render target's edges (Closed) Base URL: https://chromium.googlesource.com/skia.git@hidebounds
Patch Set: 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 | « no previous file | src/gpu/GrClipMaskManager.cpp » ('j') | src/gpu/GrClipMaskManager.cpp » ('J')
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 #ifndef GrClip_DEFINED 8 #ifndef GrClip_DEFINED
9 #define GrClip_DEFINED 9 #define GrClip_DEFINED
10 10
(...skipping 28 matching lines...) Expand all
39 fScissorState.set(scissor); 39 fScissorState.set(scissor);
40 fHasStencilClip = hasStencil; 40 fHasStencilClip = hasStencil;
41 } 41 }
42 42
43 void makeFPBased(sk_sp<GrFragmentProcessor> fp) { 43 void makeFPBased(sk_sp<GrFragmentProcessor> fp) {
44 fClipCoverageFP = fp; 44 fClipCoverageFP = fp;
45 fScissorState.setDisabled(); 45 fScissorState.setDisabled();
46 fHasStencilClip = false; 46 fHasStencilClip = false;
47 } 47 }
48 48
49 void makeScissored(SkIRect& scissor) {
50 fClipCoverageFP.reset();
51 fScissorState.set(scissor);
52 fHasStencilClip = false;
53 }
54
49 void makeScissoredFPBased(sk_sp<GrFragmentProcessor> fp, SkIRect& scissor) { 55 void makeScissoredFPBased(sk_sp<GrFragmentProcessor> fp, SkIRect& scissor) {
50 fClipCoverageFP = fp; 56 fClipCoverageFP = fp;
51 fScissorState.set(scissor); 57 fScissorState.set(scissor);
52 fHasStencilClip = false; 58 fHasStencilClip = false;
53 } 59 }
54 60
55 private: 61 private:
56 sk_sp<GrFragmentProcessor> fClipCoverageFP; 62 sk_sp<GrFragmentProcessor> fClipCoverageFP;
57 GrScissorState fScissorState; 63 GrScissorState fScissorState;
58 bool fHasStencilClip; 64 bool fHasStencilClip;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 bool* isIntersectionOfRects) const final; 152 bool* isIntersectionOfRects) const final;
147 bool apply(GrContext*, const GrPipelineBuilder&, GrDrawContext*, 153 bool apply(GrContext*, const GrPipelineBuilder&, GrDrawContext*,
148 const SkRect* devBounds, GrAppliedClip*) const final; 154 const SkRect* devBounds, GrAppliedClip*) const final;
149 155
150 private: 156 private:
151 SkIPoint fOrigin; 157 SkIPoint fOrigin;
152 SkAutoTUnref<const SkClipStack> fStack; 158 SkAutoTUnref<const SkClipStack> fStack;
153 }; 159 };
154 160
155 #endif 161 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrClipMaskManager.cpp » ('j') | src/gpu/GrClipMaskManager.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698