| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/deferred_gpu_command_service.h" | 5 #include "android_webview/browser/deferred_gpu_command_service.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/gl_view_renderer_manager.h" | 7 #include "android_webview/browser/gl_view_renderer_manager.h" |
| 8 #include "android_webview/browser/shared_renderer_state.h" | 8 #include "android_webview/browser/shared_renderer_state.h" |
| 9 #include "content/public/browser/android/synchronous_compositor.h" | 9 #include "content/public/browser/android/synchronous_compositor.h" |
| 10 #include "gpu/command_buffer/service/shader_translator_cache.h" | 10 #include "gpu/command_buffer/service/shader_translator_cache.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 // Called from different threads! | 62 // Called from different threads! |
| 63 void DeferredGpuCommandService::ScheduleTask(const base::Closure& task) { | 63 void DeferredGpuCommandService::ScheduleTask(const base::Closure& task) { |
| 64 { | 64 { |
| 65 base::AutoLock lock(tasks_lock_); | 65 base::AutoLock lock(tasks_lock_); |
| 66 tasks_.push(task); | 66 tasks_.push(task); |
| 67 } | 67 } |
| 68 if (ScopedAllowGL::IsAllowed()) { | 68 if (ScopedAllowGL::IsAllowed()) { |
| 69 RunTasks(); | 69 RunTasks(); |
| 70 } else { | 70 } else { |
| 71 // TODO(boliu): Improve this to avoid PostTask storm. |
| 71 RequestProcessGLOnUIThread(); | 72 RequestProcessGLOnUIThread(); |
| 72 } | 73 } |
| 73 } | 74 } |
| 74 | 75 |
| 75 void DeferredGpuCommandService::ScheduleIdleWork( | 76 void DeferredGpuCommandService::ScheduleIdleWork( |
| 76 const base::Closure& callback) { | 77 const base::Closure& callback) { |
| 77 // TODO(sievers): Should this do anything? | 78 // TODO(sievers): Should this do anything? |
| 78 } | 79 } |
| 79 | 80 |
| 80 bool DeferredGpuCommandService::UseVirtualizedGLContexts() { return true; } | 81 bool DeferredGpuCommandService::UseVirtualizedGLContexts() { return true; } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 110 | 111 |
| 111 void DeferredGpuCommandService::AddRef() const { | 112 void DeferredGpuCommandService::AddRef() const { |
| 112 base::RefCountedThreadSafe<DeferredGpuCommandService>::AddRef(); | 113 base::RefCountedThreadSafe<DeferredGpuCommandService>::AddRef(); |
| 113 } | 114 } |
| 114 | 115 |
| 115 void DeferredGpuCommandService::Release() const { | 116 void DeferredGpuCommandService::Release() const { |
| 116 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release(); | 117 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release(); |
| 117 } | 118 } |
| 118 | 119 |
| 119 } // namespace android_webview | 120 } // namespace android_webview |
| OLD | NEW |