Better backend for hardware layers.
With this new backend, a hardware layer is only recreated when
its associated view is udpated. This offers fast composition
in GL and fast update of the layer in GL as well.
Change-Id: I97c43a612f5955c6bf1c192c8ca4af10fdf1d076
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index afb82bf..fdb4e8c 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -241,6 +241,11 @@
renderer.drawDisplayList(getDisplayList());
}
break;
+ case DrawLayer: {
+ renderer.drawLayer(getInt(), getFloat(), getFloat(), getFloat(), getFloat(),
+ getFloat(), getFloat(), getPaint());
+ }
+ break;
case DrawBitmap: {
renderer.drawBitmap(getBitmap(), getFloat(), getFloat(), getPaint());
}
@@ -483,6 +488,16 @@
addDisplayList(displayList);
}
+void DisplayListRenderer::drawLayer(int texture, float left, float top, float right, float bottom,
+ float u, float v, SkPaint* paint) {
+ addOp(DisplayList::DrawLayer);
+ addInt(texture);
+ addBounds(left, top, right, bottom);
+ addFloat(u);
+ addFloat(v);
+ addPaint(paint);
+}
+
void DisplayListRenderer::drawBitmap(SkBitmap* bitmap, float left, float top,
SkPaint* paint) {
addOp(DisplayList::DrawBitmap);