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

Side by Side Diff: android_webview/browser/deferred_gpu_command_service.cc

Issue 1315713007: gpu: Reduce GL context switches used to check pending queries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 3 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 unified diff | Download patch
OLDNEW
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"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } else { 93 } else {
94 RequestProcessGL(false); 94 RequestProcessGL(false);
95 } 95 }
96 } 96 }
97 97
98 size_t DeferredGpuCommandService::IdleQueueSize() { 98 size_t DeferredGpuCommandService::IdleQueueSize() {
99 base::AutoLock lock(tasks_lock_); 99 base::AutoLock lock(tasks_lock_);
100 return idle_tasks_.size(); 100 return idle_tasks_.size();
101 } 101 }
102 102
103 void DeferredGpuCommandService::ScheduleIdleWork( 103 void DeferredGpuCommandService::ScheduleDelayedWork(
104 const base::Closure& callback) { 104 const base::Closure& callback) {
105 { 105 {
106 base::AutoLock lock(tasks_lock_); 106 base::AutoLock lock(tasks_lock_);
107 idle_tasks_.push(std::make_pair(base::Time::Now(), callback)); 107 idle_tasks_.push(std::make_pair(base::Time::Now(), callback));
108 } 108 }
109 RequestProcessGL(true); 109 RequestProcessGL(true);
110 } 110 }
111 111
112 void DeferredGpuCommandService::PerformIdleWork(bool is_idle) { 112 void DeferredGpuCommandService::PerformIdleWork(bool is_idle) {
113 TRACE_EVENT1("android_webview", 113 TRACE_EVENT1("android_webview",
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 void DeferredGpuCommandService::AddRef() const { 193 void DeferredGpuCommandService::AddRef() const {
194 base::RefCountedThreadSafe<DeferredGpuCommandService>::AddRef(); 194 base::RefCountedThreadSafe<DeferredGpuCommandService>::AddRef();
195 } 195 }
196 196
197 void DeferredGpuCommandService::Release() const { 197 void DeferredGpuCommandService::Release() const {
198 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release(); 198 base::RefCountedThreadSafe<DeferredGpuCommandService>::Release();
199 } 199 }
200 200
201 } // namespace android_webview 201 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/deferred_gpu_command_service.h ('k') | content/common/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698