3d view system!
True 3d transformations are now supported by DisplayLists and the
renderer, initially with the translationZ property on view.
Renderer operations used directly by DisplayList (formerly,
clip/save/restore/saveLayer) are now more simply managed by allocating
them temporarily on the handler's allocator, which exists for a single
frame. This is much simpler than continuing to expand the pool of
pre-allocated DisplayListOps now that more operations are called
directly by DisplayList, especially with z ordered drawing.
Still TODO:
-APIs for camera positioning, shadows
-Make Z apis public, and expose through XML
-Make invalidation / input 3d aware
Change-Id: I95fe6fa03f9b6ddd34a7e0c6ec8dd9fe47c6c6eb
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index cfc5931..185e247 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -265,6 +265,12 @@
ANDROID_API void getMatrix(SkMatrix* matrix);
virtual void setMatrix(SkMatrix* matrix);
virtual void concatMatrix(SkMatrix* matrix);
+ virtual void concatMatrix(Matrix4& matrix) {
+ currentTransform().multiply(matrix);
+ }
+ void translateZ(float z) {
+ currentTransform().translate(0,0,z);
+ }
ANDROID_API const Rect& getClipBounds();
@@ -315,6 +321,9 @@
DrawOpMode drawOpMode = kDrawOpMode_Immediate);
virtual status_t drawRects(const float* rects, int count, SkPaint* paint);
+ status_t drawShadow(const mat4& casterTransform, float casterAlpha,
+ float width, float height);
+
virtual void resetShader();
virtual void setupShader(SkiaShader* shader);
@@ -1070,8 +1079,8 @@
// Dimensions of the drawing surface
int mWidth, mHeight;
- // Matrix used for ortho projection in shaders
- mat4 mOrthoMatrix;
+ // Matrix used for view/projection in shaders
+ mat4 mViewProjMatrix;
/**
* Model-view matrix used to position/size objects