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

Unified Diff: gpu/command_buffer/service/mailbox_manager_impl.h

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager.cc ('k') | gpu/command_buffer/service/mailbox_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/mailbox_manager_impl.h
diff --git a/gpu/command_buffer/service/mailbox_manager_impl.h b/gpu/command_buffer/service/mailbox_manager_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ea906e8f49400fca538a69397b44ee40b5cf591
--- /dev/null
+++ b/gpu/command_buffer/service/mailbox_manager_impl.h
@@ -0,0 +1,63 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_IMPL_H_
+#define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_IMPL_H_
+
+#include <map>
+#include <utility>
+
+#include "base/memory/linked_ptr.h"
+#include "base/memory/ref_counted.h"
+#include "gpu/command_buffer/common/constants.h"
+#include "gpu/command_buffer/common/mailbox.h"
+#include "gpu/command_buffer/service/mailbox_manager.h"
+#include "gpu/gpu_export.h"
+
+namespace gpu {
+namespace gles2 {
+
+class Texture;
+class TextureManager;
+
+// Manages resources scoped beyond the context or context group level.
+class GPU_EXPORT MailboxManagerImpl : public MailboxManager {
+ public:
+ MailboxManagerImpl();
+
+ // MailboxManager implementation:
+ Texture* ConsumeTexture(const Mailbox& mailbox) override;
+ void ProduceTexture(const Mailbox& mailbox, Texture* texture) override;
+ bool UsesSync() override;
+ void PushTextureUpdates(uint32 sync_point) override {}
+ void PullTextureUpdates(uint32 sync_point) override {}
+ void TextureDeleted(Texture* texture) override;
+
+ protected:
+ ~MailboxManagerImpl() override;
+
+ private:
+ friend class base::RefCounted<MailboxManager>;
+
+ void InsertTexture(const Mailbox& mailbox, Texture* texture);
+
+ // This is a bidirectional map between mailbox and textures. We can have
+ // multiple mailboxes per texture, but one texture per mailbox. We keep an
+ // iterator in the MailboxToTextureMap to be able to manage changes to
+ // the TextureToMailboxMap efficiently.
+ typedef std::multimap<Texture*, Mailbox> TextureToMailboxMap;
+ typedef std::map<Mailbox, TextureToMailboxMap::iterator>
+ MailboxToTextureMap;
+
+ MailboxToTextureMap mailbox_to_textures_;
+ TextureToMailboxMap textures_to_mailboxes_;
+
+ DISALLOW_COPY_AND_ASSIGN(MailboxManagerImpl);
+};
+
+} // namespage gles2
+} // namespace gpu
+
+#endif // GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_IMPL_H_
+
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager.cc ('k') | gpu/command_buffer/service/mailbox_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698