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

Unified Diff: gpu/command_buffer/service/mailbox_manager.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
Index: gpu/command_buffer/service/mailbox_manager.h
diff --git a/gpu/command_buffer/service/mailbox_manager.h b/gpu/command_buffer/service/mailbox_manager.h
index a00b9652bfa1f8f11464d2a9125c2e51722dc5c0..8b53ce4c14da0a3074f173a6f28983d1116de46f 100644
--- a/gpu/command_buffer/service/mailbox_manager.h
+++ b/gpu/command_buffer/service/mailbox_manager.h
@@ -1,85 +1,48 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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_H_
#define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_H_
-#include <functional>
-#include <map>
-
-#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/gpu_export.h"
-typedef signed char GLbyte;
-
namespace gpu {
namespace gles2 {
-class MailboxSynchronizer;
class Texture;
-class TextureManager;
// Manages resources scoped beyond the context or context group level.
class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> {
public:
- MailboxManager();
-
// Look up the texture definition from the named mailbox.
- Texture* ConsumeTexture(unsigned target, const Mailbox& mailbox);
+ virtual Texture* ConsumeTexture(const Mailbox& mailbox) = 0;
// Put the texture into the named mailbox.
- void ProduceTexture(unsigned target,
- const Mailbox& mailbox,
- Texture* texture);
+ virtual void ProduceTexture(const Mailbox& mailbox, Texture* texture) = 0;
- // Returns whether this manager synchronizes with other instances.
- bool UsesSync() { return sync_ != NULL; }
+ // If |true| then Pull/PushTextureUpdates() needs to be called.
+ virtual bool UsesSync() = 0;
- // Used with the MailboxSynchronizer to push/pull texture state to/from
- // other manager instances.
- void PushTextureUpdates(uint32 sync_point);
- void PullTextureUpdates(uint32 sync_point);
+ // Used to synchronize texture state across share groups.
+ virtual void PushTextureUpdates(uint32 sync_point) = 0;
+ virtual void PullTextureUpdates(uint32 sync_point) = 0;
// Destroy any mailbox that reference the given texture.
- void TextureDeleted(Texture* texture);
+ virtual void TextureDeleted(Texture* texture) = 0;
+
+ protected:
+ MailboxManager() {}
+ virtual ~MailboxManager() {}
private:
friend class base::RefCounted<MailboxManager>;
- friend class MailboxSynchronizer;
-
- ~MailboxManager();
-
- struct TargetName {
- TargetName(unsigned target, const Mailbox& mailbox);
- unsigned target;
- Mailbox mailbox;
- };
- void InsertTexture(TargetName target_name, Texture* texture);
-
- static bool TargetNameLess(const TargetName& lhs, const TargetName& rhs);
-
- // 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*, TargetName> TextureToMailboxMap;
- typedef std::map<TargetName,
- TextureToMailboxMap::iterator,
- std::pointer_to_binary_function<const TargetName&,
- const TargetName&,
- bool> > MailboxToTextureMap;
-
- MailboxToTextureMap mailbox_to_textures_;
- TextureToMailboxMap textures_to_mailboxes_;
-
- MailboxSynchronizer* sync_;
DISALLOW_COPY_AND_ASSIGN(MailboxManager);
};
+
} // namespage gles2
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.cc ('k') | gpu/command_buffer/service/mailbox_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698