diff options
| author | Chris Craik <ccraik@google.com> | 2014-03-17 13:17:02 -0700 |
|---|---|---|
| committer | Chris Craik <ccraik@google.com> | 2014-03-17 13:24:08 -0700 |
| commit | 34f67f26e355925aa1e00a20bc11e09b8dc32988 (patch) | |
| tree | ad5e99536a53d2eea9c9e6ecd56d9f4390580ff0 /core/java | |
| parent | e0583b2c93a8c0781700d8630487e9c7cfbd213f (diff) | |
Remove castsShadow and globalCamera APIs
Change-Id: I5c1c375f45946609b1635d952c5adf55e23bdd60
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/RenderNode.java | 21 | ||||
| -rw-r--r-- | core/java/android/view/View.java | 112 |
2 files changed, 2 insertions, 131 deletions
diff --git a/core/java/android/view/RenderNode.java b/core/java/android/view/RenderNode.java index 430bf5e1691a..87ab20e2cba2 100644 --- a/core/java/android/view/RenderNode.java +++ b/core/java/android/view/RenderNode.java @@ -365,25 +365,6 @@ public class RenderNode { } /** - * Set whether the DisplayList should cast a shadow. - * - * The shape of the shadow casting area is defined by the outline of the display list, if set - * and non-empty, otherwise it will be the bounds rect. - */ - public void setCastsShadow(boolean castsShadow) { - nSetCastsShadow(mNativeDisplayList, castsShadow); - } - - /** - * Sets whether the DisplayList should be drawn with perspective applied from the global camera. - * - * If set to true, camera distance will be ignored. Defaults to false. - */ - public void setUsesGlobalCamera(boolean usesGlobalCamera) { - nSetUsesGlobalCamera(mNativeDisplayList, usesGlobalCamera); - } - - /** * Set the static matrix on the display list. The specified matrix is combined with other * transforms (such as {@link #setScaleX(float)}, {@link #setRotation(float)}, etc.) * @@ -877,8 +858,6 @@ public class RenderNode { private static native void nSetIsolatedZVolume(long displayList, boolean isolateZVolume); private static native void nSetOutline(long displayList, long nativePath); private static native void nSetClipToOutline(long displayList, boolean clipToOutline); - private static native void nSetCastsShadow(long displayList, boolean castsShadow); - private static native void nSetUsesGlobalCamera(long displayList, boolean usesGlobalCamera); private static native void nSetAlpha(long displayList, float alpha); private static native void nSetHasOverlappingRendering(long displayList, boolean hasOverlappingRendering); diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index eff78d3a3557..ecd73af2923c 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -2386,17 +2386,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ static final int PFLAG3_FITTING_SYSTEM_WINDOWS = 0x80; - /** - * Flag indicating that an view will cast a shadow onto the Z=0 plane if elevated. - */ - static final int PFLAG3_CASTS_SHADOW = 0x100; - - /** - * Flag indicating that view will be transformed by the global camera if rotated in 3d, or given - * a non-0 Z translation. - */ - static final int PFLAG3_USES_GLOBAL_CAMERA = 0x200; - /* End of masks for mPrivateFlags3 */ static final int DRAG_MASK = PFLAG2_DRAG_CAN_ACCEPT | PFLAG2_DRAG_HOVERED; @@ -4039,11 +4028,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, case R.styleable.View_layerType: setLayerType(a.getInt(attr, LAYER_TYPE_NONE), null); break; - case R.styleable.View_castsShadow: - if (a.getBoolean(attr, false)) { - mPrivateFlags3 |= PFLAG3_CASTS_SHADOW; - } - break; case R.styleable.View_textDirection: // Clear any text direction flag already set mPrivateFlags2 &= ~PFLAG2_TEXT_DIRECTION_MASK; @@ -10852,7 +10836,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * @param outline The new outline of the view. Must be non-null, and convex. * - * @see #setCastsShadow(boolean) * @see #getOutline(Path) * @see #getClipToOutline() * @see #setClipToOutline(boolean) @@ -10916,95 +10899,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** - * Returns whether the View will cast shadows when its - * {@link #setTranslationZ(float) z translation} is greater than 0, or it is - * rotated in 3D. - * - * @see #setTranslationZ(float) - * @see #setRotationX(float) - * @see #setRotationY(float) - * @see #setCastsShadow(boolean) - * @attr ref android.R.styleable#View_castsShadow - */ - public final boolean getCastsShadow() { - return ((mPrivateFlags3 & PFLAG3_CASTS_SHADOW) != 0); - } - - /** - * Set to true to enable this View to cast shadows. - * <p> - * If enabled, and the View has a z translation greater than 0, or is - * rotated in 3D, the shadow will be cast onto its parent at the z = 0 - * plane. - * <p> - * The shape of the shadow being cast is defined by the - * {@link #setOutline(Path) outline} of the view, or the rectangular bounds - * of the view if the outline is not set or is empty. - * - * @see #setTranslationZ(float) - * @see #getCastsShadow() - * @attr ref android.R.styleable#View_castsShadow - */ - public void setCastsShadow(boolean castsShadow) { - // TODO : Add a fast invalidation here. - if (getCastsShadow() != castsShadow) { - if (castsShadow) { - mPrivateFlags3 |= PFLAG3_CASTS_SHADOW; - } else { - mPrivateFlags3 &= ~PFLAG3_CASTS_SHADOW; - } - if (mDisplayList != null) { - mDisplayList.setCastsShadow(castsShadow); - } - } - } - - /** - * Returns whether the View will be transformed by the global camera. - * - * @see #setUsesGlobalCamera(boolean) - * - * @hide - */ - public final boolean getUsesGlobalCamera() { - return ((mPrivateFlags3 & PFLAG3_USES_GLOBAL_CAMERA) != 0); - } - - /** - * Sets whether the View should be transformed by the global camera. - * <p> - * If the view has a Z translation or 3D rotation, perspective from the - * global camera will be applied. This enables an app to transform multiple - * views in 3D with coherent perspective projection among them all. - * <p> - * Setting this to true will cause {@link #setCameraDistance() camera distance} - * to be ignored, as the global camera's position will dictate perspective - * transform. - * <p> - * This should not be used in conjunction with {@link android.graphics.Camera}. - * - * @see #getUsesGlobalCamera() - * @see #setTranslationZ(float) - * @see #setRotationX(float) - * @see #setRotationY(float) - * - * @hide - */ - public void setUsesGlobalCamera(boolean usesGlobalCamera) { - // TODO : Add a fast invalidation here. - if (getUsesGlobalCamera() != usesGlobalCamera) { - if (usesGlobalCamera) { - mPrivateFlags3 |= PFLAG3_USES_GLOBAL_CAMERA; - } else { - mPrivateFlags3 &= ~PFLAG3_USES_GLOBAL_CAMERA; - } - if (mDisplayList != null) { - mDisplayList.setUsesGlobalCamera(usesGlobalCamera); - } - } - } - - /** * Hit rectangle in parent's coordinates * * @param outRect The hit rectangle of the view. @@ -11567,7 +11461,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } // Damage the entire IsolatedZVolume recieving this view's shadow. - if (getCastsShadow() && getTranslationZ() != 0) { + if (getTranslationZ() != 0) { damageIsolatedZVolume(); } } @@ -11647,7 +11541,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } else { damageInParent(); } - if (invalidateParent && getCastsShadow() && getTranslationZ() != 0) { + if (invalidateParent && getTranslationZ() != 0) { damageIsolatedZVolume(); } } @@ -14685,8 +14579,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } displayList.setOutline(mOutline); displayList.setClipToOutline(getClipToOutline()); - displayList.setCastsShadow(getCastsShadow()); - displayList.setUsesGlobalCamera(getUsesGlobalCamera()); float alpha = 1; if (mParent instanceof ViewGroup && (((ViewGroup) mParent).mGroupFlags & ViewGroup.FLAG_SUPPORT_STATIC_TRANSFORMATIONS) != 0) { |
