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

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

Issue 14188053: gpu: Change Produce/ConsumeTexture to allow texture sharing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 8f97dd4af6d867b4ee96b906c8af998b186649da..30d36cd23ab3e83eea2ce858ae7cad88b62eb868 100644
--- a/gpu/command_buffer/service/mailbox_manager.h
+++ b/gpu/command_buffer/service/mailbox_manager.h
@@ -24,7 +24,7 @@ typedef signed char GLbyte;
namespace gpu {
namespace gles2 {
-class TextureDefinition;
+class Texture;
class TextureManager;
// Identifies a mailbox where a texture definition can be stored for
@@ -44,18 +44,16 @@ class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> {
// Generate a unique mailbox name signed with the manager's private key.
void GenerateMailboxName(MailboxName* name);
- // Remove the texture definition from the named mailbox and empty the mailbox.
- TextureDefinition* ConsumeTexture(unsigned target, const MailboxName& name);
+ // Look up the texture definition from the named mailbox.
+ Texture* ConsumeTexture(unsigned target, const MailboxName& name);
- // Put the texture definition in the named mailbox.
+ // Put the texture into the named mailbox.
bool ProduceTexture(unsigned target,
const MailboxName& name,
- TextureDefinition* definition,
- TextureManager* owner);
+ Texture* texture);
- // Destroy any texture definitions and mailboxes owned by the given texture
- // manager.
- void DestroyOwnedTextures(TextureManager* owner, bool have_context);
+ // Destroy any mailbox that reference the given texture.
+ void TextureDeleted(Texture* texture);
std::string private_key() {
return std::string(private_key_, sizeof(private_key_));
@@ -77,23 +75,15 @@ class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> {
static bool TargetNameLess(const TargetName& lhs, const TargetName& rhs);
- struct OwnedTextureDefinition {
- OwnedTextureDefinition(TextureDefinition* definition,
- TextureManager* owner);
- ~OwnedTextureDefinition();
- linked_ptr<TextureDefinition> definition;
- TextureManager* owner;
- };
-
typedef std::map<
TargetName,
- OwnedTextureDefinition,
+ Texture*,
std::pointer_to_binary_function<
- const TargetName&, const TargetName&, bool> > TextureDefinitionMap;
+ const TargetName&, const TargetName&, bool> > TextureMap;
char private_key_[GL_MAILBOX_SIZE_CHROMIUM / 2];
crypto::HMAC hmac_;
- TextureDefinitionMap textures_;
+ TextureMap textures_;
DISALLOW_COPY_AND_ASSIGN(MailboxManager);
};

Powered by Google App Engine
This is Rietveld 408576698