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 GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "gpu/command_buffer/common/mailbox.h" | 10 #include "gpu/command_buffer/common/mailbox.h" |
11 #include "gpu/gpu_export.h" | 11 #include "gpu/gpu_export.h" |
12 | 12 |
13 namespace gpu { | 13 namespace gpu { |
14 | 14 |
| 15 struct GpuPreferences; |
15 struct SyncToken; | 16 struct SyncToken; |
16 | 17 |
17 namespace gles2 { | 18 namespace gles2 { |
18 | 19 |
19 class Texture; | 20 class Texture; |
20 | 21 |
21 // Manages resources scoped beyond the context or context group level. | 22 // Manages resources scoped beyond the context or context group level. |
22 class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> { | 23 class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> { |
23 public: | 24 public: |
24 static scoped_refptr<MailboxManager> Create(); | 25 static scoped_refptr<MailboxManager> Create( |
| 26 const GpuPreferences& gpu_preferences); |
25 | 27 |
26 // Look up the texture definition from the named mailbox. | 28 // Look up the texture definition from the named mailbox. |
27 virtual Texture* ConsumeTexture(const Mailbox& mailbox) = 0; | 29 virtual Texture* ConsumeTexture(const Mailbox& mailbox) = 0; |
28 | 30 |
29 // Put the texture into the named mailbox. | 31 // Put the texture into the named mailbox. |
30 virtual void ProduceTexture(const Mailbox& mailbox, Texture* texture) = 0; | 32 virtual void ProduceTexture(const Mailbox& mailbox, Texture* texture) = 0; |
31 | 33 |
32 // If |true| then Pull/PushTextureUpdates() needs to be called. | 34 // If |true| then Pull/PushTextureUpdates() needs to be called. |
33 virtual bool UsesSync() = 0; | 35 virtual bool UsesSync() = 0; |
34 | 36 |
(...skipping 12 matching lines...) Expand all Loading... |
47 friend class base::RefCounted<MailboxManager>; | 49 friend class base::RefCounted<MailboxManager>; |
48 | 50 |
49 DISALLOW_COPY_AND_ASSIGN(MailboxManager); | 51 DISALLOW_COPY_AND_ASSIGN(MailboxManager); |
50 }; | 52 }; |
51 | 53 |
52 } // namespage gles2 | 54 } // namespage gles2 |
53 } // namespace gpu | 55 } // namespace gpu |
54 | 56 |
55 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ | 57 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ |
56 | 58 |
OLD | NEW |