Loading core/java/android/view/GLES20Canvas.java +4 −3 Original line number Diff line number Diff line Loading @@ -245,11 +245,12 @@ class GLES20Canvas extends HardwareCanvas { private static native void nDestroyDisplayList(int displayList); @Override public boolean drawDisplayList(DisplayList displayList) { return nDrawDisplayList(mRenderer, ((GLES20DisplayList) displayList).mNativeDisplayList); public boolean drawDisplayList(DisplayList displayList, Rect dirty) { return nDrawDisplayList(mRenderer, ((GLES20DisplayList) displayList).mNativeDisplayList, dirty); } private static native boolean nDrawDisplayList(int renderer, int displayList); private static native boolean nDrawDisplayList(int renderer, int displayList, Rect dirty); /////////////////////////////////////////////////////////////////////////// // Hardware layer Loading core/java/android/view/HardwareCanvas.java +6 −1 Original line number Diff line number Diff line Loading @@ -53,8 +53,13 @@ public abstract class HardwareCanvas extends Canvas { * Draws the specified display list onto this canvas. * * @param displayList The display list to replay. * @param dirty The dirty region to redraw in the next pass, matters only * if this method returns true, can be null. * * @return True if the content of the display list requires another * drawing pass (invalidate()), false otherwise */ abstract boolean drawDisplayList(DisplayList displayList); abstract boolean drawDisplayList(DisplayList displayList, Rect dirty); /** * Draws the specified layer onto this canvas. Loading core/java/android/view/HardwareRenderer.java +12 −5 Original line number Diff line number Diff line Loading @@ -285,6 +285,8 @@ public abstract class HardwareRenderer { private boolean mDestroyed; private final Rect mRedrawClip = new Rect(); GlRenderer(int glVersion, boolean translucent) { mGlVersion = glVersion; mTranslucent = translucent; Loading Loading @@ -606,8 +608,13 @@ public abstract class HardwareRenderer { DisplayList displayList = view.getDisplayList(); if (displayList != null) { if (canvas.drawDisplayList(displayList)) { if (canvas.drawDisplayList(displayList, mRedrawClip)) { if (mRedrawClip.isEmpty()) { view.invalidate(); } else { view.getParent().invalidateChild(view, mRedrawClip); } mRedrawClip.setEmpty(); } } else { // Shouldn't reach here Loading Loading @@ -646,8 +653,8 @@ public abstract class HardwareRenderer { private int checkCurrent() { // TODO: Don't check the current context when we have one per UI thread // TODO: Use a threadlocal flag to know whether the surface has changed if (sEgl.eglGetCurrentContext() != sEglContext || sEgl.eglGetCurrentSurface(EGL10.EGL_DRAW) != mEglSurface) { if (!sEglContext.equals(sEgl.eglGetCurrentContext()) || !mEglSurface.equals(sEgl.eglGetCurrentSurface(EGL10.EGL_DRAW))) { if (!sEgl.eglMakeCurrent(sEglDisplay, mEglSurface, mEglSurface, sEglContext)) { fallback(true); Log.e(LOG_TAG, "eglMakeCurrent failed " + Loading core/java/android/view/ViewGroup.java +1 −1 Original line number Diff line number Diff line Loading @@ -2585,7 +2585,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } else { child.mPrivateFlags &= ~DIRTY_MASK; ((HardwareCanvas) canvas).drawDisplayList(displayList); ((HardwareCanvas) canvas).drawDisplayList(displayList, null); } } } else if (cache != null) { Loading core/java/android/webkit/WebView.java +9 −5 Original line number Diff line number Diff line Loading @@ -351,7 +351,8 @@ public class WebView extends AbsoluteLayout private ZoomManager mZoomManager; private Rect mGLRectViewport = new Rect(); private final Rect mGLRectViewport = new Rect(); private final Rect mViewRectViewport = new Rect(); private boolean mGLViewportEmpty = false; /** Loading Loading @@ -4152,7 +4153,7 @@ public class WebView extends AbsoluteLayout if (canvas.isHardwareAccelerated()) { int functor = nativeGetDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport, getScale(), extras); mGLViewportEmpty ? null : mViewRectViewport, getScale(), extras); ((HardwareCanvas) canvas).callDrawGLFunction(functor); } else { DrawFilter df = null; Loading Loading @@ -5258,6 +5259,7 @@ public class WebView extends AbsoluteLayout // Then need to invert the Y axis, just for GL View rootView = getRootView(); int rootViewHeight = rootView.getHeight(); mViewRectViewport.set(mGLRectViewport); int savedWebViewBottom = mGLRectViewport.bottom; mGLRectViewport.bottom = rootViewHeight - mGLRectViewport.top - getVisibleTitleHeight(); mGLRectViewport.top = rootViewHeight - savedWebViewBottom; Loading @@ -5265,7 +5267,8 @@ public class WebView extends AbsoluteLayout } else { mGLViewportEmpty = true; } nativeUpdateDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport); nativeUpdateDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport, mGLViewportEmpty ? null : mViewRectViewport); } /** Loading Loading @@ -8531,8 +8534,9 @@ public class WebView extends AbsoluteLayout boolean splitIfNeeded); private native void nativeDumpDisplayTree(String urlOrNull); private native boolean nativeEvaluateLayersAnimations(); private native int nativeGetDrawGLFunction(Rect rect, float scale, int extras); private native void nativeUpdateDrawGLFunction(Rect rect); private native int nativeGetDrawGLFunction(Rect rect, Rect viewRect, float scale, int extras); private native void nativeUpdateDrawGLFunction(Rect rect, Rect viewRect); private native boolean nativeDrawGL(Rect rect, float scale, int extras); private native void nativeExtendSelection(int x, int y); private native int nativeFindAll(String findLower, String findUpper, Loading Loading
core/java/android/view/GLES20Canvas.java +4 −3 Original line number Diff line number Diff line Loading @@ -245,11 +245,12 @@ class GLES20Canvas extends HardwareCanvas { private static native void nDestroyDisplayList(int displayList); @Override public boolean drawDisplayList(DisplayList displayList) { return nDrawDisplayList(mRenderer, ((GLES20DisplayList) displayList).mNativeDisplayList); public boolean drawDisplayList(DisplayList displayList, Rect dirty) { return nDrawDisplayList(mRenderer, ((GLES20DisplayList) displayList).mNativeDisplayList, dirty); } private static native boolean nDrawDisplayList(int renderer, int displayList); private static native boolean nDrawDisplayList(int renderer, int displayList, Rect dirty); /////////////////////////////////////////////////////////////////////////// // Hardware layer Loading
core/java/android/view/HardwareCanvas.java +6 −1 Original line number Diff line number Diff line Loading @@ -53,8 +53,13 @@ public abstract class HardwareCanvas extends Canvas { * Draws the specified display list onto this canvas. * * @param displayList The display list to replay. * @param dirty The dirty region to redraw in the next pass, matters only * if this method returns true, can be null. * * @return True if the content of the display list requires another * drawing pass (invalidate()), false otherwise */ abstract boolean drawDisplayList(DisplayList displayList); abstract boolean drawDisplayList(DisplayList displayList, Rect dirty); /** * Draws the specified layer onto this canvas. Loading
core/java/android/view/HardwareRenderer.java +12 −5 Original line number Diff line number Diff line Loading @@ -285,6 +285,8 @@ public abstract class HardwareRenderer { private boolean mDestroyed; private final Rect mRedrawClip = new Rect(); GlRenderer(int glVersion, boolean translucent) { mGlVersion = glVersion; mTranslucent = translucent; Loading Loading @@ -606,8 +608,13 @@ public abstract class HardwareRenderer { DisplayList displayList = view.getDisplayList(); if (displayList != null) { if (canvas.drawDisplayList(displayList)) { if (canvas.drawDisplayList(displayList, mRedrawClip)) { if (mRedrawClip.isEmpty()) { view.invalidate(); } else { view.getParent().invalidateChild(view, mRedrawClip); } mRedrawClip.setEmpty(); } } else { // Shouldn't reach here Loading Loading @@ -646,8 +653,8 @@ public abstract class HardwareRenderer { private int checkCurrent() { // TODO: Don't check the current context when we have one per UI thread // TODO: Use a threadlocal flag to know whether the surface has changed if (sEgl.eglGetCurrentContext() != sEglContext || sEgl.eglGetCurrentSurface(EGL10.EGL_DRAW) != mEglSurface) { if (!sEglContext.equals(sEgl.eglGetCurrentContext()) || !mEglSurface.equals(sEgl.eglGetCurrentSurface(EGL10.EGL_DRAW))) { if (!sEgl.eglMakeCurrent(sEglDisplay, mEglSurface, mEglSurface, sEglContext)) { fallback(true); Log.e(LOG_TAG, "eglMakeCurrent failed " + Loading
core/java/android/view/ViewGroup.java +1 −1 Original line number Diff line number Diff line Loading @@ -2585,7 +2585,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } else { child.mPrivateFlags &= ~DIRTY_MASK; ((HardwareCanvas) canvas).drawDisplayList(displayList); ((HardwareCanvas) canvas).drawDisplayList(displayList, null); } } } else if (cache != null) { Loading
core/java/android/webkit/WebView.java +9 −5 Original line number Diff line number Diff line Loading @@ -351,7 +351,8 @@ public class WebView extends AbsoluteLayout private ZoomManager mZoomManager; private Rect mGLRectViewport = new Rect(); private final Rect mGLRectViewport = new Rect(); private final Rect mViewRectViewport = new Rect(); private boolean mGLViewportEmpty = false; /** Loading Loading @@ -4152,7 +4153,7 @@ public class WebView extends AbsoluteLayout if (canvas.isHardwareAccelerated()) { int functor = nativeGetDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport, getScale(), extras); mGLViewportEmpty ? null : mViewRectViewport, getScale(), extras); ((HardwareCanvas) canvas).callDrawGLFunction(functor); } else { DrawFilter df = null; Loading Loading @@ -5258,6 +5259,7 @@ public class WebView extends AbsoluteLayout // Then need to invert the Y axis, just for GL View rootView = getRootView(); int rootViewHeight = rootView.getHeight(); mViewRectViewport.set(mGLRectViewport); int savedWebViewBottom = mGLRectViewport.bottom; mGLRectViewport.bottom = rootViewHeight - mGLRectViewport.top - getVisibleTitleHeight(); mGLRectViewport.top = rootViewHeight - savedWebViewBottom; Loading @@ -5265,7 +5267,8 @@ public class WebView extends AbsoluteLayout } else { mGLViewportEmpty = true; } nativeUpdateDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport); nativeUpdateDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport, mGLViewportEmpty ? null : mViewRectViewport); } /** Loading Loading @@ -8531,8 +8534,9 @@ public class WebView extends AbsoluteLayout boolean splitIfNeeded); private native void nativeDumpDisplayTree(String urlOrNull); private native boolean nativeEvaluateLayersAnimations(); private native int nativeGetDrawGLFunction(Rect rect, float scale, int extras); private native void nativeUpdateDrawGLFunction(Rect rect); private native int nativeGetDrawGLFunction(Rect rect, Rect viewRect, float scale, int extras); private native void nativeUpdateDrawGLFunction(Rect rect, Rect viewRect); private native boolean nativeDrawGL(Rect rect, float scale, int extras); private native void nativeExtendSelection(int x, int y); private native int nativeFindAll(String findLower, String findUpper, Loading