diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/record/SkRecordDraw.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/record/SkRecordDraw.cpp b/src/record/SkRecordDraw.cpp index bc1bbf5fd4..4878b3f4f6 100644 --- a/src/record/SkRecordDraw.cpp +++ b/src/record/SkRecordDraw.cpp @@ -7,8 +7,6 @@ #include "SkRecordDraw.h" -#include "SkRecordTraits.h" - namespace { // This is an SkRecord visitor that will draw that SkRecord to an SkCanvas. @@ -29,27 +27,22 @@ private: // No base case, so we'll be compile-time checked that we implemented all possibilities below. template <typename T> void draw(const T&); - // skip() returns true if we can skip this command, false if not. - // Update fIndex directly to skip more than just this one command. - - // If we're drawing into an empty clip, we can skip it. Otherwise, run the command. - template <typename T> - SK_WHEN(SkRecords::IsDraw<T>, bool) skip(const T&) { return fCanvas->isClipEmpty(); } + // skip() should return true if we can skip this command, false if not. + // It may update fIndex directly to skip more than just this one command. - template <typename T> - SK_WHEN(!SkRecords::IsDraw<T>, bool) skip(const T&) { return false; } + // Mostly we just blindly call fCanvas and let it handle quick rejects itself. + template <typename T> bool skip(const T&) { return false; } - // Special versions for commands added by optimizations. + // We add our own quick rejects for commands added by optimizations. bool skip(const SkRecords::PairedPushCull& r) { if (fCanvas->quickReject(r.base->rect)) { fIndex += r.skip; return true; } - return this->skip(*r.base); + return false; } - bool skip(const SkRecords::BoundedDrawPosTextH& r) { - return this->skip(*r.base) || fCanvas->quickRejectY(r.minY, r.maxY); + return fCanvas->quickRejectY(r.minY, r.maxY); } SkCanvas* fCanvas; |