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 #ifndef ANDROID_WEBVIEW_BROWSER_DEFERRED_GPU_COMMAND_SERVICE_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_DEFERRED_GPU_COMMAND_SERVICE_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_DEFERRED_GPU_COMMAND_SERVICE_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_DEFERRED_GPU_COMMAND_SERVICE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 public base::RefCountedThreadSafe<DeferredGpuCommandService> { | 39 public base::RefCountedThreadSafe<DeferredGpuCommandService> { |
40 public: | 40 public: |
41 static void SetInstance(); | 41 static void SetInstance(); |
42 static DeferredGpuCommandService* GetInstance(); | 42 static DeferredGpuCommandService* GetInstance(); |
43 | 43 |
44 void ScheduleTask(const base::Closure& task) override; | 44 void ScheduleTask(const base::Closure& task) override; |
45 void ScheduleIdleWork(const base::Closure& task) override; | 45 void ScheduleIdleWork(const base::Closure& task) override; |
46 bool UseVirtualizedGLContexts() override; | 46 bool UseVirtualizedGLContexts() override; |
47 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache() | 47 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache() |
48 override; | 48 override; |
| 49 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> |
| 50 framebuffer_completeness_cache() override; |
49 gpu::SyncPointManager* sync_point_manager() override; | 51 gpu::SyncPointManager* sync_point_manager() override; |
50 | 52 |
51 void RunTasks(); | 53 void RunTasks(); |
52 // If |is_idle| is false, this will only run older idle tasks. | 54 // If |is_idle| is false, this will only run older idle tasks. |
53 void PerformIdleWork(bool is_idle); | 55 void PerformIdleWork(bool is_idle); |
54 // Flush the idle queue until it is empty. This is different from | 56 // Flush the idle queue until it is empty. This is different from |
55 // PerformIdleWork(is_idle = true), which does not run any newly scheduled | 57 // PerformIdleWork(is_idle = true), which does not run any newly scheduled |
56 // idle tasks during the idle run. | 58 // idle tasks during the idle run. |
57 void PerformAllIdleWork(); | 59 void PerformAllIdleWork(); |
58 | 60 |
(...skipping 10 matching lines...) Expand all Loading... |
69 | 71 |
70 DeferredGpuCommandService(); | 72 DeferredGpuCommandService(); |
71 size_t IdleQueueSize(); | 73 size_t IdleQueueSize(); |
72 | 74 |
73 base::Lock tasks_lock_; | 75 base::Lock tasks_lock_; |
74 std::queue<base::Closure> tasks_; | 76 std::queue<base::Closure> tasks_; |
75 std::queue<std::pair<base::Time, base::Closure> > idle_tasks_; | 77 std::queue<std::pair<base::Time, base::Closure> > idle_tasks_; |
76 | 78 |
77 scoped_ptr<gpu::SyncPointManager> sync_point_manager_; | 79 scoped_ptr<gpu::SyncPointManager> sync_point_manager_; |
78 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 80 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 81 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> |
| 82 framebuffer_completeness_cache_; |
79 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); | 83 DISALLOW_COPY_AND_ASSIGN(DeferredGpuCommandService); |
80 }; | 84 }; |
81 | 85 |
82 } // namespace android_webview | 86 } // namespace android_webview |
83 | 87 |
84 #endif // ANDROID_WEBVIEW_BROWSER_DEFERRED_GPU_COMMAND_SERVICE_H_ | 88 #endif // ANDROID_WEBVIEW_BROWSER_DEFERRED_GPU_COMMAND_SERVICE_H_ |
OLD | NEW |