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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.h

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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/observer_list.h" 13 #include "base/observer_list.h"
14 #include "base/time/time.h"
14 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
15 #include "content/common/gpu/gpu_memory_manager.h" 16 #include "content/common/gpu/gpu_memory_manager.h"
16 #include "content/common/gpu/gpu_memory_manager_client.h" 17 #include "content/common/gpu/gpu_memory_manager_client.h"
17 #include "gpu/command_buffer/common/constants.h" 18 #include "gpu/command_buffer/common/constants.h"
18 #include "gpu/command_buffer/common/gpu_memory_allocation.h" 19 #include "gpu/command_buffer/common/gpu_memory_allocation.h"
19 #include "gpu/command_buffer/service/command_buffer_service.h" 20 #include "gpu/command_buffer/service/command_buffer_service.h"
20 #include "gpu/command_buffer/service/context_group.h" 21 #include "gpu/command_buffer/service/context_group.h"
21 #include "gpu/command_buffer/service/gpu_scheduler.h" 22 #include "gpu/command_buffer/service/gpu_scheduler.h"
22 #include "ipc/ipc_listener.h" 23 #include "ipc/ipc_listener.h"
23 #include "ipc/ipc_sender.h" 24 #include "ipc/ipc_sender.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 void OnCreateStreamTexture( 225 void OnCreateStreamTexture(
225 uint32 texture_id, int32 stream_id, bool* succeeded); 226 uint32 texture_id, int32 stream_id, bool* succeeded);
226 227
227 void ReportState(); 228 void ReportState();
228 229
229 // Wrapper for GpuScheduler::PutChanged that sets the crash report URL. 230 // Wrapper for GpuScheduler::PutChanged that sets the crash report URL.
230 void PutChanged(); 231 void PutChanged();
231 232
232 // Poll the command buffer to execute work. 233 // Poll the command buffer to execute work.
233 void PollWork(); 234 void PollWork();
235 void PerformWork();
234 236
235 // Whether this command buffer needs to be polled again in the future. 237 // Schedule processing of delayed work. This updates the time at which
236 bool HasMoreWork(); 238 // delayed work should be processed. |process_delayed_work_time_| is
237 239 // updated to current time + delay. Call this after processing some amount
238 void ScheduleDelayedWork(int64 delay); 240 // of delayed work.
241 void ScheduleDelayedWork(base::TimeDelta delay);
239 242
240 bool CheckContextLost(); 243 bool CheckContextLost();
241 void CheckCompleteWaits(); 244 void CheckCompleteWaits();
242 void PullTextureUpdates(uint32 sync_point); 245 void PullTextureUpdates(uint32 sync_point);
243 246
244 // The lifetime of objects of this class is managed by a GpuChannel. The 247 // The lifetime of objects of this class is managed by a GpuChannel. The
245 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they 248 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they
246 // are destroyed. So a raw pointer is safe. 249 // are destroyed. So a raw pointer is safe.
247 GpuChannel* channel_; 250 GpuChannel* channel_;
248 251
(...skipping 28 matching lines...) Expand all
277 gpu::MemoryAllocation last_memory_allocation_; 280 gpu::MemoryAllocation last_memory_allocation_;
278 281
279 GpuWatchdog* watchdog_; 282 GpuWatchdog* watchdog_;
280 283
281 base::ObserverList<DestructionObserver> destruction_observers_; 284 base::ObserverList<DestructionObserver> destruction_observers_;
282 285
283 // A queue of sync points associated with this stub. 286 // A queue of sync points associated with this stub.
284 std::deque<uint32> sync_points_; 287 std::deque<uint32> sync_points_;
285 int sync_point_wait_count_; 288 int sync_point_wait_count_;
286 289
287 bool delayed_work_scheduled_; 290 base::TimeTicks process_delayed_work_time_;
288 uint32_t previous_processed_num_; 291 uint32_t previous_processed_num_;
289 base::TimeTicks last_idle_time_; 292 base::TimeTicks last_idle_time_;
290 293
291 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; 294 scoped_refptr<gpu::PreemptionFlag> preemption_flag_;
292 295
293 LatencyInfoCallback latency_info_callback_; 296 LatencyInfoCallback latency_info_callback_;
294 297
295 GURL active_url_; 298 GURL active_url_;
296 size_t active_url_hash_; 299 size_t active_url_hash_;
297 300
298 size_t total_gpu_memory_; 301 size_t total_gpu_memory_;
299 scoped_ptr<WaitForCommandState> wait_for_token_; 302 scoped_ptr<WaitForCommandState> wait_for_token_;
300 scoped_ptr<WaitForCommandState> wait_for_get_offset_; 303 scoped_ptr<WaitForCommandState> wait_for_get_offset_;
301 304
302 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); 305 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
303 }; 306 };
304 307
305 } // namespace content 308 } // namespace content
306 309
307 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 310 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
OLDNEW
« no previous file with comments | « android_webview/browser/deferred_gpu_command_service.cc ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698