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

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

Issue 2185063002: require semi at the end of SkASSERT and friends (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: refactor do while as macro Created 4 years, 4 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/core/SkTypes.h ('k') | src/core/SkLinearBitmapPipeline_sample.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 * 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 26 matching lines...) Expand all
37 /** 37 /**
38 * The device bounds of the clip defaults to the scissor rect, but a tighter bounds (based 38 * The device bounds of the clip defaults to the scissor rect, but a tighter bounds (based
39 * on the known effect of the stencil values) can be provided. 39 * on the known effect of the stencil values) can be provided.
40 */ 40 */
41 void makeScissoredStencil(const SkIRect& scissor, const SkRect* deviceBounds = nullptr) { 41 void makeScissoredStencil(const SkIRect& scissor, const SkRect* deviceBounds = nullptr) {
42 fClipCoverageFP = nullptr; 42 fClipCoverageFP = nullptr;
43 fScissorState.set(scissor); 43 fScissorState.set(scissor);
44 fHasStencilClip = true; 44 fHasStencilClip = true;
45 if (deviceBounds) { 45 if (deviceBounds) {
46 fDeviceBounds = *deviceBounds; 46 fDeviceBounds = *deviceBounds;
47 SkASSERT(scissor.contains(*deviceBounds)) 47 SkASSERT(scissor.contains(*deviceBounds));
48 } else { 48 } else {
49 fDeviceBounds = SkRect::Make(scissor); 49 fDeviceBounds = SkRect::Make(scissor);
50 } 50 }
51 } 51 }
52 52
53 void makeFPBased(sk_sp<GrFragmentProcessor> fp, const SkRect& deviceBounds) { 53 void makeFPBased(sk_sp<GrFragmentProcessor> fp, const SkRect& deviceBounds) {
54 fClipCoverageFP = fp; 54 fClipCoverageFP = fp;
55 fScissorState.setDisabled(); 55 fScissorState.setDisabled();
56 fHasStencilClip = false; 56 fHasStencilClip = false;
57 fDeviceBounds = deviceBounds; 57 fDeviceBounds = deviceBounds;
(...skipping 10 matching lines...) Expand all
68 * The device bounds of the clip defaults to the scissor rect, but a tighter bounds (based 68 * The device bounds of the clip defaults to the scissor rect, but a tighter bounds (based
69 * on the known effect of the fragment processor) can be provided. 69 * on the known effect of the fragment processor) can be provided.
70 */ 70 */
71 void makeScissoredFPBased(sk_sp<GrFragmentProcessor> fp, const SkIRect& scis sor, 71 void makeScissoredFPBased(sk_sp<GrFragmentProcessor> fp, const SkIRect& scis sor,
72 const SkRect* deviceBounds = nullptr) { 72 const SkRect* deviceBounds = nullptr) {
73 fClipCoverageFP = fp; 73 fClipCoverageFP = fp;
74 fScissorState.set(scissor); 74 fScissorState.set(scissor);
75 fHasStencilClip = false; 75 fHasStencilClip = false;
76 if (deviceBounds) { 76 if (deviceBounds) {
77 fDeviceBounds = *deviceBounds; 77 fDeviceBounds = *deviceBounds;
78 SkASSERT(scissor.contains(*deviceBounds)) 78 SkASSERT(scissor.contains(*deviceBounds));
79 } else { 79 } else {
80 fDeviceBounds = SkRect::Make(scissor); 80 fDeviceBounds = SkRect::Make(scissor);
81 } 81 }
82 } 82 }
83 83
84 /** 84 /**
85 * Returns the device bounds of the applied clip. Ideally this considers the combined effect of 85 * Returns the device bounds of the applied clip. Ideally this considers the combined effect of
86 * all clipping techniques in play (scissor, stencil, and/or coverage fp). 86 * all clipping techniques in play (scissor, stencil, and/or coverage fp).
87 */ 87 */
88 const SkRect& deviceBounds() const { return fDeviceBounds; } 88 const SkRect& deviceBounds() const { return fDeviceBounds; }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 bool useHWAA, 297 bool useHWAA,
298 bool hasUserStencilSettings, 298 bool hasUserStencilSettings,
299 GrAppliedClip* out) const final; 299 GrAppliedClip* out) const final;
300 300
301 private: 301 private:
302 SkIPoint fOrigin; 302 SkIPoint fOrigin;
303 SkAutoTUnref<const SkClipStack> fStack; 303 SkAutoTUnref<const SkClipStack> fStack;
304 }; 304 };
305 305
306 #endif 306 #endif
OLDNEW
« no previous file with comments | « include/core/SkTypes.h ('k') | src/core/SkLinearBitmapPipeline_sample.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698