Chromium Code Reviews| 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 "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| 11 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
| 12 #include "content/public/browser/android/synchronous_compositor.h" | 12 #include "content/public/browser/android/synchronous_compositor.h" |
| 13 #include "gpu/command_buffer/service/framebuffer_completeness_cache.h" | |
| 13 #include "gpu/command_buffer/service/shader_translator_cache.h" | 14 #include "gpu/command_buffer/service/shader_translator_cache.h" |
| 14 #include "gpu/command_buffer/service/sync_point_manager.h" | 15 #include "gpu/command_buffer/service/sync_point_manager.h" |
| 15 | 16 |
| 16 namespace android_webview { | 17 namespace android_webview { |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 base::LazyInstance<scoped_refptr<DeferredGpuCommandService> > | 20 base::LazyInstance<scoped_refptr<DeferredGpuCommandService> > |
| 20 g_service = LAZY_INSTANCE_INITIALIZER; | 21 g_service = LAZY_INSTANCE_INITIALIZER; |
| 21 } // namespace | 22 } // namespace |
| 22 | 23 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 | 147 |
| 147 bool DeferredGpuCommandService::UseVirtualizedGLContexts() { return true; } | 148 bool DeferredGpuCommandService::UseVirtualizedGLContexts() { return true; } |
| 148 | 149 |
| 149 scoped_refptr<gpu::gles2::ShaderTranslatorCache> | 150 scoped_refptr<gpu::gles2::ShaderTranslatorCache> |
| 150 DeferredGpuCommandService::shader_translator_cache() { | 151 DeferredGpuCommandService::shader_translator_cache() { |
| 151 if (!shader_translator_cache_.get()) | 152 if (!shader_translator_cache_.get()) |
| 152 shader_translator_cache_ = new gpu::gles2::ShaderTranslatorCache; | 153 shader_translator_cache_ = new gpu::gles2::ShaderTranslatorCache; |
| 153 return shader_translator_cache_; | 154 return shader_translator_cache_; |
| 154 } | 155 } |
| 155 | 156 |
| 157 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> | |
| 158 DeferredGpuCommandService::framebuffer_completeness_cache() { | |
| 159 if (!framebuffer_completeness_cache_.get()) | |
|
boliu
2015/08/19 17:36:19
style: need braces for if with multi-line body
Tobias Sargeant
2015/08/20 11:05:13
Will fix. It was a single line until git cl format
| |
| 160 framebuffer_completeness_cache_ = | |
| 161 new gpu::gles2::FramebufferCompletenessCache; | |
| 162 return framebuffer_completeness_cache_; | |
| 163 } | |
| 164 | |
| 156 gpu::SyncPointManager* DeferredGpuCommandService::sync_point_manager() { | 165 gpu::SyncPointManager* DeferredGpuCommandService::sync_point_manager() { |
| 157 return sync_point_manager_.get(); | 166 return sync_point_manager_.get(); |
| 158 } | 167 } |
| 159 | 168 |
| 160 void DeferredGpuCommandService::RunTasks() { | 169 void DeferredGpuCommandService::RunTasks() { |
| 161 TRACE_EVENT0("android_webview", "DeferredGpuCommandService::RunTasks"); | 170 TRACE_EVENT0("android_webview", "DeferredGpuCommandService::RunTasks"); |
| 162 bool has_more_tasks; | 171 bool has_more_tasks; |
| 163 { | 172 { |
| 164 base::AutoLock lock(tasks_lock_); | 173 base::AutoLock lock(tasks_lock_); |
| 165 has_more_tasks = tasks_.size() > 0; | 174 has_more_tasks = tasks_.size() > 0; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 182 | 191 |
| 183 void DeferredGpuCommandService::AddRef() const { | 192 void DeferredGpuCommandService::AddRef() const { |
| 184 base::RefCountedThreadSafe<DeferredGpuCommandService>::AddRef(); | 193 base::RefCountedThreadSafe<DeferredGpuCommandService>::AddRef(); |
| 185 } | 194 } |
| 186 | 195 |
| 187 void DeferredGpuCommandService::Release() const { | 196 void DeferredGpuCommandService::Release() const { |
| 188 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release(); | 197 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release(); |
| 189 } | 198 } |
| 190 | 199 |
| 191 } // namespace android_webview | 200 } // namespace android_webview |
| OLD | NEW |