Loading core/java/android/view/HardwareRenderer.java +3 −12 Original line number Diff line number Diff line Loading @@ -451,10 +451,8 @@ public abstract class HardwareRenderer { * @param attachInfo AttachInfo tied to the specified view. * @param callbacks Callbacks invoked when drawing happens. * @param dirty The dirty rectangle to update, can be null. * * @return true if the dirty rect was ignored, false otherwise */ abstract boolean draw(View view, View.AttachInfo attachInfo, HardwareDrawCallbacks callbacks, abstract void draw(View view, View.AttachInfo attachInfo, HardwareDrawCallbacks callbacks, Rect dirty); /** Loading Loading @@ -992,11 +990,7 @@ public abstract class HardwareRenderer { mCanvas = createCanvas(); mCanvas.setName(mName); } if (mCanvas != null) { setEnabled(true); } else { Log.w(LOG_TAG, "Hardware accelerated Canvas could not be created"); } } return mCanvas != null; Loading Loading @@ -1340,7 +1334,7 @@ public abstract class HardwareRenderer { } @Override boolean draw(View view, View.AttachInfo attachInfo, HardwareDrawCallbacks callbacks, void draw(View view, View.AttachInfo attachInfo, HardwareDrawCallbacks callbacks, Rect dirty) { if (canDraw()) { if (!hasDirtyRegions()) { Loading Loading @@ -1401,11 +1395,8 @@ public abstract class HardwareRenderer { } attachInfo.mIgnoreDirtyState = false; return dirty == null; } } return false; } private DisplayList buildDisplayList(View view, HardwareCanvas canvas) { Loading core/java/android/view/ViewRootImpl.java +10 −13 Original line number Diff line number Diff line Loading @@ -197,7 +197,6 @@ public final class ViewRootImpl implements ViewParent, int mHeight; Rect mDirty; final Rect mCurrentDirty = new Rect(); final Rect mPreviousDirty = new Rect(); boolean mIsAnimating; CompatibilityInfo.Translator mTranslator; Loading Loading @@ -767,10 +766,11 @@ public final class ViewRootImpl implements ViewParent, final boolean translucent = attrs.format != PixelFormat.OPAQUE; mAttachInfo.mHardwareRenderer = HardwareRenderer.createGlRenderer(2, translucent); if (mAttachInfo.mHardwareRenderer != null) { mAttachInfo.mHardwareRenderer.setName(attrs.getTitle().toString()); mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareAccelerationRequested = mAttachInfo.mHardwareRenderer != null; mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareAccelerationRequested = true; } } else if (fakeHwAccelerated) { // The window had wanted to use hardware acceleration, but this // is not allowed in its process. By setting this flag, it can Loading Loading @@ -2387,14 +2387,10 @@ public final class ViewRootImpl implements ViewParent, mResizeAlpha = resizeAlpha; mCurrentDirty.set(dirty); mCurrentDirty.union(mPreviousDirty); mPreviousDirty.set(dirty); dirty.setEmpty(); if (attachInfo.mHardwareRenderer.draw(mView, attachInfo, this, animating ? null : mCurrentDirty)) { mPreviousDirty.set(0, 0, mWidth, mHeight); } attachInfo.mHardwareRenderer.draw(mView, attachInfo, this, animating ? null : mCurrentDirty); } else { // If we get here with a disabled & requested hardware renderer, something went // wrong (an invalidate posted right before we destroyed the hardware surface Loading Loading @@ -2449,6 +2445,8 @@ public final class ViewRootImpl implements ViewParent, canvas = mSurface.lockCanvas(dirty); // The dirty rectangle can be modified by Surface.lockCanvas() //noinspection ConstantConditions if (left != dirty.left || top != dirty.top || right != dirty.right || bottom != dirty.bottom) { attachInfo.mIgnoreDirtyState = true; Loading Loading @@ -3099,8 +3097,7 @@ public final class ViewRootImpl implements ViewParent, boolean inTouchMode = msg.arg2 != 0; ensureTouchModeLocally(inTouchMode); if (mAttachInfo.mHardwareRenderer != null && mSurface != null && mSurface.isValid()) { if (mAttachInfo.mHardwareRenderer != null && mSurface.isValid()){ mFullRedrawNeeded = true; try { mAttachInfo.mHardwareRenderer.initializeIfNeeded( Loading Loading
core/java/android/view/HardwareRenderer.java +3 −12 Original line number Diff line number Diff line Loading @@ -451,10 +451,8 @@ public abstract class HardwareRenderer { * @param attachInfo AttachInfo tied to the specified view. * @param callbacks Callbacks invoked when drawing happens. * @param dirty The dirty rectangle to update, can be null. * * @return true if the dirty rect was ignored, false otherwise */ abstract boolean draw(View view, View.AttachInfo attachInfo, HardwareDrawCallbacks callbacks, abstract void draw(View view, View.AttachInfo attachInfo, HardwareDrawCallbacks callbacks, Rect dirty); /** Loading Loading @@ -992,11 +990,7 @@ public abstract class HardwareRenderer { mCanvas = createCanvas(); mCanvas.setName(mName); } if (mCanvas != null) { setEnabled(true); } else { Log.w(LOG_TAG, "Hardware accelerated Canvas could not be created"); } } return mCanvas != null; Loading Loading @@ -1340,7 +1334,7 @@ public abstract class HardwareRenderer { } @Override boolean draw(View view, View.AttachInfo attachInfo, HardwareDrawCallbacks callbacks, void draw(View view, View.AttachInfo attachInfo, HardwareDrawCallbacks callbacks, Rect dirty) { if (canDraw()) { if (!hasDirtyRegions()) { Loading Loading @@ -1401,11 +1395,8 @@ public abstract class HardwareRenderer { } attachInfo.mIgnoreDirtyState = false; return dirty == null; } } return false; } private DisplayList buildDisplayList(View view, HardwareCanvas canvas) { Loading
core/java/android/view/ViewRootImpl.java +10 −13 Original line number Diff line number Diff line Loading @@ -197,7 +197,6 @@ public final class ViewRootImpl implements ViewParent, int mHeight; Rect mDirty; final Rect mCurrentDirty = new Rect(); final Rect mPreviousDirty = new Rect(); boolean mIsAnimating; CompatibilityInfo.Translator mTranslator; Loading Loading @@ -767,10 +766,11 @@ public final class ViewRootImpl implements ViewParent, final boolean translucent = attrs.format != PixelFormat.OPAQUE; mAttachInfo.mHardwareRenderer = HardwareRenderer.createGlRenderer(2, translucent); if (mAttachInfo.mHardwareRenderer != null) { mAttachInfo.mHardwareRenderer.setName(attrs.getTitle().toString()); mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareAccelerationRequested = mAttachInfo.mHardwareRenderer != null; mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareAccelerationRequested = true; } } else if (fakeHwAccelerated) { // The window had wanted to use hardware acceleration, but this // is not allowed in its process. By setting this flag, it can Loading Loading @@ -2387,14 +2387,10 @@ public final class ViewRootImpl implements ViewParent, mResizeAlpha = resizeAlpha; mCurrentDirty.set(dirty); mCurrentDirty.union(mPreviousDirty); mPreviousDirty.set(dirty); dirty.setEmpty(); if (attachInfo.mHardwareRenderer.draw(mView, attachInfo, this, animating ? null : mCurrentDirty)) { mPreviousDirty.set(0, 0, mWidth, mHeight); } attachInfo.mHardwareRenderer.draw(mView, attachInfo, this, animating ? null : mCurrentDirty); } else { // If we get here with a disabled & requested hardware renderer, something went // wrong (an invalidate posted right before we destroyed the hardware surface Loading Loading @@ -2449,6 +2445,8 @@ public final class ViewRootImpl implements ViewParent, canvas = mSurface.lockCanvas(dirty); // The dirty rectangle can be modified by Surface.lockCanvas() //noinspection ConstantConditions if (left != dirty.left || top != dirty.top || right != dirty.right || bottom != dirty.bottom) { attachInfo.mIgnoreDirtyState = true; Loading Loading @@ -3099,8 +3097,7 @@ public final class ViewRootImpl implements ViewParent, boolean inTouchMode = msg.arg2 != 0; ensureTouchModeLocally(inTouchMode); if (mAttachInfo.mHardwareRenderer != null && mSurface != null && mSurface.isValid()) { if (mAttachInfo.mHardwareRenderer != null && mSurface.isValid()){ mFullRedrawNeeded = true; try { mAttachInfo.mHardwareRenderer.initializeIfNeeded( Loading