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

Unified Diff: src/core/SkPictureData.cpp

Issue 435093003: Keep track of the number of skia operations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed the return type of numOperations Created 6 years, 4 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 | « src/core/SkPictureData.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureData.cpp
diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp
index 15534625972a874b2d2d5d6e3bc1c7305399ec43..123c414b53de2269e8a14fcc765e9c13343c3bb5 100644
--- a/src/core/SkPictureData.cpp
+++ b/src/core/SkPictureData.cpp
@@ -669,37 +669,8 @@ const SkPicture::OperationList* SkPictureData::getActiveOps(const SkIRect& query
#if SK_SUPPORT_GPU
bool SkPictureData::suitableForGpuRasterization(GrContext* context, const char **reason,
- int sampleCount) const {
- // TODO: the heuristic used here needs to be refined
- static const int kNumPaintWithPathEffectUsesTol = 1;
- static const int kNumAAConcavePaths = 5;
-
- SkASSERT(fContentInfo.numAAHairlineConcavePaths() <= fContentInfo.numAAConcavePaths());
-
- int numNonDashedPathEffects = fContentInfo.numPaintWithPathEffectUses() -
- fContentInfo.numFastPathDashEffects();
-
- bool suitableForDash = (0 == fContentInfo.numPaintWithPathEffectUses()) ||
- (numNonDashedPathEffects < kNumPaintWithPathEffectUsesTol
- && 0 == sampleCount);
-
- bool ret = suitableForDash &&
- (fContentInfo.numAAConcavePaths() - fContentInfo.numAAHairlineConcavePaths())
- < kNumAAConcavePaths;
- if (!ret && NULL != reason) {
- if (!suitableForDash) {
- if (0 != sampleCount) {
- *reason = "Can't use multisample on dash effect.";
- } else {
- *reason = "Too many non dashed path effects.";
- }
- } else if ((fContentInfo.numAAConcavePaths() - fContentInfo.numAAHairlineConcavePaths())
- >= kNumAAConcavePaths)
- *reason = "Too many anti-aliased concave paths.";
- else
- *reason = "Unknown reason for GPU unsuitability.";
- }
- return ret;
+ int sampleCount) const {
+ return fContentInfo.suitableForGpuRasterization(context, reason, sampleCount);
}
bool SkPictureData::suitableForGpuRasterization(GrContext* context, const char **reason,
« no previous file with comments | « src/core/SkPictureData.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698