Chromium Code Reviews| Index: src/core/SkPicture.cpp |
| diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp |
| index 0f016acca4a8bcb2e203454aa49b627e6b05008c..57a614913ee4a91ba7dfb8f91e1ed7d22815122d 100644 |
| --- a/src/core/SkPicture.cpp |
| +++ b/src/core/SkPicture.cpp |
| @@ -654,15 +654,22 @@ void SkPicture::flatten(SkWriteBuffer& buffer) const { |
| } |
| #if SK_SUPPORT_GPU |
| -bool SkPicture::suitableForGpuRasterization(GrContext* context) const { |
| +bool SkPicture::suitableForGpuRasterization(GrContext* context, const char **reason) const { |
| // TODO: the heuristic used here needs to be refined |
| static const int kNumPaintWithPathEffectUsesTol = 1; |
| static const int kNumAAConcavePaths = 5; |
| SkASSERT(this->numAAHairlineConcavePaths() <= this->numAAConcavePaths()); |
| - return this->numPaintWithPathEffectUses() < kNumPaintWithPathEffectUsesTol && |
| - (this->numAAConcavePaths()-this->numAAHairlineConcavePaths()) < kNumAAConcavePaths; |
| + bool ret = this->numPaintWithPathEffectUses() < kNumPaintWithPathEffectUsesTol && |
| + (this->numAAConcavePaths()-this->numAAHairlineConcavePaths()) < kNumAAConcavePaths; |
|
robertphillips
2014/06/02 13:22:16
NULL != reason ?
|
| + if (!ret && reason) { |
| + if (this->numPaintWithPathEffectUses() < kNumPaintWithPathEffectUsesTol) |
|
ernstm
2014/05/30 22:07:04
Shouldn't this be >= ?
|
| + *reason = "Too many path effects."; |
| + else if ((this->numAAConcavePaths()-this->numAAHairlineConcavePaths()) < kNumAAConcavePaths) |
| + *reason = "Too many anti-aliased concave paths."; |
| + } |
| + return ret; |
| } |
| #endif |