Skip to content

Commit 3ea8761

Browse files
jreckAndroid (Google) Code Review
authored andcommitted
Merge "Fix crash in setNewPicture" into jb-dev
2 parents 02d7e48 + 579f4e9 commit 3ea8761

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

core/java/android/webkit/WebViewClassic.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7887,14 +7887,14 @@ void setNewPicture(final WebViewCore.DrawData draw, boolean updateBaseLayer) {
78877887
mSendScrollEvent = true;
78887888

78897889
int functor = 0;
7890-
if (mWebView.isHardwareAccelerated()
7891-
|| mWebView.getLayerType() != View.LAYER_TYPE_HARDWARE) {
7890+
ViewRootImpl viewRoot = mWebView.getViewRootImpl();
7891+
if (mWebView.isHardwareAccelerated() && viewRoot != null) {
78927892
functor = nativeGetDrawGLFunction(mNativeClass);
7893+
viewRoot.attachFunctor(functor);
78937894
}
78947895

7895-
if (functor != 0) {
7896-
mWebView.getViewRootImpl().attachFunctor(functor);
7897-
} else {
7896+
if (functor == 0
7897+
|| mWebView.getLayerType() != View.LAYER_TYPE_NONE) {
78987898
// invalidate the screen so that the next repaint will show new content
78997899
// TODO: partial invalidate
79007900
mWebView.invalidate();

0 commit comments

Comments
 (0)