diff options
Diffstat (limited to 'libs/hwui/RenderProperties.h')
-rw-r--r-- | libs/hwui/RenderProperties.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h index 8fc2dd0..6fc8bce 100644 --- a/libs/hwui/RenderProperties.h +++ b/libs/hwui/RenderProperties.h @@ -16,7 +16,9 @@ #ifndef RENDERNODEPROPERTIES_H #define RENDERNODEPROPERTIES_H +#include <algorithm> #include <stddef.h> +#include <vector> #include <cutils/compiler.h> #include <androidfw/ResourceTypes.h> @@ -24,6 +26,7 @@ #include <SkMatrix.h> #include <SkRegion.h> +#include "Animator.h" #include "Rect.h" #include "RevealClip.h" #include "Outline.h" @@ -149,6 +152,31 @@ public: return mPrimitiveFields.mTranslationZ; } + // Animation helper + void setX(float value) { + setTranslationX(value - getLeft()); + } + + // Animation helper + float getX() const { + return getLeft() + getTranslationX(); + } + + // Animation helper + void setY(float value) { + setTranslationY(value - getTop()); + } + + // Animation helper + float getY() const { + return getTop() + getTranslationY(); + } + + // Animation helper + void setZ(float value) { + setTranslationZ(value - getElevation()); + } + float getZ() const { return getElevation() + getTranslationZ(); } @@ -457,7 +485,6 @@ private: bool mCaching; } mPrimitiveFields; - // mCameraDistance isn't in mPrimitiveFields as it has a complex setter SkMatrix* mStaticMatrix; SkMatrix* mAnimationMatrix; |