aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLayerInfo.h
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2015-05-07 17:30:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-07 17:30:13 -0700
commitb7ed856fadae52401d3bbcac22cfc3391780ace8 (patch)
treedfea1030ca7eb63ea58f1e733cf741c89273d4df /src/core/SkLayerInfo.h
parent8b26b99c97473f020df4b9d4ba789e074e06cedd (diff)
Revert of Sketch splitting SkPicture into an interface and SkBigPicture. (patchset #22 id:420001 of https://codereview.chromium.org/1112523006/)
Reason for revert: speculative revert to fix failures in DEPS roll Original issue's description: > 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: > > Committed: https://skia.googlesource.com/skia/+/c92c129ff85b05a714bd1bf921c02d5e14651f8b TBR=reed@google.com,robertphillips@google.com,mtklein@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1130333002
Diffstat (limited to 'src/core/SkLayerInfo.h')
-rw-r--r--src/core/SkLayerInfo.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/SkLayerInfo.h b/src/core/SkLayerInfo.h
index 3d4b26960c..a47c3f1199 100644
--- a/src/core/SkLayerInfo.h
+++ b/src/core/SkLayerInfo.h
@@ -8,12 +8,12 @@
#ifndef SkLayerInfo_DEFINED
#define SkLayerInfo_DEFINED
-#include "SkBigPicture.h"
+#include "SkPicture.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 SkBigPicture::AccelData {
+class SkLayerInfo : public SkPicture::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() {}
+ SkLayerInfo(Key key) : INHERITED(key) { }
BlockInfo& addBlock() { return fBlocks.push_back(); }
@@ -72,10 +72,14 @@ 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 SkBigPicture::AccelData INHERITED;
+ typedef SkPicture::AccelData INHERITED;
};
#endif // SkLayerInfo_DEFINED