Loading core/java/android/view/TextureView.java +14 −0 Original line number Diff line number Diff line Loading @@ -502,9 +502,23 @@ public class TextureView extends View { * @see #isAvailable() * @see #getBitmap(int, int) * @see #getBitmap() * * @throws IllegalStateException if the hardware rendering context cannot be * acquired to capture the bitmap */ public Bitmap getBitmap(Bitmap bitmap) { if (bitmap != null && isAvailable()) { AttachInfo info = mAttachInfo; if (info != null && info.mHardwareRenderer != null && info.mHardwareRenderer.isEnabled()) { if (!info.mHardwareRenderer.validate()) { throw new IllegalStateException("Could not acquire hardware rendering context"); } } applyUpdate(); applyTransformMatrix(); mLayer.copyInto(bitmap); } return bitmap; Loading core/java/android/view/View.java +8 −0 Original line number Diff line number Diff line Loading @@ -10125,6 +10125,14 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal return mHardwareLayer; } /** * Destroys this View's hardware layer if possible. * * @return True if the layer was destroyed, false otherwise. * * @see #setLayerType(int, android.graphics.Paint) * @see #LAYER_TYPE_HARDWARE */ boolean destroyLayer() { if (mHardwareLayer != null) { mHardwareLayer.destroy(); Loading Loading
core/java/android/view/TextureView.java +14 −0 Original line number Diff line number Diff line Loading @@ -502,9 +502,23 @@ public class TextureView extends View { * @see #isAvailable() * @see #getBitmap(int, int) * @see #getBitmap() * * @throws IllegalStateException if the hardware rendering context cannot be * acquired to capture the bitmap */ public Bitmap getBitmap(Bitmap bitmap) { if (bitmap != null && isAvailable()) { AttachInfo info = mAttachInfo; if (info != null && info.mHardwareRenderer != null && info.mHardwareRenderer.isEnabled()) { if (!info.mHardwareRenderer.validate()) { throw new IllegalStateException("Could not acquire hardware rendering context"); } } applyUpdate(); applyTransformMatrix(); mLayer.copyInto(bitmap); } return bitmap; Loading
core/java/android/view/View.java +8 −0 Original line number Diff line number Diff line Loading @@ -10125,6 +10125,14 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal return mHardwareLayer; } /** * Destroys this View's hardware layer if possible. * * @return True if the layer was destroyed, false otherwise. * * @see #setLayerType(int, android.graphics.Paint) * @see #LAYER_TYPE_HARDWARE */ boolean destroyLayer() { if (mHardwareLayer != null) { mHardwareLayer.destroy(); Loading