Have all the setters return changed
Change-Id: Ie5e755058a7094bb0c2fce60ec3cef47c23823ce
This commit is contained in:
@@ -325,8 +325,8 @@ public class RenderNode {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public void setCaching(boolean caching) {
|
||||
nSetCaching(mNativeRenderNode, caching);
|
||||
public boolean setCaching(boolean caching) {
|
||||
return nSetCaching(mNativeRenderNode, caching);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -335,8 +335,8 @@ public class RenderNode {
|
||||
*
|
||||
* @param clipToBounds true if the display list should clip to its bounds
|
||||
*/
|
||||
public void setClipToBounds(boolean clipToBounds) {
|
||||
nSetClipToBounds(mNativeRenderNode, clipToBounds);
|
||||
public boolean setClipToBounds(boolean clipToBounds) {
|
||||
return nSetClipToBounds(mNativeRenderNode, clipToBounds);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -346,8 +346,8 @@ public class RenderNode {
|
||||
* @param shouldProject true if the display list should be projected onto a
|
||||
* containing volume.
|
||||
*/
|
||||
public void setProjectBackwards(boolean shouldProject) {
|
||||
nSetProjectBackwards(mNativeRenderNode, shouldProject);
|
||||
public boolean setProjectBackwards(boolean shouldProject) {
|
||||
return nSetProjectBackwards(mNativeRenderNode, shouldProject);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -355,8 +355,8 @@ public class RenderNode {
|
||||
* DisplayList should draw any descendent DisplayLists with
|
||||
* ProjectBackwards=true directly on top of it. Default value is false.
|
||||
*/
|
||||
public void setProjectionReceiver(boolean shouldRecieve) {
|
||||
nSetProjectionReceiver(mNativeRenderNode, shouldRecieve);
|
||||
public boolean setProjectionReceiver(boolean shouldRecieve) {
|
||||
return nSetProjectionReceiver(mNativeRenderNode, shouldRecieve);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -365,15 +365,16 @@ public class RenderNode {
|
||||
*
|
||||
* Deep copies the data into native to simplify reference ownership.
|
||||
*/
|
||||
public void setOutline(Outline outline) {
|
||||
public boolean setOutline(Outline outline) {
|
||||
if (outline == null || outline.isEmpty()) {
|
||||
nSetOutlineEmpty(mNativeRenderNode);
|
||||
return nSetOutlineEmpty(mNativeRenderNode);
|
||||
} else if (outline.mRect != null) {
|
||||
nSetOutlineRoundRect(mNativeRenderNode, outline.mRect.left, outline.mRect.top,
|
||||
return nSetOutlineRoundRect(mNativeRenderNode, outline.mRect.left, outline.mRect.top,
|
||||
outline.mRect.right, outline.mRect.bottom, outline.mRadius);
|
||||
} else if (outline.mPath != null) {
|
||||
nSetOutlineConvexPath(mNativeRenderNode, outline.mPath.mNativePath);
|
||||
return nSetOutlineConvexPath(mNativeRenderNode, outline.mPath.mNativePath);
|
||||
}
|
||||
throw new IllegalArgumentException("Unrecognized outline?");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -381,8 +382,8 @@ public class RenderNode {
|
||||
*
|
||||
* @param clipToOutline true if clipping to the outline.
|
||||
*/
|
||||
public void setClipToOutline(boolean clipToOutline) {
|
||||
nSetClipToOutline(mNativeRenderNode, clipToOutline);
|
||||
public boolean setClipToOutline(boolean clipToOutline) {
|
||||
return nSetClipToOutline(mNativeRenderNode, clipToOutline);
|
||||
}
|
||||
|
||||
public boolean getClipToOutline() {
|
||||
@@ -392,9 +393,9 @@ public class RenderNode {
|
||||
/**
|
||||
* Controls the RenderNode's circular reveal clip.
|
||||
*/
|
||||
public void setRevealClip(boolean shouldClip, boolean inverseClip,
|
||||
public boolean setRevealClip(boolean shouldClip, boolean inverseClip,
|
||||
float x, float y, float radius) {
|
||||
nSetRevealClip(mNativeRenderNode, shouldClip, inverseClip, x, y, radius);
|
||||
return nSetRevealClip(mNativeRenderNode, shouldClip, inverseClip, x, y, radius);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,8 +404,8 @@ public class RenderNode {
|
||||
*
|
||||
* @param matrix A transform matrix to apply to this display list
|
||||
*/
|
||||
public void setStaticMatrix(Matrix matrix) {
|
||||
nSetStaticMatrix(mNativeRenderNode, matrix.native_instance);
|
||||
public boolean setStaticMatrix(Matrix matrix) {
|
||||
return nSetStaticMatrix(mNativeRenderNode, matrix.native_instance);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -417,8 +418,8 @@ public class RenderNode {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public void setAnimationMatrix(Matrix matrix) {
|
||||
nSetAnimationMatrix(mNativeRenderNode,
|
||||
public boolean setAnimationMatrix(Matrix matrix) {
|
||||
return nSetAnimationMatrix(mNativeRenderNode,
|
||||
(matrix != null) ? matrix.native_instance : 0);
|
||||
}
|
||||
|
||||
@@ -430,8 +431,8 @@ public class RenderNode {
|
||||
* @see View#setAlpha(float)
|
||||
* @see #getAlpha()
|
||||
*/
|
||||
public void setAlpha(float alpha) {
|
||||
nSetAlpha(mNativeRenderNode, alpha);
|
||||
public boolean setAlpha(float alpha) {
|
||||
return nSetAlpha(mNativeRenderNode, alpha);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,8 +457,8 @@ public class RenderNode {
|
||||
* @see android.view.View#hasOverlappingRendering()
|
||||
* @see #hasOverlappingRendering()
|
||||
*/
|
||||
public void setHasOverlappingRendering(boolean hasOverlappingRendering) {
|
||||
nSetHasOverlappingRendering(mNativeRenderNode, hasOverlappingRendering);
|
||||
public boolean setHasOverlappingRendering(boolean hasOverlappingRendering) {
|
||||
return nSetHasOverlappingRendering(mNativeRenderNode, hasOverlappingRendering);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -472,8 +473,8 @@ public class RenderNode {
|
||||
return nHasOverlappingRendering(mNativeRenderNode);
|
||||
}
|
||||
|
||||
public void setElevation(float lift) {
|
||||
nSetElevation(mNativeRenderNode, lift);
|
||||
public boolean setElevation(float lift) {
|
||||
return nSetElevation(mNativeRenderNode, lift);
|
||||
}
|
||||
|
||||
public float getElevation() {
|
||||
@@ -488,8 +489,8 @@ public class RenderNode {
|
||||
* @see View#setTranslationX(float)
|
||||
* @see #getTranslationX()
|
||||
*/
|
||||
public void setTranslationX(float translationX) {
|
||||
nSetTranslationX(mNativeRenderNode, translationX);
|
||||
public boolean setTranslationX(float translationX) {
|
||||
return nSetTranslationX(mNativeRenderNode, translationX);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -509,8 +510,8 @@ public class RenderNode {
|
||||
* @see View#setTranslationY(float)
|
||||
* @see #getTranslationY()
|
||||
*/
|
||||
public void setTranslationY(float translationY) {
|
||||
nSetTranslationY(mNativeRenderNode, translationY);
|
||||
public boolean setTranslationY(float translationY) {
|
||||
return nSetTranslationY(mNativeRenderNode, translationY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -528,8 +529,8 @@ public class RenderNode {
|
||||
* @see View#setTranslationZ(float)
|
||||
* @see #getTranslationZ()
|
||||
*/
|
||||
public void setTranslationZ(float translationZ) {
|
||||
nSetTranslationZ(mNativeRenderNode, translationZ);
|
||||
public boolean setTranslationZ(float translationZ) {
|
||||
return nSetTranslationZ(mNativeRenderNode, translationZ);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -549,8 +550,8 @@ public class RenderNode {
|
||||
* @see View#setRotation(float)
|
||||
* @see #getRotation()
|
||||
*/
|
||||
public void setRotation(float rotation) {
|
||||
nSetRotation(mNativeRenderNode, rotation);
|
||||
public boolean setRotation(float rotation) {
|
||||
return nSetRotation(mNativeRenderNode, rotation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -570,8 +571,8 @@ public class RenderNode {
|
||||
* @see View#setRotationX(float)
|
||||
* @see #getRotationX()
|
||||
*/
|
||||
public void setRotationX(float rotationX) {
|
||||
nSetRotationX(mNativeRenderNode, rotationX);
|
||||
public boolean setRotationX(float rotationX) {
|
||||
return nSetRotationX(mNativeRenderNode, rotationX);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -591,8 +592,8 @@ public class RenderNode {
|
||||
* @see View#setRotationY(float)
|
||||
* @see #getRotationY()
|
||||
*/
|
||||
public void setRotationY(float rotationY) {
|
||||
nSetRotationY(mNativeRenderNode, rotationY);
|
||||
public boolean setRotationY(float rotationY) {
|
||||
return nSetRotationY(mNativeRenderNode, rotationY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -612,8 +613,8 @@ public class RenderNode {
|
||||
* @see View#setScaleX(float)
|
||||
* @see #getScaleX()
|
||||
*/
|
||||
public void setScaleX(float scaleX) {
|
||||
nSetScaleX(mNativeRenderNode, scaleX);
|
||||
public boolean setScaleX(float scaleX) {
|
||||
return nSetScaleX(mNativeRenderNode, scaleX);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -633,8 +634,8 @@ public class RenderNode {
|
||||
* @see View#setScaleY(float)
|
||||
* @see #getScaleY()
|
||||
*/
|
||||
public void setScaleY(float scaleY) {
|
||||
nSetScaleY(mNativeRenderNode, scaleY);
|
||||
public boolean setScaleY(float scaleY) {
|
||||
return nSetScaleY(mNativeRenderNode, scaleY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -654,8 +655,8 @@ public class RenderNode {
|
||||
* @see View#setPivotX(float)
|
||||
* @see #getPivotX()
|
||||
*/
|
||||
public void setPivotX(float pivotX) {
|
||||
nSetPivotX(mNativeRenderNode, pivotX);
|
||||
public boolean setPivotX(float pivotX) {
|
||||
return nSetPivotX(mNativeRenderNode, pivotX);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -675,8 +676,8 @@ public class RenderNode {
|
||||
* @see View#setPivotY(float)
|
||||
* @see #getPivotY()
|
||||
*/
|
||||
public void setPivotY(float pivotY) {
|
||||
nSetPivotY(mNativeRenderNode, pivotY);
|
||||
public boolean setPivotY(float pivotY) {
|
||||
return nSetPivotY(mNativeRenderNode, pivotY);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -702,8 +703,8 @@ public class RenderNode {
|
||||
* @see View#setCameraDistance(float)
|
||||
* @see #getCameraDistance()
|
||||
*/
|
||||
public void setCameraDistance(float distance) {
|
||||
nSetCameraDistance(mNativeRenderNode, distance);
|
||||
public boolean setCameraDistance(float distance) {
|
||||
return nSetCameraDistance(mNativeRenderNode, distance);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -723,8 +724,8 @@ public class RenderNode {
|
||||
* @see View#setLeft(int)
|
||||
* @see #getLeft()
|
||||
*/
|
||||
public void setLeft(int left) {
|
||||
nSetLeft(mNativeRenderNode, left);
|
||||
public boolean setLeft(int left) {
|
||||
return nSetLeft(mNativeRenderNode, left);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -744,8 +745,8 @@ public class RenderNode {
|
||||
* @see View#setTop(int)
|
||||
* @see #getTop()
|
||||
*/
|
||||
public void setTop(int top) {
|
||||
nSetTop(mNativeRenderNode, top);
|
||||
public boolean setTop(int top) {
|
||||
return nSetTop(mNativeRenderNode, top);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -765,8 +766,8 @@ public class RenderNode {
|
||||
* @see View#setRight(int)
|
||||
* @see #getRight()
|
||||
*/
|
||||
public void setRight(int right) {
|
||||
nSetRight(mNativeRenderNode, right);
|
||||
public boolean setRight(int right) {
|
||||
return nSetRight(mNativeRenderNode, right);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -786,8 +787,8 @@ public class RenderNode {
|
||||
* @see View#setBottom(int)
|
||||
* @see #getBottom()
|
||||
*/
|
||||
public void setBottom(int bottom) {
|
||||
nSetBottom(mNativeRenderNode, bottom);
|
||||
public boolean setBottom(int bottom) {
|
||||
return nSetBottom(mNativeRenderNode, bottom);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -812,8 +813,8 @@ public class RenderNode {
|
||||
* @see View#setRight(int)
|
||||
* @see View#setBottom(int)
|
||||
*/
|
||||
public void setLeftTopRightBottom(int left, int top, int right, int bottom) {
|
||||
nSetLeftTopRightBottom(mNativeRenderNode, left, top, right, bottom);
|
||||
public boolean setLeftTopRightBottom(int left, int top, int right, int bottom) {
|
||||
return nSetLeftTopRightBottom(mNativeRenderNode, left, top, right, bottom);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -824,8 +825,8 @@ public class RenderNode {
|
||||
*
|
||||
* @see View#offsetLeftAndRight(int)
|
||||
*/
|
||||
public void offsetLeftAndRight(float offset) {
|
||||
nOffsetLeftAndRight(mNativeRenderNode, offset);
|
||||
public boolean offsetLeftAndRight(float offset) {
|
||||
return nOffsetLeftAndRight(mNativeRenderNode, offset);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -836,8 +837,8 @@ public class RenderNode {
|
||||
*
|
||||
* @see View#offsetTopAndBottom(int)
|
||||
*/
|
||||
public void offsetTopAndBottom(float offset) {
|
||||
nOffsetTopAndBottom(mNativeRenderNode, offset);
|
||||
public boolean offsetTopAndBottom(float offset) {
|
||||
return nOffsetTopAndBottom(mNativeRenderNode, offset);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -890,42 +891,42 @@ public class RenderNode {
|
||||
|
||||
// Properties
|
||||
|
||||
private static native void nOffsetTopAndBottom(long renderNode, float offset);
|
||||
private static native void nOffsetLeftAndRight(long renderNode, float offset);
|
||||
private static native void nSetLeftTopRightBottom(long renderNode, int left, int top,
|
||||
private static native boolean nOffsetTopAndBottom(long renderNode, float offset);
|
||||
private static native boolean nOffsetLeftAndRight(long renderNode, float offset);
|
||||
private static native boolean nSetLeftTopRightBottom(long renderNode, int left, int top,
|
||||
int right, int bottom);
|
||||
private static native void nSetBottom(long renderNode, int bottom);
|
||||
private static native void nSetRight(long renderNode, int right);
|
||||
private static native void nSetTop(long renderNode, int top);
|
||||
private static native void nSetLeft(long renderNode, int left);
|
||||
private static native void nSetCameraDistance(long renderNode, float distance);
|
||||
private static native void nSetPivotY(long renderNode, float pivotY);
|
||||
private static native void nSetPivotX(long renderNode, float pivotX);
|
||||
private static native void nSetCaching(long renderNode, boolean caching);
|
||||
private static native void nSetClipToBounds(long renderNode, boolean clipToBounds);
|
||||
private static native void nSetProjectBackwards(long renderNode, boolean shouldProject);
|
||||
private static native void nSetProjectionReceiver(long renderNode, boolean shouldRecieve);
|
||||
private static native void nSetOutlineRoundRect(long renderNode, int left, int top,
|
||||
private static native boolean nSetBottom(long renderNode, int bottom);
|
||||
private static native boolean nSetRight(long renderNode, int right);
|
||||
private static native boolean nSetTop(long renderNode, int top);
|
||||
private static native boolean nSetLeft(long renderNode, int left);
|
||||
private static native boolean nSetCameraDistance(long renderNode, float distance);
|
||||
private static native boolean nSetPivotY(long renderNode, float pivotY);
|
||||
private static native boolean nSetPivotX(long renderNode, float pivotX);
|
||||
private static native boolean nSetCaching(long renderNode, boolean caching);
|
||||
private static native boolean nSetClipToBounds(long renderNode, boolean clipToBounds);
|
||||
private static native boolean nSetProjectBackwards(long renderNode, boolean shouldProject);
|
||||
private static native boolean nSetProjectionReceiver(long renderNode, boolean shouldRecieve);
|
||||
private static native boolean nSetOutlineRoundRect(long renderNode, int left, int top,
|
||||
int right, int bottom, float radius);
|
||||
private static native void nSetOutlineConvexPath(long renderNode, long nativePath);
|
||||
private static native void nSetOutlineEmpty(long renderNode);
|
||||
private static native void nSetClipToOutline(long renderNode, boolean clipToOutline);
|
||||
private static native void nSetRevealClip(long renderNode,
|
||||
private static native boolean nSetOutlineConvexPath(long renderNode, long nativePath);
|
||||
private static native boolean nSetOutlineEmpty(long renderNode);
|
||||
private static native boolean nSetClipToOutline(long renderNode, boolean clipToOutline);
|
||||
private static native boolean nSetRevealClip(long renderNode,
|
||||
boolean shouldClip, boolean inverseClip, float x, float y, float radius);
|
||||
private static native void nSetAlpha(long renderNode, float alpha);
|
||||
private static native void nSetHasOverlappingRendering(long renderNode,
|
||||
private static native boolean nSetAlpha(long renderNode, float alpha);
|
||||
private static native boolean nSetHasOverlappingRendering(long renderNode,
|
||||
boolean hasOverlappingRendering);
|
||||
private static native void nSetElevation(long renderNode, float lift);
|
||||
private static native void nSetTranslationX(long renderNode, float translationX);
|
||||
private static native void nSetTranslationY(long renderNode, float translationY);
|
||||
private static native void nSetTranslationZ(long renderNode, float translationZ);
|
||||
private static native void nSetRotation(long renderNode, float rotation);
|
||||
private static native void nSetRotationX(long renderNode, float rotationX);
|
||||
private static native void nSetRotationY(long renderNode, float rotationY);
|
||||
private static native void nSetScaleX(long renderNode, float scaleX);
|
||||
private static native void nSetScaleY(long renderNode, float scaleY);
|
||||
private static native void nSetStaticMatrix(long renderNode, long nativeMatrix);
|
||||
private static native void nSetAnimationMatrix(long renderNode, long animationMatrix);
|
||||
private static native boolean nSetElevation(long renderNode, float lift);
|
||||
private static native boolean nSetTranslationX(long renderNode, float translationX);
|
||||
private static native boolean nSetTranslationY(long renderNode, float translationY);
|
||||
private static native boolean nSetTranslationZ(long renderNode, float translationZ);
|
||||
private static native boolean nSetRotation(long renderNode, float rotation);
|
||||
private static native boolean nSetRotationX(long renderNode, float rotationX);
|
||||
private static native boolean nSetRotationY(long renderNode, float rotationY);
|
||||
private static native boolean nSetScaleX(long renderNode, float scaleX);
|
||||
private static native boolean nSetScaleY(long renderNode, float scaleY);
|
||||
private static native boolean nSetStaticMatrix(long renderNode, long nativeMatrix);
|
||||
private static native boolean nSetAnimationMatrix(long renderNode, long animationMatrix);
|
||||
|
||||
private static native boolean nHasOverlappingRendering(long renderNode);
|
||||
private static native boolean nGetClipToOutline(long renderNode);
|
||||
|
||||
@@ -38,6 +38,11 @@ using namespace uirenderer;
|
||||
*/
|
||||
#ifdef USE_OPENGL_RENDERER
|
||||
|
||||
#define SET_AND_DIRTY(prop, val, dirtyFlag) \
|
||||
(reinterpret_cast<RenderNode*>(renderNodePtr)->mutateStagingProperties().prop(val) \
|
||||
? (reinterpret_cast<RenderNode*>(renderNodePtr)->setPropertyFieldsDirty(dirtyFlag), true) \
|
||||
: false)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// DisplayList view properties
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -82,235 +87,192 @@ static void android_view_RenderNode_setDisplayListData(JNIEnv* env,
|
||||
// RenderProperties - setters
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static void android_view_RenderNode_setCaching(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setCaching(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, jboolean caching) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setCaching(caching);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return SET_AND_DIRTY(setCaching, caching, RenderNode::GENERIC);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setStaticMatrix(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setStaticMatrix(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, jlong matrixPtr) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
SkMatrix* matrix = reinterpret_cast<SkMatrix*>(matrixPtr);
|
||||
renderNode->mutateStagingProperties().setStaticMatrix(matrix);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return SET_AND_DIRTY(setStaticMatrix, matrix, RenderNode::GENERIC);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setAnimationMatrix(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setAnimationMatrix(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, jlong matrixPtr) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
SkMatrix* matrix = reinterpret_cast<SkMatrix*>(matrixPtr);
|
||||
renderNode->mutateStagingProperties().setAnimationMatrix(matrix);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return SET_AND_DIRTY(setAnimationMatrix, matrix, RenderNode::GENERIC);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setClipToBounds(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setClipToBounds(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, jboolean clipToBounds) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setClipToBounds(clipToBounds);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return SET_AND_DIRTY(setClipToBounds, clipToBounds, RenderNode::GENERIC);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setProjectBackwards(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setProjectBackwards(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, jboolean shouldProject) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setProjectBackwards(shouldProject);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return SET_AND_DIRTY(setProjectBackwards, shouldProject, RenderNode::GENERIC);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setProjectionReceiver(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setProjectionReceiver(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, jboolean shouldRecieve) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setProjectionReceiver(shouldRecieve);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return SET_AND_DIRTY(setProjectionReceiver, shouldRecieve, RenderNode::GENERIC);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setOutlineRoundRect(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setOutlineRoundRect(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, jint left, jint top,
|
||||
jint right, jint bottom, jfloat radius) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().mutableOutline().setRoundRect(left, top, right, bottom, radius);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setOutlineConvexPath(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setOutlineConvexPath(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, jlong outlinePathPtr) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
SkPath* outlinePath = reinterpret_cast<SkPath*>(outlinePathPtr);
|
||||
renderNode->mutateStagingProperties().mutableOutline().setConvexPath(outlinePath);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setOutlineEmpty(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setOutlineEmpty(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().mutableOutline().setEmpty();
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setClipToOutline(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setClipToOutline(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, jboolean clipToOutline) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().mutableOutline().setShouldClip(clipToOutline);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setRevealClip(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setRevealClip(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, jboolean shouldClip, jboolean inverseClip,
|
||||
jfloat x, jfloat y, jfloat radius) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().mutableRevealClip().set(
|
||||
shouldClip, inverseClip, x, y, radius);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setAlpha(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setAlpha(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float alpha) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setAlpha(alpha);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::ALPHA);
|
||||
return SET_AND_DIRTY(setAlpha, alpha, RenderNode::ALPHA);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setHasOverlappingRendering(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setHasOverlappingRendering(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, bool hasOverlappingRendering) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setHasOverlappingRendering(hasOverlappingRendering);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return SET_AND_DIRTY(setHasOverlappingRendering, hasOverlappingRendering,
|
||||
RenderNode::GENERIC);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setElevation(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setElevation(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float elevation) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setElevation(elevation);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::Z);
|
||||
return SET_AND_DIRTY(setElevation, elevation, RenderNode::Z);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setTranslationX(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setTranslationX(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float tx) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setTranslationX(tx);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::TRANSLATION_X | RenderNode::X);
|
||||
return SET_AND_DIRTY(setTranslationX, tx, RenderNode::TRANSLATION_X | RenderNode::X);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setTranslationY(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setTranslationY(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float ty) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setTranslationY(ty);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::TRANSLATION_Y | RenderNode::Y);
|
||||
return SET_AND_DIRTY(setTranslationY, ty, RenderNode::TRANSLATION_Y | RenderNode::Y);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setTranslationZ(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setTranslationZ(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float tz) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setTranslationZ(tz);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::TRANSLATION_Z | RenderNode::Z);
|
||||
return SET_AND_DIRTY(setTranslationZ, tz, RenderNode::TRANSLATION_Z | RenderNode::Z);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setRotation(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setRotation(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float rotation) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setRotation(rotation);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::ROTATION);
|
||||
return SET_AND_DIRTY(setRotation, rotation, RenderNode::ROTATION);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setRotationX(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setRotationX(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float rx) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setRotationX(rx);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::ROTATION_X);
|
||||
return SET_AND_DIRTY(setRotationX, rx, RenderNode::ROTATION_X);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setRotationY(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setRotationY(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float ry) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setRotationY(ry);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::ROTATION_Y);
|
||||
return SET_AND_DIRTY(setRotationY, ry, RenderNode::ROTATION_Y);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setScaleX(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setScaleX(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float sx) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setScaleX(sx);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::SCALE_X);
|
||||
return SET_AND_DIRTY(setScaleX, sx, RenderNode::SCALE_X);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setScaleY(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setScaleY(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float sy) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setScaleY(sy);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::SCALE_Y);
|
||||
return SET_AND_DIRTY(setScaleY, sy, RenderNode::SCALE_Y);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setPivotX(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setPivotX(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float px) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setPivotX(px);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return SET_AND_DIRTY(setPivotX, px, RenderNode::GENERIC);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setPivotY(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setPivotY(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float py) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setPivotY(py);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return SET_AND_DIRTY(setPivotY, py, RenderNode::GENERIC);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setCameraDistance(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setCameraDistance(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float distance) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setCameraDistance(distance);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::GENERIC);
|
||||
return SET_AND_DIRTY(setCameraDistance, distance, RenderNode::GENERIC);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setLeft(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setLeft(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, int left) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setLeft(left);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::X);
|
||||
return SET_AND_DIRTY(setLeft, left, RenderNode::X);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setTop(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setTop(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, int top) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setTop(top);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::Y);
|
||||
return SET_AND_DIRTY(setTop, top, RenderNode::Y);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setRight(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setRight(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, int right) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setRight(right);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::X);
|
||||
return SET_AND_DIRTY(setRight, right, RenderNode::X);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setBottom(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setBottom(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, int bottom) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setBottom(bottom);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::Y);
|
||||
return SET_AND_DIRTY(setBottom, bottom, RenderNode::Y);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_setLeftTopRightBottom(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_setLeftTopRightBottom(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, int left, int top,
|
||||
int right, int bottom) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().setLeftTopRightBottom(left, top, right, bottom);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::X | RenderNode::Y);
|
||||
if (renderNode->mutateStagingProperties().setLeftTopRightBottom(left, top, right, bottom)) {
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::X | RenderNode::Y);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_offsetLeftAndRight(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_offsetLeftAndRight(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float offset) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().offsetLeftRight(offset);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::X);
|
||||
return SET_AND_DIRTY(offsetLeftRight, offset, RenderNode::X);
|
||||
}
|
||||
|
||||
static void android_view_RenderNode_offsetTopAndBottom(JNIEnv* env,
|
||||
static jboolean android_view_RenderNode_offsetTopAndBottom(JNIEnv* env,
|
||||
jobject clazz, jlong renderNodePtr, float offset) {
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
renderNode->mutateStagingProperties().offsetTopBottom(offset);
|
||||
renderNode->setPropertyFieldsDirty(RenderNode::Y);
|
||||
return SET_AND_DIRTY(offsetTopBottom, offset, RenderNode::Y);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -513,41 +475,41 @@ static JNINativeMethod gMethods[] = {
|
||||
{ "nOutput", "(J)V", (void*) android_view_RenderNode_output },
|
||||
{ "nGetDebugSize", "(J)I", (void*) android_view_RenderNode_getDebugSize },
|
||||
|
||||
{ "nSetCaching", "(JZ)V", (void*) android_view_RenderNode_setCaching },
|
||||
{ "nSetStaticMatrix", "(JJ)V", (void*) android_view_RenderNode_setStaticMatrix },
|
||||
{ "nSetAnimationMatrix", "(JJ)V", (void*) android_view_RenderNode_setAnimationMatrix },
|
||||
{ "nSetClipToBounds", "(JZ)V", (void*) android_view_RenderNode_setClipToBounds },
|
||||
{ "nSetProjectBackwards", "(JZ)V", (void*) android_view_RenderNode_setProjectBackwards },
|
||||
{ "nSetProjectionReceiver","(JZ)V", (void*) android_view_RenderNode_setProjectionReceiver },
|
||||
{ "nSetCaching", "(JZ)Z", (void*) android_view_RenderNode_setCaching },
|
||||
{ "nSetStaticMatrix", "(JJ)Z", (void*) android_view_RenderNode_setStaticMatrix },
|
||||
{ "nSetAnimationMatrix", "(JJ)Z", (void*) android_view_RenderNode_setAnimationMatrix },
|
||||
{ "nSetClipToBounds", "(JZ)Z", (void*) android_view_RenderNode_setClipToBounds },
|
||||
{ "nSetProjectBackwards", "(JZ)Z", (void*) android_view_RenderNode_setProjectBackwards },
|
||||
{ "nSetProjectionReceiver","(JZ)Z", (void*) android_view_RenderNode_setProjectionReceiver },
|
||||
|
||||
{ "nSetOutlineRoundRect", "(JIIIIF)V", (void*) android_view_RenderNode_setOutlineRoundRect },
|
||||
{ "nSetOutlineConvexPath", "(JJ)V", (void*) android_view_RenderNode_setOutlineConvexPath },
|
||||
{ "nSetOutlineEmpty", "(J)V", (void*) android_view_RenderNode_setOutlineEmpty },
|
||||
{ "nSetClipToOutline", "(JZ)V", (void*) android_view_RenderNode_setClipToOutline },
|
||||
{ "nSetRevealClip", "(JZZFFF)V", (void*) android_view_RenderNode_setRevealClip },
|
||||
{ "nSetOutlineRoundRect", "(JIIIIF)Z", (void*) android_view_RenderNode_setOutlineRoundRect },
|
||||
{ "nSetOutlineConvexPath", "(JJ)Z", (void*) android_view_RenderNode_setOutlineConvexPath },
|
||||
{ "nSetOutlineEmpty", "(J)Z", (void*) android_view_RenderNode_setOutlineEmpty },
|
||||
{ "nSetClipToOutline", "(JZ)Z", (void*) android_view_RenderNode_setClipToOutline },
|
||||
{ "nSetRevealClip", "(JZZFFF)Z", (void*) android_view_RenderNode_setRevealClip },
|
||||
|
||||
{ "nSetAlpha", "(JF)V", (void*) android_view_RenderNode_setAlpha },
|
||||
{ "nSetHasOverlappingRendering", "(JZ)V",
|
||||
{ "nSetAlpha", "(JF)Z", (void*) android_view_RenderNode_setAlpha },
|
||||
{ "nSetHasOverlappingRendering", "(JZ)Z",
|
||||
(void*) android_view_RenderNode_setHasOverlappingRendering },
|
||||
{ "nSetElevation", "(JF)V", (void*) android_view_RenderNode_setElevation },
|
||||
{ "nSetTranslationX", "(JF)V", (void*) android_view_RenderNode_setTranslationX },
|
||||
{ "nSetTranslationY", "(JF)V", (void*) android_view_RenderNode_setTranslationY },
|
||||
{ "nSetTranslationZ", "(JF)V", (void*) android_view_RenderNode_setTranslationZ },
|
||||
{ "nSetRotation", "(JF)V", (void*) android_view_RenderNode_setRotation },
|
||||
{ "nSetRotationX", "(JF)V", (void*) android_view_RenderNode_setRotationX },
|
||||
{ "nSetRotationY", "(JF)V", (void*) android_view_RenderNode_setRotationY },
|
||||
{ "nSetScaleX", "(JF)V", (void*) android_view_RenderNode_setScaleX },
|
||||
{ "nSetScaleY", "(JF)V", (void*) android_view_RenderNode_setScaleY },
|
||||
{ "nSetPivotX", "(JF)V", (void*) android_view_RenderNode_setPivotX },
|
||||
{ "nSetPivotY", "(JF)V", (void*) android_view_RenderNode_setPivotY },
|
||||
{ "nSetCameraDistance", "(JF)V", (void*) android_view_RenderNode_setCameraDistance },
|
||||
{ "nSetLeft", "(JI)V", (void*) android_view_RenderNode_setLeft },
|
||||
{ "nSetTop", "(JI)V", (void*) android_view_RenderNode_setTop },
|
||||
{ "nSetRight", "(JI)V", (void*) android_view_RenderNode_setRight },
|
||||
{ "nSetBottom", "(JI)V", (void*) android_view_RenderNode_setBottom },
|
||||
{ "nSetLeftTopRightBottom","(JIIII)V", (void*) android_view_RenderNode_setLeftTopRightBottom },
|
||||
{ "nOffsetLeftAndRight", "(JF)V", (void*) android_view_RenderNode_offsetLeftAndRight },
|
||||
{ "nOffsetTopAndBottom", "(JF)V", (void*) android_view_RenderNode_offsetTopAndBottom },
|
||||
{ "nSetElevation", "(JF)Z", (void*) android_view_RenderNode_setElevation },
|
||||
{ "nSetTranslationX", "(JF)Z", (void*) android_view_RenderNode_setTranslationX },
|
||||
{ "nSetTranslationY", "(JF)Z", (void*) android_view_RenderNode_setTranslationY },
|
||||
{ "nSetTranslationZ", "(JF)Z", (void*) android_view_RenderNode_setTranslationZ },
|
||||
{ "nSetRotation", "(JF)Z", (void*) android_view_RenderNode_setRotation },
|
||||
{ "nSetRotationX", "(JF)Z", (void*) android_view_RenderNode_setRotationX },
|
||||
{ "nSetRotationY", "(JF)Z", (void*) android_view_RenderNode_setRotationY },
|
||||
{ "nSetScaleX", "(JF)Z", (void*) android_view_RenderNode_setScaleX },
|
||||
{ "nSetScaleY", "(JF)Z", (void*) android_view_RenderNode_setScaleY },
|
||||
{ "nSetPivotX", "(JF)Z", (void*) android_view_RenderNode_setPivotX },
|
||||
{ "nSetPivotY", "(JF)Z", (void*) android_view_RenderNode_setPivotY },
|
||||
{ "nSetCameraDistance", "(JF)Z", (void*) android_view_RenderNode_setCameraDistance },
|
||||
{ "nSetLeft", "(JI)Z", (void*) android_view_RenderNode_setLeft },
|
||||
{ "nSetTop", "(JI)Z", (void*) android_view_RenderNode_setTop },
|
||||
{ "nSetRight", "(JI)Z", (void*) android_view_RenderNode_setRight },
|
||||
{ "nSetBottom", "(JI)Z", (void*) android_view_RenderNode_setBottom },
|
||||
{ "nSetLeftTopRightBottom","(JIIII)Z", (void*) android_view_RenderNode_setLeftTopRightBottom },
|
||||
{ "nOffsetLeftAndRight", "(JF)Z", (void*) android_view_RenderNode_offsetLeftAndRight },
|
||||
{ "nOffsetTopAndBottom", "(JF)Z", (void*) android_view_RenderNode_offsetTopAndBottom },
|
||||
|
||||
{ "nHasOverlappingRendering", "(J)Z", (void*) android_view_RenderNode_hasOverlappingRendering },
|
||||
{ "nGetClipToOutline", "(J)Z", (void*) android_view_RenderNode_getClipToOutline },
|
||||
|
||||
@@ -117,7 +117,7 @@ protected:
|
||||
virtual void setValue(RenderNode* target, float value);
|
||||
|
||||
private:
|
||||
typedef void (RenderProperties::*SetFloatProperty)(float value);
|
||||
typedef bool (RenderProperties::*SetFloatProperty)(float value);
|
||||
typedef float (RenderProperties::*GetFloatProperty)() const;
|
||||
|
||||
struct PropertyAccessors;
|
||||
|
||||
@@ -40,6 +40,10 @@ namespace uirenderer {
|
||||
class Matrix4;
|
||||
class RenderNode;
|
||||
|
||||
// The __VA_ARGS__ will be executed if a & b are not equal
|
||||
#define RP_SET(a, b, ...) (a != b ? (a = b, ##__VA_ARGS__, true) : false)
|
||||
#define RP_SET_AND_DIRTY(a, b) RP_SET(a, b, mPrimitiveFields.mMatrixOrPivotDirty = true)
|
||||
|
||||
/*
|
||||
* Data structure that holds the properties for a RenderNode
|
||||
*/
|
||||
@@ -50,29 +54,30 @@ public:
|
||||
|
||||
RenderProperties& operator=(const RenderProperties& other);
|
||||
|
||||
void setClipToBounds(bool clipToBounds) {
|
||||
mPrimitiveFields.mClipToBounds = clipToBounds;
|
||||
bool setClipToBounds(bool clipToBounds) {
|
||||
return RP_SET(mPrimitiveFields.mClipToBounds, clipToBounds);
|
||||
}
|
||||
|
||||
void setProjectBackwards(bool shouldProject) {
|
||||
mPrimitiveFields.mProjectBackwards = shouldProject;
|
||||
bool setProjectBackwards(bool shouldProject) {
|
||||
return RP_SET(mPrimitiveFields.mProjectBackwards, shouldProject);
|
||||
}
|
||||
|
||||
void setProjectionReceiver(bool shouldRecieve) {
|
||||
mPrimitiveFields.mProjectionReceiver = shouldRecieve;
|
||||
bool setProjectionReceiver(bool shouldRecieve) {
|
||||
return RP_SET(mPrimitiveFields.mProjectionReceiver, shouldRecieve);
|
||||
}
|
||||
|
||||
bool isProjectionReceiver() const {
|
||||
return mPrimitiveFields.mProjectionReceiver;
|
||||
}
|
||||
|
||||
void setStaticMatrix(const SkMatrix* matrix) {
|
||||
bool setStaticMatrix(const SkMatrix* matrix) {
|
||||
delete mStaticMatrix;
|
||||
if (matrix) {
|
||||
mStaticMatrix = new SkMatrix(*matrix);
|
||||
} else {
|
||||
mStaticMatrix = NULL;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Can return NULL
|
||||
@@ -80,72 +85,61 @@ public:
|
||||
return mStaticMatrix;
|
||||
}
|
||||
|
||||
void setAnimationMatrix(const SkMatrix* matrix) {
|
||||
bool setAnimationMatrix(const SkMatrix* matrix) {
|
||||
delete mAnimationMatrix;
|
||||
if (matrix) {
|
||||
mAnimationMatrix = new SkMatrix(*matrix);
|
||||
} else {
|
||||
mAnimationMatrix = NULL;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void setAlpha(float alpha) {
|
||||
bool setAlpha(float alpha) {
|
||||
alpha = fminf(1.0f, fmaxf(0.0f, alpha));
|
||||
if (alpha != mPrimitiveFields.mAlpha) {
|
||||
mPrimitiveFields.mAlpha = alpha;
|
||||
}
|
||||
return RP_SET(mPrimitiveFields.mAlpha, alpha);
|
||||
}
|
||||
|
||||
float getAlpha() const {
|
||||
return mPrimitiveFields.mAlpha;
|
||||
}
|
||||
|
||||
void setHasOverlappingRendering(bool hasOverlappingRendering) {
|
||||
mPrimitiveFields.mHasOverlappingRendering = hasOverlappingRendering;
|
||||
bool setHasOverlappingRendering(bool hasOverlappingRendering) {
|
||||
return RP_SET(mPrimitiveFields.mHasOverlappingRendering, hasOverlappingRendering);
|
||||
}
|
||||
|
||||
bool hasOverlappingRendering() const {
|
||||
return mPrimitiveFields.mHasOverlappingRendering;
|
||||
}
|
||||
|
||||
void setElevation(float elevation) {
|
||||
if (elevation != mPrimitiveFields.mElevation) {
|
||||
mPrimitiveFields.mElevation = elevation;
|
||||
// mMatrixOrPivotDirty not set, since matrix doesn't respect Z
|
||||
}
|
||||
bool setElevation(float elevation) {
|
||||
return RP_SET(mPrimitiveFields.mElevation, elevation);
|
||||
// Don't dirty matrix/pivot, since they don't respect Z
|
||||
}
|
||||
|
||||
float getElevation() const {
|
||||
return mPrimitiveFields.mElevation;
|
||||
}
|
||||
|
||||
void setTranslationX(float translationX) {
|
||||
if (translationX != mPrimitiveFields.mTranslationX) {
|
||||
mPrimitiveFields.mTranslationX = translationX;
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
bool setTranslationX(float translationX) {
|
||||
return RP_SET_AND_DIRTY(mPrimitiveFields.mTranslationX, translationX);
|
||||
}
|
||||
|
||||
float getTranslationX() const {
|
||||
return mPrimitiveFields.mTranslationX;
|
||||
}
|
||||
|
||||
void setTranslationY(float translationY) {
|
||||
if (translationY != mPrimitiveFields.mTranslationY) {
|
||||
mPrimitiveFields.mTranslationY = translationY;
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
bool setTranslationY(float translationY) {
|
||||
return RP_SET_AND_DIRTY(mPrimitiveFields.mTranslationY, translationY);
|
||||
}
|
||||
|
||||
float getTranslationY() const {
|
||||
return mPrimitiveFields.mTranslationY;
|
||||
}
|
||||
|
||||
void setTranslationZ(float translationZ) {
|
||||
if (translationZ != mPrimitiveFields.mTranslationZ) {
|
||||
mPrimitiveFields.mTranslationZ = translationZ;
|
||||
// mMatrixOrPivotDirty not set, since matrix doesn't respect Z
|
||||
}
|
||||
bool setTranslationZ(float translationZ) {
|
||||
return RP_SET(mPrimitiveFields.mTranslationZ, translationZ);
|
||||
// mMatrixOrPivotDirty not set, since matrix doesn't respect Z
|
||||
}
|
||||
|
||||
float getTranslationZ() const {
|
||||
@@ -153,8 +147,8 @@ public:
|
||||
}
|
||||
|
||||
// Animation helper
|
||||
void setX(float value) {
|
||||
setTranslationX(value - getLeft());
|
||||
bool setX(float value) {
|
||||
return setTranslationX(value - getLeft());
|
||||
}
|
||||
|
||||
// Animation helper
|
||||
@@ -163,8 +157,8 @@ public:
|
||||
}
|
||||
|
||||
// Animation helper
|
||||
void setY(float value) {
|
||||
setTranslationY(value - getTop());
|
||||
bool setY(float value) {
|
||||
return setTranslationY(value - getTop());
|
||||
}
|
||||
|
||||
// Animation helper
|
||||
@@ -173,87 +167,80 @@ public:
|
||||
}
|
||||
|
||||
// Animation helper
|
||||
void setZ(float value) {
|
||||
setTranslationZ(value - getElevation());
|
||||
bool setZ(float value) {
|
||||
return setTranslationZ(value - getElevation());
|
||||
}
|
||||
|
||||
float getZ() const {
|
||||
return getElevation() + getTranslationZ();
|
||||
}
|
||||
|
||||
void setRotation(float rotation) {
|
||||
if (rotation != mPrimitiveFields.mRotation) {
|
||||
mPrimitiveFields.mRotation = rotation;
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
bool setRotation(float rotation) {
|
||||
return RP_SET_AND_DIRTY(mPrimitiveFields.mRotation, rotation);
|
||||
}
|
||||
|
||||
float getRotation() const {
|
||||
return mPrimitiveFields.mRotation;
|
||||
}
|
||||
|
||||
void setRotationX(float rotationX) {
|
||||
if (rotationX != mPrimitiveFields.mRotationX) {
|
||||
mPrimitiveFields.mRotationX = rotationX;
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
bool setRotationX(float rotationX) {
|
||||
return RP_SET_AND_DIRTY(mPrimitiveFields.mRotationX, rotationX);
|
||||
}
|
||||
|
||||
float getRotationX() const {
|
||||
return mPrimitiveFields.mRotationX;
|
||||
}
|
||||
|
||||
void setRotationY(float rotationY) {
|
||||
if (rotationY != mPrimitiveFields.mRotationY) {
|
||||
mPrimitiveFields.mRotationY = rotationY;
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
bool setRotationY(float rotationY) {
|
||||
return RP_SET_AND_DIRTY(mPrimitiveFields.mRotationY, rotationY);
|
||||
}
|
||||
|
||||
float getRotationY() const {
|
||||
return mPrimitiveFields.mRotationY;
|
||||
}
|
||||
|
||||
void setScaleX(float scaleX) {
|
||||
if (scaleX != mPrimitiveFields.mScaleX) {
|
||||
mPrimitiveFields.mScaleX = scaleX;
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
bool setScaleX(float scaleX) {
|
||||
return RP_SET_AND_DIRTY(mPrimitiveFields.mScaleX, scaleX);
|
||||
}
|
||||
|
||||
float getScaleX() const {
|
||||
return mPrimitiveFields.mScaleX;
|
||||
}
|
||||
|
||||
void setScaleY(float scaleY) {
|
||||
if (scaleY != mPrimitiveFields.mScaleY) {
|
||||
mPrimitiveFields.mScaleY = scaleY;
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
bool setScaleY(float scaleY) {
|
||||
return RP_SET_AND_DIRTY(mPrimitiveFields.mScaleY, scaleY);
|
||||
}
|
||||
|
||||
float getScaleY() const {
|
||||
return mPrimitiveFields.mScaleY;
|
||||
}
|
||||
|
||||
void setPivotX(float pivotX) {
|
||||
mPrimitiveFields.mPivotX = pivotX;
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
mPrimitiveFields.mPivotExplicitlySet = true;
|
||||
bool setPivotX(float pivotX) {
|
||||
if (RP_SET(mPrimitiveFields.mPivotX, pivotX)
|
||||
|| !mPrimitiveFields.mPivotExplicitlySet) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
mPrimitiveFields.mPivotExplicitlySet = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Note that getPivotX and getPivotY are adjusted by updateMatrix(),
|
||||
* so the value returned mPrimitiveFields.may be stale if the RenderProperties has been
|
||||
* mPrimitiveFields.modified since the last call to updateMatrix()
|
||||
* so the value returned may be stale if the RenderProperties has been
|
||||
* modified since the last call to updateMatrix()
|
||||
*/
|
||||
float getPivotX() const {
|
||||
return mPrimitiveFields.mPivotX;
|
||||
}
|
||||
|
||||
void setPivotY(float pivotY) {
|
||||
mPrimitiveFields.mPivotY = pivotY;
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
mPrimitiveFields.mPivotExplicitlySet = true;
|
||||
bool setPivotY(float pivotY) {
|
||||
if (RP_SET(mPrimitiveFields.mPivotY, pivotY)
|
||||
|| !mPrimitiveFields.mPivotExplicitlySet) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
mPrimitiveFields.mPivotExplicitlySet = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
float getPivotY() const {
|
||||
@@ -264,11 +251,13 @@ public:
|
||||
return mPrimitiveFields.mPivotExplicitlySet;
|
||||
}
|
||||
|
||||
void setCameraDistance(float distance) {
|
||||
bool setCameraDistance(float distance) {
|
||||
if (distance != getCameraDistance()) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
mComputedFields.mTransformCamera.setCameraLocation(0, 0, distance);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
float getCameraDistance() const {
|
||||
@@ -276,75 +265,73 @@ public:
|
||||
return const_cast<Sk3DView*>(&mComputedFields.mTransformCamera)->getCameraLocationZ();
|
||||
}
|
||||
|
||||
void setLeft(int left) {
|
||||
if (left != mPrimitiveFields.mLeft) {
|
||||
mPrimitiveFields.mLeft = left;
|
||||
bool setLeft(int left) {
|
||||
if (RP_SET(mPrimitiveFields.mLeft, left)) {
|
||||
mPrimitiveFields.mWidth = mPrimitiveFields.mRight - mPrimitiveFields.mLeft;
|
||||
if (!mPrimitiveFields.mPivotExplicitlySet) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
float getLeft() const {
|
||||
return mPrimitiveFields.mLeft;
|
||||
}
|
||||
|
||||
void setTop(int top) {
|
||||
if (top != mPrimitiveFields.mTop) {
|
||||
mPrimitiveFields.mTop = top;
|
||||
bool setTop(int top) {
|
||||
if (RP_SET(mPrimitiveFields.mTop, top)) {
|
||||
mPrimitiveFields.mHeight = mPrimitiveFields.mBottom - mPrimitiveFields.mTop;
|
||||
if (!mPrimitiveFields.mPivotExplicitlySet) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
float getTop() const {
|
||||
return mPrimitiveFields.mTop;
|
||||
}
|
||||
|
||||
void setRight(int right) {
|
||||
if (right != mPrimitiveFields.mRight) {
|
||||
mPrimitiveFields.mRight = right;
|
||||
bool setRight(int right) {
|
||||
if (RP_SET(mPrimitiveFields.mRight, right)) {
|
||||
mPrimitiveFields.mWidth = mPrimitiveFields.mRight - mPrimitiveFields.mLeft;
|
||||
if (!mPrimitiveFields.mPivotExplicitlySet) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
float getRight() const {
|
||||
return mPrimitiveFields.mRight;
|
||||
}
|
||||
|
||||
void setBottom(int bottom) {
|
||||
if (bottom != mPrimitiveFields.mBottom) {
|
||||
mPrimitiveFields.mBottom = bottom;
|
||||
bool setBottom(int bottom) {
|
||||
if (RP_SET(mPrimitiveFields.mBottom, bottom)) {
|
||||
mPrimitiveFields.mHeight = mPrimitiveFields.mBottom - mPrimitiveFields.mTop;
|
||||
if (!mPrimitiveFields.mPivotExplicitlySet) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
float getBottom() const {
|
||||
return mPrimitiveFields.mBottom;
|
||||
}
|
||||
|
||||
void setLeftTop(int left, int top) {
|
||||
if (left != mPrimitiveFields.mLeft || top != mPrimitiveFields.mTop) {
|
||||
mPrimitiveFields.mLeft = left;
|
||||
mPrimitiveFields.mTop = top;
|
||||
mPrimitiveFields.mWidth = mPrimitiveFields.mRight - mPrimitiveFields.mLeft;
|
||||
mPrimitiveFields.mHeight = mPrimitiveFields.mBottom - mPrimitiveFields.mTop;
|
||||
if (!mPrimitiveFields.mPivotExplicitlySet) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
}
|
||||
bool setLeftTop(int left, int top) {
|
||||
bool leftResult = setLeft(left);
|
||||
bool topResult = setTop(top);
|
||||
return leftResult || topResult;
|
||||
}
|
||||
|
||||
void setLeftTopRightBottom(int left, int top, int right, int bottom) {
|
||||
bool setLeftTopRightBottom(int left, int top, int right, int bottom) {
|
||||
if (left != mPrimitiveFields.mLeft || top != mPrimitiveFields.mTop
|
||||
|| right != mPrimitiveFields.mRight || bottom != mPrimitiveFields.mBottom) {
|
||||
mPrimitiveFields.mLeft = left;
|
||||
@@ -356,31 +343,31 @@ public:
|
||||
if (!mPrimitiveFields.mPivotExplicitlySet) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void offsetLeftRight(float offset) {
|
||||
bool offsetLeftRight(float offset) {
|
||||
if (offset != 0) {
|
||||
mPrimitiveFields.mLeft += offset;
|
||||
mPrimitiveFields.mRight += offset;
|
||||
if (!mPrimitiveFields.mPivotExplicitlySet) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void offsetTopBottom(float offset) {
|
||||
bool offsetTopBottom(float offset) {
|
||||
if (offset != 0) {
|
||||
mPrimitiveFields.mTop += offset;
|
||||
mPrimitiveFields.mBottom += offset;
|
||||
if (!mPrimitiveFields.mPivotExplicitlySet) {
|
||||
mPrimitiveFields.mMatrixOrPivotDirty = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void setCaching(bool caching) {
|
||||
mPrimitiveFields.mCaching = caching;
|
||||
bool setCaching(bool caching) {
|
||||
return RP_SET(mPrimitiveFields.mCaching, caching);
|
||||
}
|
||||
|
||||
int getWidth() const {
|
||||
|
||||
Reference in New Issue
Block a user