Chromium Code Reviews| Index: src/core/SkPictureData.cpp |
| diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp |
| index 15534625972a874b2d2d5d6e3bc1c7305399ec43..ae81b13f55e8b67bb0a061c8d29b3e7b34eb1219 100644 |
| --- a/src/core/SkPictureData.cpp |
| +++ b/src/core/SkPictureData.cpp |
| @@ -670,36 +670,7 @@ const SkPicture::OperationList* SkPictureData::getActiveOps(const SkIRect& query |
| #if SK_SUPPORT_GPU |
| bool SkPictureData::suitableForGpuRasterization(GrContext* context, const char **reason, |
|
robertphillips
2014/08/04 14:31:24
line this guy up ?
|
| 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; |
| + return fContentInfo.suitableForGpuRasterization(context, reason, sampleCount); |
| } |
| bool SkPictureData::suitableForGpuRasterization(GrContext* context, const char **reason, |