From 00144be011338276839a08a66ae79b14629b268b Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Tue, 28 Feb 2012 16:27:47 -0800 Subject: Cleanup GL resource for HTML5 Video. Refactor the code such that the shared resources are in the VideoLayerManager now. Get rid of the solid color texture and use pure color shader. bug:6079959 Change-Id: I0d1ce50157fb2ed083b9cc80464a1e61fa8e159f --- Source/WebKit/android/nav/WebView.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Source/WebKit/android/nav/WebView.cpp') diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index 132ed98..687f6b2 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -1418,14 +1418,16 @@ static void nativeOnTrimMemory(JNIEnv *env, jobject obj, jint level) // make sure the transfer queue is empty and then abandon the Surface // Texture to avoid ANR b/c framework may destroy the EGL context. // Refer to WindowManagerImpl.java for conditions we followed. + TilesManager* tilesManager = TilesManager::instance(); if (level >= TRIM_MEMORY_MODERATE - && !TilesManager::instance()->highEndGfx()) { - TilesManager::instance()->transferQueue()->emptyQueue(); - TilesManager::instance()->shader()->cleanupGLResources(); + && !tilesManager->highEndGfx()) { + tilesManager->transferQueue()->emptyQueue(); + tilesManager->shader()->cleanupGLResources(); + tilesManager->videoLayerManager()->cleanupGLResources(); } bool freeAllTextures = (level > TRIM_MEMORY_UI_HIDDEN), glTextures = true; - TilesManager::instance()->discardTextures(freeAllTextures, glTextures); + tilesManager->discardTextures(freeAllTextures, glTextures); } } -- cgit v1.1