diff options
author | 2015-05-07 13:41:07 -0700 | |
---|---|---|
committer | 2015-05-07 13:41:07 -0700 | |
commit | c92c129ff85b05a714bd1bf921c02d5e14651f8b (patch) | |
tree | ea2f915b36a5f6abb746827a4a6f650d5ff13310 /src/core/SkLayerInfo.h | |
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/core/SkLayerInfo.h')
-rw-r--r-- | src/core/SkLayerInfo.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/core/SkLayerInfo.h b/src/core/SkLayerInfo.h index a47c3f1199..3d4b26960c 100644 --- a/src/core/SkLayerInfo.h +++ b/src/core/SkLayerInfo.h @@ -8,12 +8,12 @@ #ifndef SkLayerInfo_DEFINED #define SkLayerInfo_DEFINED -#include "SkPicture.h" +#include "SkBigPicture.h" #include "SkTArray.h" // This class stores information about the saveLayer/restore pairs found // within an SkPicture. It is used by Ganesh to perform layer hoisting. -class SkLayerInfo : public SkPicture::AccelData { +class SkLayerInfo : public SkBigPicture::AccelData { public: // Information about a given saveLayer/restore block in an SkPicture class BlockInfo { @@ -33,12 +33,12 @@ public: SkRect fSrcBounds; // The pre-matrix begins as the identity and accumulates the transforms // of the containing SkPictures (if any). This matrix state has to be - // part of the initial matrix during replay so that it will be + // part of the initial matrix during replay so that it will be // preserved across setMatrix calls. SkMatrix fPreMat; - // The matrix state (in the leaf picture) in which this layer's draws + // The matrix state (in the leaf picture) in which this layer's draws // must occur. It will/can be overridden by setMatrix calls in the - // layer itself. It does not include the translation needed to map the + // layer itself. It does not include the translation needed to map the // layer's top-left point to the origin (which must be part of the // initial matrix). SkMatrix fLocalMat; @@ -60,7 +60,7 @@ public: int fKeySize; // # of ints }; - SkLayerInfo(Key key) : INHERITED(key) { } + SkLayerInfo() {} BlockInfo& addBlock() { return fBlocks.push_back(); } @@ -72,14 +72,10 @@ public: return fBlocks[index]; } - // We may, in the future, need to pass in the GPUDevice in order to - // incorporate the clip and matrix state into the key - static SkPicture::AccelData::Key ComputeKey(); - private: SkTArray<BlockInfo, true> fBlocks; - typedef SkPicture::AccelData INHERITED; + typedef SkBigPicture::AccelData INHERITED; }; #endif // SkLayerInfo_DEFINED |