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

Unified Diff: src/core/SkPicture.cpp

Issue 875913002: Alter gpu veto (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix PictureTest Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicture.cpp
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index 871a62e8f36d4f8d184e71a24d688510ae9dd755..c7e36e7ecd2a6e99eb12b0395925dcda65a29657 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -239,31 +239,22 @@ SkPicture::Analysis::Analysis(const SkRecord& record) {
bool SkPicture::Analysis::suitableForGpuRasterization(const char** reason,
int sampleCount) const {
// TODO: the heuristic used here needs to be refined
- static const int kNumPaintWithPathEffectsUsesTol = 1;
- static const int kNumAAConcavePathsTol = 5;
+ static const int kNumSlowPathsTol = 6;
- int numNonDashedPathEffects = fNumPaintWithPathEffectUses -
- fNumFastPathDashEffects;
- bool suitableForDash = (0 == fNumPaintWithPathEffectUses) ||
- (numNonDashedPathEffects < kNumPaintWithPathEffectsUsesTol
- && 0 == sampleCount);
+ int numSlowPathDashedPaths = fNumPaintWithPathEffectUses;
+ if (0 == sampleCount) {
+ // The fast dashing path only works when MSAA is disabled
+ numSlowPathDashedPaths -= fNumFastPathDashEffects;
+ }
+
+ int numSlowPaths = fNumAAConcavePaths -
+ fNumAAHairlineConcavePaths -
+ fNumAADFEligibleConcavePaths;
- bool ret = suitableForDash &&
- (fNumAAConcavePaths - fNumAAHairlineConcavePaths - fNumAADFEligibleConcavePaths)
- < kNumAAConcavePathsTol;
+ bool ret = numSlowPathDashedPaths + numSlowPaths < kNumSlowPathsTol;
if (!ret && reason) {
- if (!suitableForDash) {
- if (0 != sampleCount) {
- *reason = "Can't use multisample on dash effect.";
- } else {
- *reason = "Too many non dashed path effects.";
- }
- } else if ((fNumAAConcavePaths - fNumAAHairlineConcavePaths - fNumAADFEligibleConcavePaths)
- >= kNumAAConcavePathsTol)
- *reason = "Too many anti-aliased concave paths.";
- else
- *reason = "Unknown reason for GPU unsuitability.";
+ *reason = "Too many slow paths (either concave or dashed).";
}
return ret;
}
« no previous file with comments | « no previous file | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698