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

Side by Side Diff: gpu/command_buffer/service/mailbox_manager.h

Issue 2315313003: Add a base class of Texture for interfacing with the mailbox manager. (Closed)
Patch Set: Address piman's comments Created 4 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 #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 GpuPreferences;
16 struct SyncToken; 16 struct SyncToken;
17 17
18 namespace gles2 { 18 namespace gles2 {
19 19
20 class Texture; 20 class TextureBase;
21 21
22 // Manages resources scoped beyond the context or context group level. 22 // Manages resources scoped beyond the context or context group level.
23 class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> { 23 class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> {
24 public: 24 public:
25 static scoped_refptr<MailboxManager> Create( 25 static scoped_refptr<MailboxManager> Create(
26 const GpuPreferences& gpu_preferences); 26 const GpuPreferences& gpu_preferences);
27 27
28 // Look up the texture definition from the named mailbox. 28 // Look up the texture definition from the named mailbox.
29 virtual Texture* ConsumeTexture(const Mailbox& mailbox) = 0; 29 virtual TextureBase* ConsumeTexture(const Mailbox& mailbox) = 0;
30 30
31 // Put the texture into the named mailbox. 31 // Put the texture into the named mailbox.
32 virtual void ProduceTexture(const Mailbox& mailbox, Texture* texture) = 0; 32 virtual void ProduceTexture(const Mailbox& mailbox, TextureBase* texture) = 0;
33 33
34 // If |true| then Pull/PushTextureUpdates() needs to be called. 34 // If |true| then Pull/PushTextureUpdates() needs to be called.
35 virtual bool UsesSync() = 0; 35 virtual bool UsesSync() = 0;
36 36
37 // Used to synchronize texture state across share groups. 37 // Used to synchronize texture state across share groups.
38 virtual void PushTextureUpdates(const SyncToken& token) = 0; 38 virtual void PushTextureUpdates(const SyncToken& token) = 0;
39 virtual void PullTextureUpdates(const SyncToken& token) = 0; 39 virtual void PullTextureUpdates(const SyncToken& token) = 0;
40 40
41 // Destroy any mailbox that reference the given texture. 41 // Destroy any mailbox that reference the given texture.
42 virtual void TextureDeleted(Texture* texture) = 0; 42 virtual void TextureDeleted(TextureBase* texture) = 0;
43 43
44 protected: 44 protected:
45 MailboxManager() {} 45 MailboxManager() {}
46 virtual ~MailboxManager() {} 46 virtual ~MailboxManager() {}
47 47
48 private: 48 private:
49 friend class base::RefCounted<MailboxManager>; 49 friend class base::RefCounted<MailboxManager>;
50 50
51 DISALLOW_COPY_AND_ASSIGN(MailboxManager); 51 DISALLOW_COPY_AND_ASSIGN(MailboxManager);
52 }; 52 };
53 53
54 } // namespage gles2 54 } // namespage gles2
55 } // namespace gpu 55 } // namespace gpu
56 56
57 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_ 57 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_
58 58
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/mailbox_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698