Loading core/java/android/view/View.java +64 −39 Original line number Diff line number Diff line Loading @@ -5868,8 +5868,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility EventLog.writeEvent(60002, hashCode()); } final int width = mRight - mLeft; final int height = mBottom - mTop; int width = mRight - mLeft; int height = mBottom - mTop; final AttachInfo attachInfo = mAttachInfo; if (attachInfo != null) { final boolean scalingRequired = attachInfo.mScalingRequired; if (scalingRequired) { width = (int) ((width * attachInfo.mApplicationScale) + 0.5f); height = (int) ((height * attachInfo.mApplicationScale) + 0.5f); } } final int drawingCacheBackgroundColor = mDrawingCacheBackgroundColor; final boolean opaque = drawingCacheBackgroundColor != 0 || Loading Loading @@ -5925,11 +5934,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } Canvas canvas; final AttachInfo attachInfo = mAttachInfo; if (attachInfo != null) { canvas = attachInfo.mCanvas; if (canvas == null) { canvas = new Canvas(); // NOTE: This should have to happen only once since compatibility // mode should not change at runtime if (attachInfo.mScalingRequired) { final float scale = attachInfo.mApplicationScale; canvas.scale(scale, scale); } } canvas.setBitmap(bitmap); // Temporarily clobber the cached Canvas in case one of our children Loading Loading @@ -8452,6 +8467,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility IBinder mPanelParentWindowToken; Surface mSurface; /** * Scale factor used by the compatibility mode */ float mApplicationScale; /** * Indicates whether the application is in compatibility mode */ boolean mScalingRequired; /** * Left position of this view's window */ Loading core/java/android/view/ViewGroup.java +38 −28 Original line number Diff line number Diff line Loading @@ -1444,10 +1444,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final int sx = child.mScrollX; final int sy = child.mScrollY; boolean scalingRequired = false; Bitmap cache = null; if ((flags & FLAG_CHILDREN_DRAWN_WITH_CACHE) == FLAG_CHILDREN_DRAWN_WITH_CACHE || (flags & FLAG_ALWAYS_DRAWN_WITH_CACHE) == FLAG_ALWAYS_DRAWN_WITH_CACHE) { cache = child.getDrawingCache(); scalingRequired = mAttachInfo.mScalingRequired; } final boolean hasNoCache = cache == null; Loading @@ -1457,6 +1459,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager canvas.translate(cl - sx, ct - sy); } else { canvas.translate(cl, ct); if (scalingRequired) { final float scale = 1.0f / mAttachInfo.mApplicationScale; canvas.scale(scale, scale); } } float alpha = 1.0f; Loading Loading @@ -1499,7 +1505,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (hasNoCache) { canvas.clipRect(sx, sy, sx + (cr - cl), sy + (cb - ct)); } else { if (!scalingRequired) { canvas.clipRect(0, 0, cr - cl, cb - ct); } else { canvas.clipRect(0, 0, cache.getWidth(), cache.getHeight()); } } } Loading core/java/android/view/ViewRoot.java +72 −70 Original line number Diff line number Diff line Loading @@ -399,6 +399,8 @@ public final class ViewRoot extends Handler implements ViewParent, mSoftInputMode = attrs.softInputMode; mWindowAttributesChanged = true; mAttachInfo.mRootView = view; mAttachInfo.mScalingRequired = mCompatibilityInfo.mScalingRequired; mAttachInfo.mApplicationScale = mCompatibilityInfo.mApplicationScale; if (panelParentView != null) { mAttachInfo.mPanelParentWindowToken = panelParentView.getApplicationWindowToken(); Loading Loading
core/java/android/view/View.java +64 −39 Original line number Diff line number Diff line Loading @@ -5868,8 +5868,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility EventLog.writeEvent(60002, hashCode()); } final int width = mRight - mLeft; final int height = mBottom - mTop; int width = mRight - mLeft; int height = mBottom - mTop; final AttachInfo attachInfo = mAttachInfo; if (attachInfo != null) { final boolean scalingRequired = attachInfo.mScalingRequired; if (scalingRequired) { width = (int) ((width * attachInfo.mApplicationScale) + 0.5f); height = (int) ((height * attachInfo.mApplicationScale) + 0.5f); } } final int drawingCacheBackgroundColor = mDrawingCacheBackgroundColor; final boolean opaque = drawingCacheBackgroundColor != 0 || Loading Loading @@ -5925,11 +5934,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } Canvas canvas; final AttachInfo attachInfo = mAttachInfo; if (attachInfo != null) { canvas = attachInfo.mCanvas; if (canvas == null) { canvas = new Canvas(); // NOTE: This should have to happen only once since compatibility // mode should not change at runtime if (attachInfo.mScalingRequired) { final float scale = attachInfo.mApplicationScale; canvas.scale(scale, scale); } } canvas.setBitmap(bitmap); // Temporarily clobber the cached Canvas in case one of our children Loading Loading @@ -8452,6 +8467,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility IBinder mPanelParentWindowToken; Surface mSurface; /** * Scale factor used by the compatibility mode */ float mApplicationScale; /** * Indicates whether the application is in compatibility mode */ boolean mScalingRequired; /** * Left position of this view's window */ Loading
core/java/android/view/ViewGroup.java +38 −28 Original line number Diff line number Diff line Loading @@ -1444,10 +1444,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final int sx = child.mScrollX; final int sy = child.mScrollY; boolean scalingRequired = false; Bitmap cache = null; if ((flags & FLAG_CHILDREN_DRAWN_WITH_CACHE) == FLAG_CHILDREN_DRAWN_WITH_CACHE || (flags & FLAG_ALWAYS_DRAWN_WITH_CACHE) == FLAG_ALWAYS_DRAWN_WITH_CACHE) { cache = child.getDrawingCache(); scalingRequired = mAttachInfo.mScalingRequired; } final boolean hasNoCache = cache == null; Loading @@ -1457,6 +1459,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager canvas.translate(cl - sx, ct - sy); } else { canvas.translate(cl, ct); if (scalingRequired) { final float scale = 1.0f / mAttachInfo.mApplicationScale; canvas.scale(scale, scale); } } float alpha = 1.0f; Loading Loading @@ -1499,7 +1505,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (hasNoCache) { canvas.clipRect(sx, sy, sx + (cr - cl), sy + (cb - ct)); } else { if (!scalingRequired) { canvas.clipRect(0, 0, cr - cl, cb - ct); } else { canvas.clipRect(0, 0, cache.getWidth(), cache.getHeight()); } } } Loading
core/java/android/view/ViewRoot.java +72 −70 Original line number Diff line number Diff line Loading @@ -399,6 +399,8 @@ public final class ViewRoot extends Handler implements ViewParent, mSoftInputMode = attrs.softInputMode; mWindowAttributesChanged = true; mAttachInfo.mRootView = view; mAttachInfo.mScalingRequired = mCompatibilityInfo.mScalingRequired; mAttachInfo.mApplicationScale = mCompatibilityInfo.mApplicationScale; if (panelParentView != null) { mAttachInfo.mPanelParentWindowToken = panelParentView.getApplicationWindowToken(); Loading