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/render_thread_manager.h" | 8 #include "android_webview/browser/render_thread_manager.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 // static | 65 // static |
66 DeferredGpuCommandService* DeferredGpuCommandService::GetInstance() { | 66 DeferredGpuCommandService* DeferredGpuCommandService::GetInstance() { |
67 DCHECK(g_service.Get().get()); | 67 DCHECK(g_service.Get().get()); |
68 return g_service.Get().get(); | 68 return g_service.Get().get(); |
69 } | 69 } |
70 | 70 |
71 DeferredGpuCommandService::DeferredGpuCommandService() | 71 DeferredGpuCommandService::DeferredGpuCommandService() |
72 : gpu::InProcessCommandBuffer::Service( | 72 : gpu::InProcessCommandBuffer::Service( |
73 content::GetGpuPreferencesFromCommandLine()), | 73 content::GetGpuPreferencesFromCommandLine()), |
74 sync_point_manager_(new gpu::SyncPointManager(true)) { | 74 sync_point_manager_(new gpu::SyncPointManager()) {} |
75 } | |
76 | 75 |
77 DeferredGpuCommandService::~DeferredGpuCommandService() { | 76 DeferredGpuCommandService::~DeferredGpuCommandService() { |
78 base::AutoLock lock(tasks_lock_); | 77 base::AutoLock lock(tasks_lock_); |
79 DCHECK(tasks_.empty()); | 78 DCHECK(tasks_.empty()); |
80 } | 79 } |
81 | 80 |
82 // This method can be called on any thread. | 81 // This method can be called on any thread. |
83 // static | 82 // static |
84 void DeferredGpuCommandService::RequestProcessGL(bool for_idle) { | 83 void DeferredGpuCommandService::RequestProcessGL(bool for_idle) { |
85 RenderThreadManager* renderer_state = | 84 RenderThreadManager* renderer_state = |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 206 |
208 void DeferredGpuCommandService::Release() const { | 207 void DeferredGpuCommandService::Release() const { |
209 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release(); | 208 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release(); |
210 } | 209 } |
211 | 210 |
212 bool DeferredGpuCommandService::BlockThreadOnWaitSyncToken() const { | 211 bool DeferredGpuCommandService::BlockThreadOnWaitSyncToken() const { |
213 return true; | 212 return true; |
214 } | 213 } |
215 | 214 |
216 } // namespace android_webview | 215 } // namespace android_webview |
OLD | NEW |