Loading core/java/android/view/Surface.java +0 −3 Original line number Diff line number Diff line Loading @@ -194,9 +194,6 @@ public class Surface implements Parcelable { */ public static final int FX_SURFACE_DIM = 0x00020000; /** @hide */ public static final int FX_SURFACE_SCREENSHOT = 0x00030000; /** Mask used for FX values above @hide */ public static final int FX_SURFACE_MASK = 0x000F0000; Loading include/surfaceflinger/ISurfaceComposer.h +0 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ public: eFXSurfaceNormal = 0x00000000, eFXSurfaceBlur = 0x00010000, eFXSurfaceDim = 0x00020000, eFXSurfaceScreenshot= 0x00030000, eFXSurfaceMask = 0x000F0000, }; Loading services/java/com/android/server/wm/ScreenRotationAnimation.java +36 −14 Original line number Diff line number Diff line Loading @@ -64,16 +64,17 @@ class ScreenRotationAnimation { boolean inTransaction, int originalWidth, int originalHeight, int originalRotation) { mContext = context; Bitmap screenshot = Surface.screenshot(0, 0); if (screenshot == null) { // Device is not capable of screenshots... we can't do an animation. return; } // Screenshot does NOT include rotation! mSnapshotRotation = 0; if (originalRotation == Surface.ROTATION_90 || originalRotation == Surface.ROTATION_270) { mWidth = originalHeight; mHeight = originalWidth; } else { mWidth = originalWidth; mHeight = originalHeight; } mWidth = screenshot.getWidth(); mHeight = screenshot.getHeight(); mOriginalRotation = originalRotation; mOriginalWidth = originalWidth; Loading @@ -88,12 +89,7 @@ class ScreenRotationAnimation { try { try { mSurface = new Surface(session, 0, "FreezeSurface", -1, mWidth, mHeight, PixelFormat.OPAQUE, Surface.FX_SURFACE_SCREENSHOT); if (mSurface == null || !mSurface.isValid()) { // Screenshot failed, punt. mSurface = null; return; } -1, mWidth, mHeight, PixelFormat.OPAQUE, 0); mSurface.setLayer(FREEZE_LAYER + 1); } catch (Surface.OutOfResourcesException e) { Slog.w(TAG, "Unable to allocate freeze surface", e); Loading @@ -104,12 +100,38 @@ class ScreenRotationAnimation { " FREEZE " + mSurface + ": CREATE"); setRotation(originalRotation); if (mSurface != null) { Rect dirty = new Rect(0, 0, mWidth, mHeight); Canvas c = null; try { c = mSurface.lockCanvas(dirty); } catch (IllegalArgumentException e) { Slog.w(TAG, "Unable to lock surface", e); } catch (Surface.OutOfResourcesException e) { Slog.w(TAG, "Unable to lock surface", e); } if (c == null) { Slog.w(TAG, "Null surface canvas"); mSurface.destroy(); mSurface = null; return; } Paint paint = new Paint(0); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC)); c.drawBitmap(screenshot, 0, 0, paint); mSurface.unlockCanvasAndPost(c); } } finally { if (!inTransaction) { Surface.closeTransaction(); if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "<<< CLOSE TRANSACTION ScreenRotationAnimation"); } screenshot.recycle(); } } Loading services/surfaceflinger/Android.mk +0 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ LOCAL_SRC_FILES:= \ Layer.cpp \ LayerBase.cpp \ LayerDim.cpp \ LayerScreenshot.cpp \ DdmConnection.cpp \ DisplayHardware/DisplayHardware.cpp \ DisplayHardware/DisplayHardwareBase.cpp \ Loading services/surfaceflinger/Layer.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -88,8 +88,16 @@ void Layer::onFirstRef() Layer::~Layer() { mFlinger->postMessageAsync( new SurfaceFlinger::MessageDestroyGLTexture(mTextureName) ); class MessageDestroyGLState : public MessageBase { GLuint texture; public: MessageDestroyGLState(GLuint texture) : texture(texture) { } virtual bool handler() { glDeleteTextures(1, &texture); return true; } }; mFlinger->postMessageAsync( new MessageDestroyGLState(mTextureName) ); } void Layer::onFrameQueued() { Loading Loading
core/java/android/view/Surface.java +0 −3 Original line number Diff line number Diff line Loading @@ -194,9 +194,6 @@ public class Surface implements Parcelable { */ public static final int FX_SURFACE_DIM = 0x00020000; /** @hide */ public static final int FX_SURFACE_SCREENSHOT = 0x00030000; /** Mask used for FX values above @hide */ public static final int FX_SURFACE_MASK = 0x000F0000; Loading
include/surfaceflinger/ISurfaceComposer.h +0 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ public: eFXSurfaceNormal = 0x00000000, eFXSurfaceBlur = 0x00010000, eFXSurfaceDim = 0x00020000, eFXSurfaceScreenshot= 0x00030000, eFXSurfaceMask = 0x000F0000, }; Loading
services/java/com/android/server/wm/ScreenRotationAnimation.java +36 −14 Original line number Diff line number Diff line Loading @@ -64,16 +64,17 @@ class ScreenRotationAnimation { boolean inTransaction, int originalWidth, int originalHeight, int originalRotation) { mContext = context; Bitmap screenshot = Surface.screenshot(0, 0); if (screenshot == null) { // Device is not capable of screenshots... we can't do an animation. return; } // Screenshot does NOT include rotation! mSnapshotRotation = 0; if (originalRotation == Surface.ROTATION_90 || originalRotation == Surface.ROTATION_270) { mWidth = originalHeight; mHeight = originalWidth; } else { mWidth = originalWidth; mHeight = originalHeight; } mWidth = screenshot.getWidth(); mHeight = screenshot.getHeight(); mOriginalRotation = originalRotation; mOriginalWidth = originalWidth; Loading @@ -88,12 +89,7 @@ class ScreenRotationAnimation { try { try { mSurface = new Surface(session, 0, "FreezeSurface", -1, mWidth, mHeight, PixelFormat.OPAQUE, Surface.FX_SURFACE_SCREENSHOT); if (mSurface == null || !mSurface.isValid()) { // Screenshot failed, punt. mSurface = null; return; } -1, mWidth, mHeight, PixelFormat.OPAQUE, 0); mSurface.setLayer(FREEZE_LAYER + 1); } catch (Surface.OutOfResourcesException e) { Slog.w(TAG, "Unable to allocate freeze surface", e); Loading @@ -104,12 +100,38 @@ class ScreenRotationAnimation { " FREEZE " + mSurface + ": CREATE"); setRotation(originalRotation); if (mSurface != null) { Rect dirty = new Rect(0, 0, mWidth, mHeight); Canvas c = null; try { c = mSurface.lockCanvas(dirty); } catch (IllegalArgumentException e) { Slog.w(TAG, "Unable to lock surface", e); } catch (Surface.OutOfResourcesException e) { Slog.w(TAG, "Unable to lock surface", e); } if (c == null) { Slog.w(TAG, "Null surface canvas"); mSurface.destroy(); mSurface = null; return; } Paint paint = new Paint(0); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC)); c.drawBitmap(screenshot, 0, 0, paint); mSurface.unlockCanvasAndPost(c); } } finally { if (!inTransaction) { Surface.closeTransaction(); if (WindowManagerService.SHOW_LIGHT_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "<<< CLOSE TRANSACTION ScreenRotationAnimation"); } screenshot.recycle(); } } Loading
services/surfaceflinger/Android.mk +0 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ LOCAL_SRC_FILES:= \ Layer.cpp \ LayerBase.cpp \ LayerDim.cpp \ LayerScreenshot.cpp \ DdmConnection.cpp \ DisplayHardware/DisplayHardware.cpp \ DisplayHardware/DisplayHardwareBase.cpp \ Loading
services/surfaceflinger/Layer.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -88,8 +88,16 @@ void Layer::onFirstRef() Layer::~Layer() { mFlinger->postMessageAsync( new SurfaceFlinger::MessageDestroyGLTexture(mTextureName) ); class MessageDestroyGLState : public MessageBase { GLuint texture; public: MessageDestroyGLState(GLuint texture) : texture(texture) { } virtual bool handler() { glDeleteTextures(1, &texture); return true; } }; mFlinger->postMessageAsync( new MessageDestroyGLState(mTextureName) ); } void Layer::onFrameQueued() { Loading