Initial commit of new Canvas operation recording / replay
Done:
- drawRect, drawBitmap, drawColor, drawPaint, drawRenderNode, drawRegion
- Recording with new DisplayList format
- batching & reordering
- Stateless op reorder
- Stateless op rendering
- Frame lifecycle (clear, geterror, cleanup)
Not done:
- SaveLayer (clipped and unclipped)
- HW layers
- Complex clipping
- Ripple projection
- Z reordering
- Z shadows
- onDefer prefetching (text + task kickoff)
- round rect clip
- linear allocation for std collections
- AssetAtlas support
Change-Id: Iaf98c1a3aeab5fa47cc8f9c6d964420abc0e7691
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index 0bdb816..8ba9ac3 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -55,11 +55,12 @@
class Rect;
class Layer;
-class ClipRectOp;
-class SaveLayerOp;
-class SaveOp;
-class RestoreToCountOp;
+#if HWUI_NEW_OPS
+struct RecordedOp;
+struct RenderNodeOp;
+#else
class DrawRenderNodeOp;
+#endif
/**
* Holds data used in the playback a tree of DisplayLists.
@@ -107,6 +108,7 @@
*/
class DisplayListData {
friend class DisplayListCanvas;
+ friend class RecordingCanvas;
public:
struct Chunk {
// range of included ops in DLD::displayListOps
@@ -139,11 +141,21 @@
Vector<Functor*> functors;
const std::vector<Chunk>& getChunks() const {
- return chunks;
+ return chunks;
}
+#if HWUI_NEW_OPS
+ const std::vector<RecordedOp*>& getOps() const {
+ return ops;
+ }
+#endif
+#if HWUI_NEW_OPS
+ size_t addChild(RenderNodeOp* childOp);
+ const std::vector<RenderNodeOp*>& children() { return mChildren; }
+#else
size_t addChild(DrawRenderNodeOp* childOp);
const std::vector<DrawRenderNodeOp*>& children() { return mChildren; }
+#endif
void ref(VirtualLightRefBase* prop) {
mReferenceHolders.push_back(prop);
@@ -157,10 +169,18 @@
}
private:
+#if HWUI_NEW_OPS
+ std::vector<RecordedOp*> ops;
+#endif
+
std::vector< sp<VirtualLightRefBase> > mReferenceHolders;
+#if HWUI_NEW_OPS
+ std::vector<RenderNodeOp*> mChildren;
+#else
// list of children display lists for quick, non-drawing traversal
std::vector<DrawRenderNodeOp*> mChildren;
+#endif
std::vector<Chunk> chunks;