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

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

Issue 1486923004: Retract GrRenderTarget a bit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 | include/gpu/GrDrawContext.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
11 #include "SkClipStack.h" 11 #include "SkClipStack.h"
12 #include "GrSurface.h"
13 12
14 struct SkIRect; 13 struct SkIRect;
15 14
16 /** 15 /**
17 * GrClip encapsulates the information required to construct the clip 16 * GrClip encapsulates the information required to construct the clip
18 * masks. 'A GrClip is either wide open, just an IRect, just a Rect, or a full c lipstack. 17 * masks. 'A GrClip is either wide open, just an IRect, just a Rect, or a full c lipstack.
19 * If the clip is a clipstack than the origin is used to translate the stack wit h 18 * If the clip is a clipstack than the origin is used to translate the stack wit h
20 * respect to device coordinates. This allows us to use a clip stack that is 19 * respect to device coordinates. This allows us to use a clip stack that is
21 * specified for a root device with a layer device that is restricted to a subse t 20 * specified for a root device with a layer device that is restricted to a subse t
22 * of the original canvas. For other clip types the origin will always be (0,0). 21 * of the original canvas. For other clip types the origin will always be (0,0).
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 return (kWideOpen_ClipType == fClipType) || 149 return (kWideOpen_ClipType == fClipType) ||
151 (kClipStack_ClipType == fClipType && this->clipStack()->isWideOpe n()); 150 (kClipStack_ClipType == fClipType && this->clipStack()->isWideOpe n());
152 } 151 }
153 152
154 bool quickContains(const SkRect& rect) const { 153 bool quickContains(const SkRect& rect) const {
155 return (kWideOpen_ClipType == fClipType) || 154 return (kWideOpen_ClipType == fClipType) ||
156 (kClipStack_ClipType == fClipType && this->clipStack()->quickCont ains(rect)) || 155 (kClipStack_ClipType == fClipType && this->clipStack()->quickCont ains(rect)) ||
157 (kIRect_ClipType == fClipType && this->irect().contains(rect)); 156 (kIRect_ClipType == fClipType && this->irect().contains(rect));
158 } 157 }
159 158
160 void getConservativeBounds(const GrSurface* surface,
161 SkIRect* devResult,
162 bool* isIntersectionOfRects = NULL) const {
163 this->getConservativeBounds(surface->width(), surface->height(),
164 devResult, isIntersectionOfRects);
165 }
166
167 void getConservativeBounds(int width, int height, 159 void getConservativeBounds(int width, int height,
168 SkIRect* devResult, 160 SkIRect* devResult,
169 bool* isIntersectionOfRects = NULL) const; 161 bool* isIntersectionOfRects = NULL) const;
170 162
171 static const GrClip& WideOpen(); 163 static const GrClip& WideOpen();
172 164
173 enum ClipType { 165 enum ClipType {
174 kClipStack_ClipType, 166 kClipStack_ClipType,
175 kWideOpen_ClipType, 167 kWideOpen_ClipType,
176 kIRect_ClipType, 168 kIRect_ClipType,
177 }; 169 };
178 170
179 ClipType clipType() const { return fClipType; } 171 ClipType clipType() const { return fClipType; }
180 172
181 private: 173 private:
182 union Clip { 174 union Clip {
183 const SkClipStack* fStack; 175 const SkClipStack* fStack;
184 SkIRect fIRect; 176 SkIRect fIRect;
185 } fClip; 177 } fClip;
186 178
187 SkIPoint fOrigin; 179 SkIPoint fOrigin;
188 ClipType fClipType; 180 ClipType fClipType;
189 }; 181 };
190 182
191 #endif 183 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrDrawContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698