diff options
author | Mike Reed <reed@google.com> | 2017-12-20 15:03:08 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-20 20:27:06 +0000 |
commit | b60c5ebf045df23f9a15f85c37825b15adff9d8d (patch) | |
tree | 59ddc5aea96dd7fef64b8e738ff9e20feed5db4f /src/core/SkPictureCommon.h | |
parent | 297d6efe852ebb98a324a71c79df8f7bbdcc3b94 (diff) |
remove unused willPlayBackBitmaps from picture
and SkPictureAnalyzer
Bug: skia:
Change-Id: I394eca648234b1a69e6f9a0a88c407366a33d079
Reviewed-on: https://skia-review.googlesource.com/87791
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/core/SkPictureCommon.h')
-rw-r--r-- | src/core/SkPictureCommon.h | 59 |
1 files changed, 1 insertions, 58 deletions
diff --git a/src/core/SkPictureCommon.h b/src/core/SkPictureCommon.h index 39f816afc9..edd9be1b31 100644 --- a/src/core/SkPictureCommon.h +++ b/src/core/SkPictureCommon.h @@ -4,12 +4,12 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ + #ifndef SkPictureCommon_DEFINED #define SkPictureCommon_DEFINED // Some shared code used by both SkBigPicture and SkMiniPicture. // SkTextHunter -- SkRecord visitor that returns true when the op draws text. -// SkBitmapHunter -- SkRecord visitor that returns true when the op draws a bitmap or image. // SkPathCounter -- SkRecord visitor that counts paths that draw slowly on the GPU. #include "SkPathEffect.h" @@ -17,58 +17,6 @@ #include "SkShader.h" #include "SkTLogic.h" -// N.B. This name is slightly historical: hunting season is now open for SkImages too. -struct SkBitmapHunter { - // Some ops have a paint, some have an optional paint. Either way, get back a pointer. - static const SkPaint* AsPtr(const SkPaint& p) { return &p; } - static const SkPaint* AsPtr(const SkRecords::Optional<SkPaint>& p) { return p; } - - // Main entry for visitor: - // If the op is a DrawPicture, recurse. - // If the op has a bitmap or image directly, return true. - // If the op has a paint and the paint has a bitmap, return true. - // Otherwise, return false. - bool operator()(const SkRecords::DrawPicture& op) { return op.picture->willPlayBackBitmaps(); } - bool operator()(const SkRecords::DrawDrawable&) { /*TODO*/ return false; } - - template <typename T> - bool operator()(const T& op) { return CheckBitmap(op); } - - // If the op is tagged as having an image, return true. - template <typename T> - static SK_WHEN(T::kTags & SkRecords::kHasImage_Tag, bool) CheckBitmap(const T&) { - return true; - } - - // If not, look for one in its paint (if it has a paint). - template <typename T> - static SK_WHEN(!(T::kTags & SkRecords::kHasImage_Tag), bool) CheckBitmap(const T& op) { - return CheckPaint(op); - } - - // Most draws-type ops have paints. - template <typename T> - static SK_WHEN(T::kTags & SkRecords::kHasPaint_Tag, bool) CheckPaint(const T& op) { - return PaintHasBitmap(AsPtr(op.paint)); - } - - template <typename T> - static SK_WHEN(!(T::kTags & SkRecords::kHasPaint_Tag), bool) CheckPaint(const T&) { - return false; - } - -private: - static bool PaintHasBitmap(const SkPaint* paint) { - if (paint) { - const SkShader* shader = paint->getShader(); - if (shader && shader->isAImage()) { - return true; - } - } - return false; - } -}; - // TODO: might be nicer to have operator() return an int (the number of slow paths) ? struct SkPathCounter { // Some ops have a paint, some have an optional paint. Either way, get back a pointer. @@ -77,11 +25,6 @@ struct SkPathCounter { SkPathCounter() : fNumSlowPathsAndDashEffects(0) {} - // Recurse into nested pictures. - void operator()(const SkRecords::DrawPicture& op) { - fNumSlowPathsAndDashEffects += op.picture->numSlowPaths(); - } - void checkPaint(const SkPaint* paint) { if (paint && paint->getPathEffect()) { // Initially assume it's slow. |