| 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,
|
|
|