OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The Android Open Source Project | 2 * Copyright 2007 The Android Open Source Project |
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 | 8 |
9 #include "SkPictureFlat.h" | 9 #include "SkPictureFlat.h" |
10 #include "SkPictureData.h" | 10 #include "SkPictureData.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 break; | 223 break; |
224 } | 224 } |
225 } | 225 } |
226 } | 226 } |
227 | 227 |
228 bool SkPicture::Analysis::suitableForGpuRasterization(const char** reason, | 228 bool SkPicture::Analysis::suitableForGpuRasterization(const char** reason, |
229 int sampleCount) const { | 229 int sampleCount) const { |
230 // TODO: the heuristic used here needs to be refined | 230 // TODO: the heuristic used here needs to be refined |
231 static const int kNumSlowPathsTol = 6; | 231 static const int kNumSlowPathsTol = 6; |
232 | 232 |
233 int numSlowPathDashedPaths = fNumPaintWithPathEffectUses; | 233 int numSlowPathDashedPaths = fNumPaintWithPathEffectUses - fNumFastPathDashE
ffects; |
234 if (0 == sampleCount) { | |
235 // The fast dashing path only works when MSAA is disabled | |
236 numSlowPathDashedPaths -= fNumFastPathDashEffects; | |
237 } | |
238 | 234 |
239 int numSlowPaths = fNumAAConcavePaths - | 235 int numSlowPaths = fNumAAConcavePaths - |
240 fNumAAHairlineConcavePaths - | 236 fNumAAHairlineConcavePaths - |
241 fNumAADFEligibleConcavePaths; | 237 fNumAADFEligibleConcavePaths; |
242 | 238 |
243 bool ret = numSlowPathDashedPaths + numSlowPaths < kNumSlowPathsTol; | 239 bool ret = numSlowPathDashedPaths + numSlowPaths < kNumSlowPathsTol; |
244 | 240 |
245 if (!ret && reason) { | 241 if (!ret && reason) { |
246 *reason = "Too many slow paths (either concave or dashed)."; | 242 *reason = "Too many slow paths (either concave or dashed)."; |
247 } | 243 } |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 if (sk_atomic_compare_exchange(&fUniqueID, &id, next, | 495 if (sk_atomic_compare_exchange(&fUniqueID, &id, next, |
500 sk_memory_order_relaxed, | 496 sk_memory_order_relaxed, |
501 sk_memory_order_relaxed)) { | 497 sk_memory_order_relaxed)) { |
502 id = next; | 498 id = next; |
503 } else { | 499 } else { |
504 // sk_atomic_compare_exchange replaced id with the current value of
fUniqueID. | 500 // sk_atomic_compare_exchange replaced id with the current value of
fUniqueID. |
505 } | 501 } |
506 } | 502 } |
507 return id; | 503 return id; |
508 } | 504 } |
OLD | NEW |