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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 this->reset(); | 197 this->reset(); |
198 } | 198 } |
199 | 199 |
200 void acquireMask(GrContext* context, | 200 void acquireMask(GrContext* context, |
201 int32_t clipGenID, | 201 int32_t clipGenID, |
202 const GrTextureDesc& desc, | 202 const GrTextureDesc& desc, |
203 const SkIRect& bound) { | 203 const SkIRect& bound) { |
204 | 204 |
205 fLastClipGenID = clipGenID; | 205 fLastClipGenID = clipGenID; |
206 | 206 |
207 fLastMask.set(context, desc); | 207 // HACK: set the last param to true to indicate that this request is
at |
| 208 // flush time and therefore we require a scratch texture with no pen
ding IO operations. |
| 209 fLastMask.set(context, desc, GrContext::kApprox_ScratchTexMatch, /*f
lushing=*/true); |
208 | 210 |
209 fLastBound = bound; | 211 fLastBound = bound; |
210 } | 212 } |
211 | 213 |
212 void reset () { | 214 void reset () { |
213 fLastClipGenID = SkClipStack::kInvalidGenID; | 215 fLastClipGenID = SkClipStack::kInvalidGenID; |
214 | 216 |
215 GrTextureDesc desc; | 217 GrTextureDesc desc; |
216 | 218 |
217 fLastMask.set(NULL, desc); | 219 fLastMask.set(NULL, desc); |
(...skipping 10 matching lines...) Expand all Loading... |
228 SkIRect fLastBound; | 230 SkIRect fLastBound; |
229 }; | 231 }; |
230 | 232 |
231 GrContext* fContext; | 233 GrContext* fContext; |
232 SkDeque fStack; | 234 SkDeque fStack; |
233 | 235 |
234 typedef SkNoncopyable INHERITED; | 236 typedef SkNoncopyable INHERITED; |
235 }; | 237 }; |
236 | 238 |
237 #endif // GrClipMaskCache_DEFINED | 239 #endif // GrClipMaskCache_DEFINED |
OLD | NEW |