Skip to content

Commit 7a9328a

Browse files
ChrisCraikAndroid (Google) Code Review
authored andcommitted
Merge "Add temporary functor lifetime logging" into jb-dev
2 parents e5a4a3d + f8dafa1 commit 7a9328a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

core/java/android/webkit/WebViewClassic.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,6 +2069,11 @@ public void destroy() {
20692069
}
20702070

20712071
private void destroyImpl() {
2072+
int drawGLFunction = nativeGetDrawGLFunction(mNativeClass);
2073+
ViewRootImpl viewRoot = mWebView.getViewRootImpl();
2074+
Log.d(LOGTAG, String.format("destroyImpl, functor %x, viewroot == null %b, isHWAccel %b",
2075+
drawGLFunction, (viewRoot == null),
2076+
mWebView.isHardwareAccelerated()));
20722077
mCallbackProxy.blockMessages();
20732078
clearHelpers();
20742079
if (mListBoxDialog != null) {
@@ -5296,9 +5301,12 @@ public void onDetachedFromWindow() {
52965301

52975302
updateHwAccelerated();
52985303

5304+
int drawGLFunction = nativeGetDrawGLFunction(mNativeClass);
5305+
ViewRootImpl viewRoot = mWebView.getViewRootImpl();
5306+
Log.d(LOGTAG, String.format("destroyImpl, functor %x, viewroot == null %b, isHWAccel %b",
5307+
drawGLFunction, (viewRoot == null),
5308+
mWebView.isHardwareAccelerated()));
52995309
if (mWebView.isHardwareAccelerated()) {
5300-
int drawGLFunction = nativeGetDrawGLFunction(mNativeClass);
5301-
ViewRootImpl viewRoot = mWebView.getViewRootImpl();
53025310
if (drawGLFunction != 0 && viewRoot != null) {
53035311
viewRoot.detachFunctor(drawGLFunction);
53045312
}

libs/hwui/OpenGLRenderer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ void OpenGLRenderer::resume() {
262262
}
263263

264264
void OpenGLRenderer::detachFunctor(Functor* functor) {
265+
ALOGD("opengl renderer %p detaching functor %p", this, functor);
265266
mFunctors.remove(functor);
266267
}
267268

@@ -309,7 +310,7 @@ status_t OpenGLRenderer::invokeFunctors(Rect& dirty) {
309310

310311
status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& dirty) {
311312
interrupt();
312-
detachFunctor(functor);
313+
mFunctors.remove(functor);
313314

314315
if (mDirtyClip) {
315316
setScissorFromClip();

0 commit comments

Comments
 (0)