Send SkPicture deletion message lazily.
authormtklein <mtklein@chromium.org>
Tue, 7 Apr 2015 13:34:05 +0000 (06:34 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 7 Apr 2015 13:34:05 +0000 (06:34 -0700)
commite35268ef4cdaa29600671cdf9d0ebb43b622d1a3
treece843d10af220ce2032cd9e4dad7178103abf699
parent6cad1da6ef6a41c25258a42cd36e9a591a1cc076
Send SkPicture deletion message lazily.

If no one has read the picture's unique ID, there's no point invalidating it.

This is the same trick we pull with SkPixelRefs.

Before:
  26M 1 1.49µs 1.6µs 1.77µs 6.25µs 42% picture_overhead_draw
  13M 32 742ns 749ns 756ns 823ns 2% picture_overhead_nodraw

After:
  26M 1 1.27µs 1.33µs 1.49µs 5.51µs 45% picture_overhead_draw
  14M 43 677ns 680ns 681ns 701ns 1% picture_overhead_nodraw

BUG=skia:

Review URL: https://codereview.chromium.org/1061283002
include/core/SkPicture.h
src/core/SkPicture.cpp