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

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

Issue 324963005: Split caching from allocation in GrClipMaskManager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Code review changes Created 6 years, 6 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') | 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 GrTexture* createAlphaClipMask(int32_t elementsGenID, 123 GrTexture* createAlphaClipMask(int32_t elementsGenID,
124 GrReducedClip::InitialState initialState, 124 GrReducedClip::InitialState initialState,
125 const GrReducedClip::ElementList& elements, 125 const GrReducedClip::ElementList& elements,
126 const SkIRect& clipSpaceIBounds); 126 const SkIRect& clipSpaceIBounds);
127 // Similar to createAlphaClipMask but it rasterizes in SW and uploads to the result texture. 127 // Similar to createAlphaClipMask but it rasterizes in SW and uploads to the result texture.
128 GrTexture* createSoftwareClipMask(int32_t elementsGenID, 128 GrTexture* createSoftwareClipMask(int32_t elementsGenID,
129 GrReducedClip::InitialState initialState, 129 GrReducedClip::InitialState initialState,
130 const GrReducedClip::ElementList& elements , 130 const GrReducedClip::ElementList& elements ,
131 const SkIRect& clipSpaceIBounds); 131 const SkIRect& clipSpaceIBounds);
132 132
133 // Gets a texture to use for the clip mask. If true is returned then a cache d mask was found 133 // Returns the cached mask texture if it matches the elementsGenID and the c lipSpaceIBounds.
134 // that already contains the rasterization of the clip stack, otherwise an u ninitialized texture 134 // Returns NULL if not found.
135 // is returned. 'willUpload' is set when the alpha mask needs to be uploaded from the CPU. 135 GrTexture* getCachedMaskTexture(int32_t elementsGenID, const SkIRect& clipSp aceIBounds);
136 bool getMaskTexture(int32_t elementsGenID, 136
137 const SkIRect& clipSpaceIBounds, 137
138 GrTexture** result, 138 // Handles allocation (if needed) of a clip alpha-mask texture for both the sw-upload
139 bool willUpload); 139 // or gpu-rendered cases.
140 GrTexture* allocMaskTexture(int32_t elementsGenID,
141 const SkIRect& clipSpaceIBounds,
142 bool willUpload);
140 143
141 bool useSWOnlyPath(const GrReducedClip::ElementList& elements); 144 bool useSWOnlyPath(const GrReducedClip::ElementList& elements);
142 145
143 // Draws a clip element into the target alpha mask. The caller should have a lready setup the 146 // Draws a clip element into the target alpha mask. The caller should have a lready setup the
144 // desired blend operation. Optionally if the caller already selected a path renderer it can 147 // desired blend operation. Optionally if the caller already selected a path renderer it can
145 // be passed. Otherwise the function will select one if the element is a pat h. 148 // be passed. Otherwise the function will select one if the element is a pat h.
146 bool drawElement(GrTexture* target, const SkClipStack::Element*, GrPathRende rer* = NULL); 149 bool drawElement(GrTexture* target, const SkClipStack::Element*, GrPathRende rer* = NULL);
147 150
148 // Determines whether it is possible to draw the element to both the stencil buffer and the 151 // Determines whether it is possible to draw the element to both the stencil buffer and the
149 // alpha mask simultaneously. If so and the element is a path a compatible p ath renderer is 152 // alpha mask simultaneously. If so and the element is a path a compatible p ath renderer is
(...skipping 23 matching lines...) Expand all
173 * clipping. 176 * clipping.
174 */ 177 */
175 void adjustStencilParams(GrStencilSettings* settings, 178 void adjustStencilParams(GrStencilSettings* settings,
176 StencilClipMode mode, 179 StencilClipMode mode,
177 int stencilBitCnt); 180 int stencilBitCnt);
178 181
179 typedef SkNoncopyable INHERITED; 182 typedef SkNoncopyable INHERITED;
180 }; 183 };
181 184
182 #endif // GrClipMaskManager_DEFINED 185 #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