OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 manager->DidDrawGL(renderer_manager_key_); | 355 manager->DidDrawGL(renderer_manager_key_); |
356 } | 356 } |
357 } | 357 } |
358 | 358 |
359 ScopedAppGLStateRestore state_restore( | 359 ScopedAppGLStateRestore state_restore( |
360 draw_info->mode == AwDrawGLInfo::kModeDraw | 360 draw_info->mode == AwDrawGLInfo::kModeDraw |
361 ? ScopedAppGLStateRestore::MODE_DRAW | 361 ? ScopedAppGLStateRestore::MODE_DRAW |
362 : ScopedAppGLStateRestore::MODE_RESOURCE_MANAGEMENT); | 362 : ScopedAppGLStateRestore::MODE_RESOURCE_MANAGEMENT); |
363 ScopedAllowGL allow_gl; | 363 ScopedAllowGL allow_gl; |
364 | 364 |
| 365 if (draw_info->mode == AwDrawGLInfo::kModeProcess || |
| 366 draw_info->mode == AwDrawGLInfo::kModeProcessNoContext) { |
| 367 shared_renderer_state_.DidDrawGLProcess(); |
| 368 } |
| 369 |
365 if (shared_renderer_state_.IsInsideHardwareRelease()) { | 370 if (shared_renderer_state_.IsInsideHardwareRelease()) { |
366 hardware_renderer_.reset(); | 371 hardware_renderer_.reset(); |
367 // Flush the idle queue in tear down. | 372 // Flush the idle queue in tear down. |
368 DeferredGpuCommandService::GetInstance()->PerformIdleWork(true); | 373 DeferredGpuCommandService::GetInstance()->PerformAllIdleWork(); |
369 DCHECK(!DeferredGpuCommandService::GetInstance()->HasIdleWork()); | |
370 return; | 374 return; |
371 } | 375 } |
372 | 376 |
373 if (draw_info->mode != AwDrawGLInfo::kModeDraw) { | 377 if (draw_info->mode != AwDrawGLInfo::kModeDraw) { |
374 if (draw_info->mode == AwDrawGLInfo::kModeProcess) { | 378 if (draw_info->mode == AwDrawGLInfo::kModeProcess) { |
375 DeferredGpuCommandService::GetInstance()->PerformIdleWork(true); | 379 DeferredGpuCommandService::GetInstance()->PerformIdleWork(true); |
376 } | 380 } |
377 return; | 381 return; |
378 } | 382 } |
379 | 383 |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 } | 1168 } |
1165 | 1169 |
1166 browser_view_renderer_.TrimMemory(level, visible); | 1170 browser_view_renderer_.TrimMemory(level, visible); |
1167 } | 1171 } |
1168 | 1172 |
1169 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1173 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
1170 g_should_download_favicons = true; | 1174 g_should_download_favicons = true; |
1171 } | 1175 } |
1172 | 1176 |
1173 } // namespace android_webview | 1177 } // namespace android_webview |
OLD | NEW |