OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkRecords_DEFINED | 8 #ifndef SkRecords_DEFINED |
9 #define SkRecords_DEFINED | 9 #define SkRecords_DEFINED |
10 | 10 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 SkBitmap fBitmap; | 209 SkBitmap fBitmap; |
210 }; | 210 }; |
211 | 211 |
212 // SkPath::getBounds() isn't thread safe unless we precache the bounds in a sing
lethreaded context. | 212 // SkPath::getBounds() isn't thread safe unless we precache the bounds in a sing
lethreaded context. |
213 // SkPath::cheapComputeDirection() is similar. | 213 // SkPath::cheapComputeDirection() is similar. |
214 // Recording is a convenient time to cache these, or we can delay it to between
record and playback. | 214 // Recording is a convenient time to cache these, or we can delay it to between
record and playback. |
215 struct PreCachedPath : public SkPath { | 215 struct PreCachedPath : public SkPath { |
216 PreCachedPath() {} | 216 PreCachedPath() {} |
217 explicit PreCachedPath(const SkPath& path) : SkPath(path) { | 217 explicit PreCachedPath(const SkPath& path) : SkPath(path) { |
218 this->updateBoundsCache(); | 218 this->updateBoundsCache(); |
| 219 #if 0 // Disabled to see if we ever really race on this. It costs time, chromi
um:496982. |
219 SkPathPriv::FirstDirection junk; | 220 SkPathPriv::FirstDirection junk; |
220 (void)SkPathPriv::CheapComputeFirstDirection(*this, &junk); | 221 (void)SkPathPriv::CheapComputeFirstDirection(*this, &junk); |
| 222 #endif |
221 } | 223 } |
222 }; | 224 }; |
223 | 225 |
224 // Like SkPath::getBounds(), SkMatrix::getType() isn't thread safe unless we pre
cache it. | 226 // Like SkPath::getBounds(), SkMatrix::getType() isn't thread safe unless we pre
cache it. |
225 // This may not cover all SkMatrices used by the picture (e.g. some could be hid
ing in a shader). | 227 // This may not cover all SkMatrices used by the picture (e.g. some could be hid
ing in a shader). |
226 struct TypedMatrix : public SkMatrix { | 228 struct TypedMatrix : public SkMatrix { |
227 TypedMatrix() {} | 229 TypedMatrix() {} |
228 explicit TypedMatrix(const SkMatrix& matrix) : SkMatrix(matrix) { | 230 explicit TypedMatrix(const SkMatrix& matrix) : SkMatrix(matrix) { |
229 (void)this->getType(); | 231 (void)this->getType(); |
230 } | 232 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 #undef RECORD0 | 361 #undef RECORD0 |
360 #undef RECORD1 | 362 #undef RECORD1 |
361 #undef RECORD2 | 363 #undef RECORD2 |
362 #undef RECORD3 | 364 #undef RECORD3 |
363 #undef RECORD4 | 365 #undef RECORD4 |
364 #undef RECORD5 | 366 #undef RECORD5 |
365 | 367 |
366 } // namespace SkRecords | 368 } // namespace SkRecords |
367 | 369 |
368 #endif//SkRecords_DEFINED | 370 #endif//SkRecords_DEFINED |
OLD | NEW |