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

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

Issue 481443002: Add GrResourceCache2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix leaks Created 6 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 | « src/gpu/GrClipMaskCache.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 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, GrDrawState::AutoRestoreEff ects*,
54 const SkRect* devBounds); 54 const SkRect* devBounds);
55 55
56 void releaseResources(); 56 /**
57 * 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.
59 */
60 void purgeResources();
57 61
58 bool isClipInStencil() const { 62 bool isClipInStencil() const {
59 return kStencil_ClipMaskType == fCurrClipMaskType; 63 return kStencil_ClipMaskType == fCurrClipMaskType;
60 } 64 }
61 bool isClipInAlpha() const { 65 bool isClipInAlpha() const {
62 return kAlpha_ClipMaskType == fCurrClipMaskType; 66 return kAlpha_ClipMaskType == fCurrClipMaskType;
63 } 67 }
64 68
65 void invalidateStencilMask() { 69 void invalidateStencilMask() {
66 if (kStencil_ClipMaskType == fCurrClipMaskType) { 70 if (kStencil_ClipMaskType == fCurrClipMaskType) {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 * clipping. 180 * clipping.
177 */ 181 */
178 void adjustStencilParams(GrStencilSettings* settings, 182 void adjustStencilParams(GrStencilSettings* settings,
179 StencilClipMode mode, 183 StencilClipMode mode,
180 int stencilBitCnt); 184 int stencilBitCnt);
181 185
182 typedef SkNoncopyable INHERITED; 186 typedef SkNoncopyable INHERITED;
183 }; 187 };
184 188
185 #endif // GrClipMaskManager_DEFINED 189 #endif // GrClipMaskManager_DEFINED
OLDNEW
« no previous file with comments | « src/gpu/GrClipMaskCache.h ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698