Loading packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java +1 −3 Original line number Diff line number Diff line Loading @@ -513,9 +513,7 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O paint.setFilterBitmap(true); paint.setAlpha(255); final int srcWidth = thumbnail.getWidth(); final int height = thumbnail.getHeight(); final int srcHeight = srcWidth > height ? height : (height - height * srcWidth / height); final int srcHeight = thumbnail.getHeight(); canvas.drawBitmap(thumbnail, new Rect(0, 0, srcWidth-1, srcHeight-1), new RectF(GLOW_PADDING, Loading services/java/com/android/server/wm/WindowManagerService.java +14 −14 Original line number Diff line number Diff line Loading @@ -4727,7 +4727,15 @@ public class WindowManagerService extends IWindowManager.Stub SystemProperties.set(StrictMode.VISUAL_PROPERTY, value); } public Bitmap screenshotApplications(IBinder appToken, int maxWidth, int maxHeight) { /** * Takes a snapshot of the screen. In landscape mode this grabs the whole screen. * In portrait mode, it grabs the upper region of the screen based on the vertical dimension * of the target image. * * @param width the width of the target bitmap * @param height the height of the target bitmap */ public Bitmap screenshotApplications(IBinder appToken, int width, int height) { if (!checkCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER, "screenshotApplications()")) { throw new SecurityException("Requires READ_FRAME_BUFFER permission"); Loading @@ -4739,7 +4747,7 @@ public class WindowManagerService extends IWindowManager.Stub final Rect frame = new Rect(); float scale; int sw, sh, dw, dh; int dw, dh; int rot; synchronized(mWindowMap) { Loading Loading @@ -4818,15 +4826,7 @@ public class WindowManagerService extends IWindowManager.Stub int fh = frame.height(); // First try reducing to fit in x dimension. scale = maxWidth/(float)fw; sw = maxWidth; sh = (int)(fh*scale); if (sh > maxHeight) { // y dimension became too long; constrain by that. scale = maxHeight/(float)fh; sw = (int)(fw*scale); sh = maxHeight; } scale = width/(float)fw; // The screen shot will contain the entire screen. dw = (int)(dw*scale); Loading @@ -4846,7 +4846,7 @@ public class WindowManagerService extends IWindowManager.Stub return null; } Bitmap bm = Bitmap.createBitmap(sw, sh, rawss.getConfig()); Bitmap bm = Bitmap.createBitmap(width, height, rawss.getConfig()); Matrix matrix = new Matrix(); ScreenRotationAnimation.createRotationMatrix(rot, dw, dh, matrix); matrix.postTranslate(-(int)(frame.left*scale), -(int)(frame.top*scale)); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java +1 −3 Original line number Diff line number Diff line Loading @@ -513,9 +513,7 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O paint.setFilterBitmap(true); paint.setAlpha(255); final int srcWidth = thumbnail.getWidth(); final int height = thumbnail.getHeight(); final int srcHeight = srcWidth > height ? height : (height - height * srcWidth / height); final int srcHeight = thumbnail.getHeight(); canvas.drawBitmap(thumbnail, new Rect(0, 0, srcWidth-1, srcHeight-1), new RectF(GLOW_PADDING, Loading
services/java/com/android/server/wm/WindowManagerService.java +14 −14 Original line number Diff line number Diff line Loading @@ -4727,7 +4727,15 @@ public class WindowManagerService extends IWindowManager.Stub SystemProperties.set(StrictMode.VISUAL_PROPERTY, value); } public Bitmap screenshotApplications(IBinder appToken, int maxWidth, int maxHeight) { /** * Takes a snapshot of the screen. In landscape mode this grabs the whole screen. * In portrait mode, it grabs the upper region of the screen based on the vertical dimension * of the target image. * * @param width the width of the target bitmap * @param height the height of the target bitmap */ public Bitmap screenshotApplications(IBinder appToken, int width, int height) { if (!checkCallingPermission(android.Manifest.permission.READ_FRAME_BUFFER, "screenshotApplications()")) { throw new SecurityException("Requires READ_FRAME_BUFFER permission"); Loading @@ -4739,7 +4747,7 @@ public class WindowManagerService extends IWindowManager.Stub final Rect frame = new Rect(); float scale; int sw, sh, dw, dh; int dw, dh; int rot; synchronized(mWindowMap) { Loading Loading @@ -4818,15 +4826,7 @@ public class WindowManagerService extends IWindowManager.Stub int fh = frame.height(); // First try reducing to fit in x dimension. scale = maxWidth/(float)fw; sw = maxWidth; sh = (int)(fh*scale); if (sh > maxHeight) { // y dimension became too long; constrain by that. scale = maxHeight/(float)fh; sw = (int)(fw*scale); sh = maxHeight; } scale = width/(float)fw; // The screen shot will contain the entire screen. dw = (int)(dw*scale); Loading @@ -4846,7 +4846,7 @@ public class WindowManagerService extends IWindowManager.Stub return null; } Bitmap bm = Bitmap.createBitmap(sw, sh, rawss.getConfig()); Bitmap bm = Bitmap.createBitmap(width, height, rawss.getConfig()); Matrix matrix = new Matrix(); ScreenRotationAnimation.createRotationMatrix(rot, dw, dh, matrix); matrix.postTranslate(-(int)(frame.left*scale), -(int)(frame.top*scale)); Loading