Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Unified Diff: android_webview/browser/deferred_gpu_command_service.cc

Issue 287993004: [Android WebView] Implement Ubercomp for Render Thread support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix clang compile Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/browser/deferred_gpu_command_service.h ('k') | android_webview/browser/hardware_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/deferred_gpu_command_service.cc
diff --git a/android_webview/browser/deferred_gpu_command_service.cc b/android_webview/browser/deferred_gpu_command_service.cc
index 601334ae7f923f6860811a76a163ad612ecc4585..a680c7be01fa4c719d68481ec78d182ce10ce1f0 100644
--- a/android_webview/browser/deferred_gpu_command_service.cc
+++ b/android_webview/browser/deferred_gpu_command_service.cc
@@ -41,6 +41,12 @@ void DeferredGpuCommandService::SetInstance() {
}
}
+// static
+DeferredGpuCommandService* DeferredGpuCommandService::GetInstance() {
+ DCHECK(g_service.Get().get());
+ return g_service.Get().get();
+}
+
DeferredGpuCommandService::DeferredGpuCommandService() {}
DeferredGpuCommandService::~DeferredGpuCommandService() {
@@ -48,8 +54,9 @@ DeferredGpuCommandService::~DeferredGpuCommandService() {
DCHECK(tasks_.empty());
}
+// This method can be called on any thread.
// static
-void DeferredGpuCommandService::RequestProcessGLOnUIThread() {
+void DeferredGpuCommandService::RequestProcessGL() {
SharedRendererState* renderer_state =
GLViewRendererManager::GetInstance()->GetMostRecentlyDrawn();
if (!renderer_state) {
@@ -68,7 +75,8 @@ void DeferredGpuCommandService::ScheduleTask(const base::Closure& task) {
if (ScopedAllowGL::IsAllowed()) {
RunTasks();
} else {
- RequestProcessGLOnUIThread();
+ // TODO(boliu): Improve this to avoid PostTask storm.
+ RequestProcessGL();
}
}
« no previous file with comments | « android_webview/browser/deferred_gpu_command_service.h ('k') | android_webview/browser/hardware_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698