Reviewers: Ted C, Jerome,
Description:
Flip android decorations vertically.
Since the texture we get is vertically flipped, we need to flip the android
decorations
as well.
BUG=
Please review this at
https://codereview.chromium.org/11312068/
SVN Base: svn://
svn.chromium.org/chrome/trunk/src
Affected files:
M
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Index:
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git
a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index
f674e79409a99e713d494299976976e176046721..55bf72b7f7df96563c05ff121c51bcd24447f8cc
100644
---
a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++
b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -738,7 +738,7 @@ public class ContentViewCore implements
MotionEventDelegate {
}
public Bitmap getBitmap(int width, int height) {
- if (getWidth() == 0 || getHeight() == 0) return null;
+ if (width == 0 || height == 0 || getWidth() == 0 || getHeight() ==
0) return null;
Bitmap b = Bitmap.createBitmap(width, height,
Bitmap.Config.ARGB_8888);
@@ -746,9 +746,9 @@ public class ContentViewCore implements
MotionEventDelegate {
nativePopulateBitmapFromCompositor(mNativeContentViewCore,
b)) {
// If we successfully grabbed a bitmap, check if we have to
draw the Android overlay
// components as well.
- if (mContainerView.getParent() != null &&
- mContainerView.getVisibility() == View.VISIBLE) {
+ if (mContainerView.getChildCount() > 0) {
Canvas c = new Canvas(b);
+ c.scale(1, -1, width / 2, height / 2);
c.scale(width / (float) getWidth(), height / (float)
getHeight());
mContainerView.draw(c);
}