Index: src/core/SkPictureData.cpp |
diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp |
index 15534625972a874b2d2d5d6e3bc1c7305399ec43..57e1fddf40e48c6aa9f8d0fb2ba078becfacc1b1 100644 |
--- a/src/core/SkPictureData.cpp |
+++ b/src/core/SkPictureData.cpp |
@@ -8,7 +8,7 @@ |
#include "SkBBoxHierarchy.h" |
#include "SkDrawPictureCallback.h" |
#include "SkPictureData.h" |
robertphillips
2014/08/07 14:18:13
Copyright?
|
-#include "SkPictureRecord.h" |
+#include "Sk©Record.h" |
#include "SkReadBuffer.h" |
#include "SkTypeface.h" |
#include "SkTSort.h" |
@@ -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, |