Fix tab snapshot to consider orientation
Capture of tab snapshot was not accounting for orientation change for scale calculation.
This caused a white bar to be seen for missing region in landscape mode.
CR-Fixed: SWE-6350
Change-Id: I00cdf055bf2477c294bcf871c98cc40eda8ad2c9
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 2ddd2d1..80ef16d 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -1975,8 +1975,11 @@
thumbnailUpdated();
return;
}
-
- mMainView.getContentBitmapAsync((float) mCaptureWidth / mMainView.getWidth(), new Rect(),
+ int orientation = mWebViewController.getActivity().
+ getResources().getConfiguration().orientation;
+ int width = (orientation == Configuration.ORIENTATION_PORTRAIT) ? mMainView.getWidth() :
+ mMainView.getHeight();
+ mMainView.getContentBitmapAsync((float) mCaptureWidth / width, new Rect(),
new ValueCallback<Bitmap>() {
@Override
public void onReceiveValue(Bitmap bitmap) {