Elim cr-checkbox
[chromium-blink-merge.git] / gpu / command_buffer / service / mailbox_manager.h
blob2bfdb8957f5215c11774100debdc147cc20838ca
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
3 // found in the LICENSE file.
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_
8 #include "base/memory/ref_counted.h"
9 #include "gpu/command_buffer/common/mailbox.h"
10 #include "gpu/gpu_export.h"
12 namespace gpu {
13 namespace gles2 {
15 class Texture;
17 // Manages resources scoped beyond the context or context group level.
18 class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> {
19 public:
20 static scoped_refptr<MailboxManager> Create();
22 // Look up the texture definition from the named mailbox.
23 virtual Texture* ConsumeTexture(const Mailbox& mailbox) = 0;
25 // Put the texture into the named mailbox.
26 virtual void ProduceTexture(const Mailbox& mailbox, Texture* texture) = 0;
28 // If |true| then Pull/PushTextureUpdates() needs to be called.
29 virtual bool UsesSync() = 0;
31 // Used to synchronize texture state across share groups.
32 virtual void PushTextureUpdates(uint32 sync_point) = 0;
33 virtual void PullTextureUpdates(uint32 sync_point) = 0;
35 // Destroy any mailbox that reference the given texture.
36 virtual void TextureDeleted(Texture* texture) = 0;
38 protected:
39 MailboxManager() {}
40 virtual ~MailboxManager() {}
42 private:
43 friend class base::RefCounted<MailboxManager>;
45 DISALLOW_COPY_AND_ASSIGN(MailboxManager);
48 } // namespage gles2
49 } // namespace gpu
51 #endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_