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

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

Issue 676983003: Clip mask manager sets stencil on draw type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: bug fix Created 6 years, 1 month 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') | 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 #ifndef GrClipMaskManager_DEFINED 8 #ifndef GrClipMaskManager_DEFINED
9 #define GrClipMaskManager_DEFINED 9 #define GrClipMaskManager_DEFINED
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 , fCurrClipMaskType(kNone_ClipMaskType) { 43 , fCurrClipMaskType(kNone_ClipMaskType) {
44 } 44 }
45 45
46 /** 46 /**
47 * Creates a clip mask if necessary as a stencil buffer or alpha texture 47 * Creates a clip mask if necessary as a stencil buffer or alpha texture
48 * and sets the GrGpu's scissor and stencil state. If the return is false 48 * and sets the GrGpu's scissor and stencil state. If the return is false
49 * then the draw can be skipped. The AutoRestoreEffects is initialized by 49 * then the draw can be skipped. The AutoRestoreEffects is initialized by
50 * the manager when it must install additional effects to implement the 50 * the manager when it must install additional effects to implement the
51 * clip. devBounds is optional but can help optimize clipping. 51 * clip. devBounds is optional but can help optimize clipping.
52 */ 52 */
53 bool setupClipping(const GrClipData* clipDataIn, GrDrawState::AutoRestoreEff ects*, 53 bool setupClipping(const GrClipData* clipDataIn,
54 GrDrawState::AutoRestoreEffects*,
55 GrDrawState::AutoRestoreStencil*,
54 const SkRect* devBounds); 56 const SkRect* devBounds);
55 57
56 /** 58 /**
57 * Purge resources to free up memory. TODO: This class shouldn't hold any lo ng lived refs 59 * Purge resources to free up memory. TODO: This class shouldn't hold any lo ng lived refs
58 * which will allow ResourceCache2 to automatically purge anything this clas s has created. 60 * which will allow ResourceCache2 to automatically purge anything this clas s has created.
59 */ 61 */
60 void purgeResources(); 62 void purgeResources();
61 63
62 bool isClipInStencil() const { 64 bool isClipInStencil() const {
63 return kStencil_ClipMaskType == fCurrClipMaskType; 65 return kStencil_ClipMaskType == fCurrClipMaskType;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 GrTexture* createTempMask(int width, int height); 168 GrTexture* createTempMask(int width, int height);
167 169
168 void setupCache(const SkClipStack& clip, 170 void setupCache(const SkClipStack& clip,
169 const SkIRect& bounds); 171 const SkIRect& bounds);
170 172
171 /** 173 /**
172 * Called prior to return control back the GrGpu in setupClipping. It 174 * Called prior to return control back the GrGpu in setupClipping. It
173 * updates the GrGpu with stencil settings that account stencil-based 175 * updates the GrGpu with stencil settings that account stencil-based
174 * clipping. 176 * clipping.
175 */ 177 */
176 void setGpuStencil(); 178 void setDrawStateStencil(GrDrawState::AutoRestoreStencil* asr);
177 179
178 /** 180 /**
179 * Adjusts the stencil settings to account for interaction with stencil 181 * Adjusts the stencil settings to account for interaction with stencil
180 * clipping. 182 * clipping.
181 */ 183 */
182 void adjustStencilParams(GrStencilSettings* settings, 184 void adjustStencilParams(GrStencilSettings* settings,
183 StencilClipMode mode, 185 StencilClipMode mode,
184 int stencilBitCnt); 186 int stencilBitCnt);
185 187
186 typedef SkNoncopyable INHERITED; 188 typedef SkNoncopyable INHERITED;
187 }; 189 };
188 190
189 #endif // GrClipMaskManager_DEFINED 191 #endif // GrClipMaskManager_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698