diff options
author | 2015-05-07 13:41:07 -0700 | |
---|---|---|
committer | 2015-05-07 13:41:07 -0700 | |
commit | c92c129ff85b05a714bd1bf921c02d5e14651f8b (patch) | |
tree | ea2f915b36a5f6abb746827a4a6f650d5ff13310 /src/utils | |
parent | 2fbd4068bde6a9fb50341c0bdfbb8bf18b70d015 (diff) |
Sketch splitting SkPicture into an interface and SkBigPicture.
Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
These cover about 89% of draw calls from Blink SKPs,
and about 25% of draw calls from our GMs.
SkPicture handles:
- serialization and deserialization
- unique IDs
Everything else is left to the subclasses:
- playback(), cullRect()
- hasBitmap(), hasText(), suitableForGPU(), etc.
- LayerInfo / AccelData if applicable.
The time to record a 1-op picture improves a good chunk
(2 mallocs to 1), and the time to record a 0-op picture
greatly improves (2 mallocs to none):
picture_overhead_draw: 450ns -> 350ns
picture_overhead_nodraw: 300ns -> 90ns
BUG=skia:
Review URL: https://codereview.chromium.org/1112523006
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/SkPictureUtils.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/utils/SkPictureUtils.cpp b/src/utils/SkPictureUtils.cpp deleted file mode 100644 index a8a251c927..0000000000 --- a/src/utils/SkPictureUtils.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "SkBBoxHierarchy.h" -#include "SkCanvas.h" -#include "SkData.h" -#include "SkPictureUtils.h" -#include "SkRecord.h" -#include "SkShader.h" - -size_t SkPictureUtils::ApproximateBytesUsed(const SkPicture* pict) { - size_t byteCount = sizeof(*pict); - - byteCount += pict->fRecord->bytesUsed(); - if (pict->fBBH.get()) { - byteCount += pict->fBBH->bytesUsed(); - } - byteCount += pict->fApproxBytesUsedBySubPictures; - - return byteCount; -} |