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

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

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted mojo readme, changed wait() to take a pointer Created 5 years, 2 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
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/common/gpu/gpu_channel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_CHANNEL_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_H_
6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_H_ 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 18 matching lines...) Expand all
29 #include "ui/gl/gpu_preference.h" 29 #include "ui/gl/gpu_preference.h"
30 30
31 struct GPUCreateCommandBufferConfig; 31 struct GPUCreateCommandBufferConfig;
32 32
33 namespace base { 33 namespace base {
34 class WaitableEvent; 34 class WaitableEvent;
35 } 35 }
36 36
37 namespace gpu { 37 namespace gpu {
38 class PreemptionFlag; 38 class PreemptionFlag;
39 class SyncPointClientState; 39 class SyncPointOrderData;
40 class SyncPointManager; 40 class SyncPointManager;
41 union ValueState; 41 union ValueState;
42 class ValueStateMap; 42 class ValueStateMap;
43 namespace gles2 { 43 namespace gles2 {
44 class SubscriptionRefSet; 44 class SubscriptionRefSet;
45 } 45 }
46 } 46 }
47 47
48 namespace IPC { 48 namespace IPC {
49 class MessageFilter; 49 class MessageFilter;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 // Visible for testing. 166 // Visible for testing.
167 GpuChannelMessageFilter* filter() const { return filter_.get(); } 167 GpuChannelMessageFilter* filter() const { return filter_.get(); }
168 168
169 // Returns the global order number for the last processed IPC message. 169 // Returns the global order number for the last processed IPC message.
170 uint32_t GetProcessedOrderNum() const; 170 uint32_t GetProcessedOrderNum() const;
171 171
172 // Returns the global order number for the last unprocessed IPC message. 172 // Returns the global order number for the last unprocessed IPC message.
173 uint32_t GetUnprocessedOrderNum() const; 173 uint32_t GetUnprocessedOrderNum() const;
174 174
175 // Returns the shared sync point client state. 175 // Returns the shared sync point global order data.
176 scoped_refptr<gpu::SyncPointClientState> GetSyncPointClientState(); 176 scoped_refptr<gpu::SyncPointOrderData> GetSyncPointOrderData();
177 177
178 void HandleMessage(); 178 void HandleMessage();
179 179
180 // Some messages such as WaitForGetOffsetInRange and WaitForTokenInRange are 180 // Some messages such as WaitForGetOffsetInRange and WaitForTokenInRange are
181 // processed as soon as possible because the client is blocked until they 181 // processed as soon as possible because the client is blocked until they
182 // are completed. 182 // are completed.
183 void HandleOutOfOrderMessage(const IPC::Message& msg); 183 void HandleOutOfOrderMessage(const IPC::Message& msg);
184 184
185 #if defined(OS_ANDROID) 185 #if defined(OS_ANDROID)
186 const GpuCommandBufferStub* GetOneStub() const; 186 const GpuCommandBufferStub* GetOneStub() const;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessage); 403 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessage);
404 }; 404 };
405 405
406 class GpuChannelMessageQueue 406 class GpuChannelMessageQueue
407 : public base::RefCountedThreadSafe<GpuChannelMessageQueue> { 407 : public base::RefCountedThreadSafe<GpuChannelMessageQueue> {
408 public: 408 public:
409 static scoped_refptr<GpuChannelMessageQueue> Create( 409 static scoped_refptr<GpuChannelMessageQueue> Create(
410 const base::WeakPtr<GpuChannel>& gpu_channel, 410 const base::WeakPtr<GpuChannel>& gpu_channel,
411 base::SingleThreadTaskRunner* task_runner); 411 base::SingleThreadTaskRunner* task_runner);
412 412
413 scoped_refptr<gpu::SyncPointClientState> GetSyncPointClientState(); 413 scoped_refptr<gpu::SyncPointOrderData> GetSyncPointOrderData();
414 414
415 // Returns the global order number for the last unprocessed IPC message. 415 // Returns the global order number for the last unprocessed IPC message.
416 uint32_t GetUnprocessedOrderNum() const; 416 uint32_t GetUnprocessedOrderNum() const;
417 417
418 // Returns the global order number for the last unprocessed IPC message. 418 // Returns the global order number for the last unprocessed IPC message.
419 uint32_t GetProcessedOrderNum() const; 419 uint32_t GetProcessedOrderNum() const;
420 420
421 bool HasQueuedMessages() const; 421 bool HasQueuedMessages() const;
422 422
423 base::TimeTicks GetNextMessageTimeTick() const; 423 base::TimeTicks GetNextMessageTimeTick() const;
(...skipping 30 matching lines...) Expand all
454 454
455 bool enabled_; 455 bool enabled_;
456 456
457 // Both deques own the messages. 457 // Both deques own the messages.
458 std::deque<GpuChannelMessage*> channel_messages_; 458 std::deque<GpuChannelMessage*> channel_messages_;
459 459
460 // This lock protects enabled_ and channel_messages_. 460 // This lock protects enabled_ and channel_messages_.
461 mutable base::Lock channel_messages_lock_; 461 mutable base::Lock channel_messages_lock_;
462 462
463 // Keeps track of sync point related state such as message order numbers. 463 // Keeps track of sync point related state such as message order numbers.
464 scoped_refptr<gpu::SyncPointClientState> sync_point_client_state_; 464 scoped_refptr<gpu::SyncPointOrderData> sync_point_order_data_;
465 465
466 base::WeakPtr<GpuChannel> gpu_channel_; 466 base::WeakPtr<GpuChannel> gpu_channel_;
467 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 467 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
468 468
469 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageQueue); 469 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageQueue);
470 }; 470 };
471 471
472 } // namespace content 472 } // namespace content
473 473
474 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ 474 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/common/gpu/gpu_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698