OLD | NEW |
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 GrClipMaskCache_DEFINED | 8 #ifndef GrClipMaskCache_DEFINED |
9 #define GrClipMaskCache_DEFINED | 9 #define GrClipMaskCache_DEFINED |
10 | 10 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 this->reset(); | 188 this->reset(); |
189 } | 189 } |
190 | 190 |
191 void acquireMask(GrResourceProvider* resourceProvider, | 191 void acquireMask(GrResourceProvider* resourceProvider, |
192 int32_t clipGenID, | 192 int32_t clipGenID, |
193 const GrSurfaceDesc& desc, | 193 const GrSurfaceDesc& desc, |
194 const SkIRect& bound) { | 194 const SkIRect& bound) { |
195 | 195 |
196 fLastClipGenID = clipGenID; | 196 fLastClipGenID = clipGenID; |
197 | 197 |
198 // HACK: set the last param to true to indicate that this request is
at | 198 // TODO: Determine if we really need the NoPendingIO flag anymore. |
199 // flush time and therefore we require a scratch texture with no pen
ding IO operations. | 199 // (http://skbug.com/4156) |
200 fLastMask.reset(resourceProvider->refScratchTexture( | 200 static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag
; |
201 desc, GrTextureProvider::kApprox_ScratchTexMatch, /*flushing=*/t
rue)); | 201 fLastMask.reset(resourceProvider->createApproxTexture(desc, kFlags))
; |
202 | 202 |
203 fLastBound = bound; | 203 fLastBound = bound; |
204 } | 204 } |
205 | 205 |
206 void reset () { | 206 void reset () { |
207 fLastClipGenID = SkClipStack::kInvalidGenID; | 207 fLastClipGenID = SkClipStack::kInvalidGenID; |
208 | 208 |
209 GrSurfaceDesc desc; | 209 GrSurfaceDesc desc; |
210 | 210 |
211 fLastMask.reset(NULL); | 211 fLastMask.reset(NULL); |
(...skipping 10 matching lines...) Expand all Loading... |
222 SkIRect fLastBound; | 222 SkIRect fLastBound; |
223 }; | 223 }; |
224 | 224 |
225 SkDeque fStack; | 225 SkDeque fStack; |
226 GrResourceProvider* fResourceProvider; | 226 GrResourceProvider* fResourceProvider; |
227 | 227 |
228 typedef SkNoncopyable INHERITED; | 228 typedef SkNoncopyable INHERITED; |
229 }; | 229 }; |
230 | 230 |
231 #endif // GrClipMaskCache_DEFINED | 231 #endif // GrClipMaskCache_DEFINED |
OLD | NEW |