diff options
author | mtklein <mtklein@chromium.org> | 2015-05-20 10:16:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-20 10:16:49 -0700 |
commit | d41ea1d1cf0358e8b147c30c2dd168b631cc9b47 (patch) | |
tree | 70e5b6df6da3992cb75c9a9356d14cce7bb8e4bc /src/core/SkMiniRecorder.h | |
parent | 22483d9ca6e393635ffdf371c35026f0e8ec429c (diff) |
More efficient SkRecorder::flushMiniRecorder()
This should involve no mallocs, frees, or memcpys, and less refcounting.
BUG=skia:
Review URL: https://codereview.chromium.org/1144173002
Diffstat (limited to 'src/core/SkMiniRecorder.h')
-rw-r--r-- | src/core/SkMiniRecorder.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/SkMiniRecorder.h b/src/core/SkMiniRecorder.h index d01aedacea..914eccc2e3 100644 --- a/src/core/SkMiniRecorder.h +++ b/src/core/SkMiniRecorder.h @@ -27,6 +27,12 @@ public: // Detach anything we've recorded as a picture, resetting this SkMiniRecorder. SkPicture* detachAsPicture(const SkRect& cull); + // Flush anything we've recorded to the canvas, resetting this SkMiniRecorder. + // This is logically the same as but rather more efficient than: + // SkAutoTUnref<SkPicture> pic(this->detachAsPicture(SkRect::MakeEmpty())); + // pic->playback(canvas); + void flushAndReset(SkCanvas*); + private: enum class State { kEmpty, kDrawPath, kDrawRect, kDrawTextBlob }; |