Loading core/java/android/view/GLES20Canvas.java +1 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ class GLES20Canvas extends HardwareCanvas { static native void nSetTextureLayerTransform(int layerId, int matrix); static native void nDestroyLayer(int layerId); static native void nDestroyLayerDeferred(int layerId); static native void nFlushLayer(int layerId); static native boolean nCopyLayer(int layerId, int bitmap); /////////////////////////////////////////////////////////////////////////// Loading core/java/android/view/GLES20Layer.java +7 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,13 @@ abstract class GLES20Layer extends HardwareLayer { mLayer = 0; } @Override void flush() { if (mLayer != 0) { GLES20Canvas.nFlushLayer(mLayer); } } static class Finalizer { private int mLayerId; Loading core/java/android/view/HardwareLayer.java +5 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,11 @@ abstract class HardwareLayer { */ abstract void destroy(); /** * Flush the render queue associated with this layer. */ abstract void flush(); /** * This must be invoked before drawing onto this layer. * @param currentCanvas Loading core/java/android/view/View.java +17 −5 Original line number Diff line number Diff line Loading @@ -10208,6 +10208,13 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal } } // Make sure the HardwareRenderer.validate() was invoked before calling this method void flushLayer() { if (mLayerType == LAYER_TYPE_HARDWARE && mHardwareLayer != null) { mHardwareLayer.flush(); } } /** * <p>Returns a hardware layer that can be used to draw this view again * without executing its draw method.</p> Loading @@ -10220,6 +10227,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal return null; } if (!mAttachInfo.mHardwareRenderer.validate()) return null; final int width = mRight - mLeft; final int height = mBottom - mTop; Loading Loading @@ -10293,12 +10302,15 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal */ boolean destroyLayer() { if (mHardwareLayer != null) { AttachInfo info = mAttachInfo; if (info != null && info.mHardwareRenderer != null && info.mHardwareRenderer.isEnabled() && info.mHardwareRenderer.validate()) { mHardwareLayer.destroy(); mHardwareLayer = null; invalidate(true); invalidateParentCaches(); } return true; } return false; Loading core/java/android/view/ViewGroup.java +12 −0 Original line number Diff line number Diff line Loading @@ -2958,6 +2958,17 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager mDrawLayers = enabled; invalidate(true); boolean flushLayers = !enabled; AttachInfo info = mAttachInfo; if (info != null && info.mHardwareRenderer != null && info.mHardwareRenderer.isEnabled()) { if (!info.mHardwareRenderer.validate()) { flushLayers = false; } } else { flushLayers = false; } // We need to invalidate any child with a layer. For instance, // if a child is backed by a hardware layer and we disable layers // the child is marked as not dirty (flags cleared the last time Loading @@ -2968,6 +2979,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager for (int i = 0; i < mChildrenCount; i++) { View child = mChildren[i]; if (child.mLayerType != LAYER_TYPE_NONE) { if (flushLayers) child.flushLayer(); child.invalidate(true); } } Loading Loading
core/java/android/view/GLES20Canvas.java +1 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ class GLES20Canvas extends HardwareCanvas { static native void nSetTextureLayerTransform(int layerId, int matrix); static native void nDestroyLayer(int layerId); static native void nDestroyLayerDeferred(int layerId); static native void nFlushLayer(int layerId); static native boolean nCopyLayer(int layerId, int bitmap); /////////////////////////////////////////////////////////////////////////// Loading
core/java/android/view/GLES20Layer.java +7 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,13 @@ abstract class GLES20Layer extends HardwareLayer { mLayer = 0; } @Override void flush() { if (mLayer != 0) { GLES20Canvas.nFlushLayer(mLayer); } } static class Finalizer { private int mLayerId; Loading
core/java/android/view/HardwareLayer.java +5 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,11 @@ abstract class HardwareLayer { */ abstract void destroy(); /** * Flush the render queue associated with this layer. */ abstract void flush(); /** * This must be invoked before drawing onto this layer. * @param currentCanvas Loading
core/java/android/view/View.java +17 −5 Original line number Diff line number Diff line Loading @@ -10208,6 +10208,13 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal } } // Make sure the HardwareRenderer.validate() was invoked before calling this method void flushLayer() { if (mLayerType == LAYER_TYPE_HARDWARE && mHardwareLayer != null) { mHardwareLayer.flush(); } } /** * <p>Returns a hardware layer that can be used to draw this view again * without executing its draw method.</p> Loading @@ -10220,6 +10227,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal return null; } if (!mAttachInfo.mHardwareRenderer.validate()) return null; final int width = mRight - mLeft; final int height = mBottom - mTop; Loading Loading @@ -10293,12 +10302,15 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal */ boolean destroyLayer() { if (mHardwareLayer != null) { AttachInfo info = mAttachInfo; if (info != null && info.mHardwareRenderer != null && info.mHardwareRenderer.isEnabled() && info.mHardwareRenderer.validate()) { mHardwareLayer.destroy(); mHardwareLayer = null; invalidate(true); invalidateParentCaches(); } return true; } return false; Loading
core/java/android/view/ViewGroup.java +12 −0 Original line number Diff line number Diff line Loading @@ -2958,6 +2958,17 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager mDrawLayers = enabled; invalidate(true); boolean flushLayers = !enabled; AttachInfo info = mAttachInfo; if (info != null && info.mHardwareRenderer != null && info.mHardwareRenderer.isEnabled()) { if (!info.mHardwareRenderer.validate()) { flushLayers = false; } } else { flushLayers = false; } // We need to invalidate any child with a layer. For instance, // if a child is backed by a hardware layer and we disable layers // the child is marked as not dirty (flags cleared the last time Loading @@ -2968,6 +2979,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager for (int i = 0; i < mChildrenCount; i++) { View child = mChildren[i]; if (child.mLayerType != LAYER_TYPE_NONE) { if (flushLayers) child.flushLayer(); child.invalidate(true); } } Loading