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

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

Issue 12717013: Add reference-counting for mailbox textures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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..b08f5c1dce261559ba3595d79cfc7bed026dfedf 100644
--- a/gpu/command_buffer/service/mailbox_manager.h
+++ b/gpu/command_buffer/service/mailbox_manager.h
@@ -25,7 +25,6 @@ namespace gpu {
namespace gles2 {
class TextureDefinition;
-class TextureManager;
// Identifies a mailbox where a texture definition can be stored for
// transferring textures between contexts that are not in the same context
@@ -50,12 +49,10 @@ class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> {
// Put the texture definition in the named mailbox.
bool ProduceTexture(unsigned target,
const MailboxName& name,
- TextureDefinition* definition,
- TextureManager* owner);
+ TextureDefinition* definition);
- // Destroy any texture definitions and mailboxes owned by the given texture
- // manager.
- void DestroyOwnedTextures(TextureManager* owner, bool have_context);
+ // Removes a texture definition from the mailbox.
+ void OnDestroyTexture(TextureDefinition* definition);
std::string private_key() {
return std::string(private_key_, sizeof(private_key_));
@@ -77,17 +74,9 @@ 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,
+ TextureDefinition*,
std::pointer_to_binary_function<
const TargetName&, const TargetName&, bool> > TextureDefinitionMap;

Powered by Google App Engine
This is Rietveld 408576698