summaryrefslogtreecommitdiffstats
path: root/cc/texture_layer_impl.h
diff options
context:
space:
mode:
authoralexst@chromium.org <alexst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-08 15:28:46 +0000
committeralexst@chromium.org <alexst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-08 15:28:46 +0000
commitde44a15528ee0c0e85ef1f822f072ee99de64c0c (patch)
tree0f1a725fa28776d259948bdc604d027d94bdf704 /cc/texture_layer_impl.h
parent754ea8b7d01365edefd3a06a293879739011679e (diff)
downloadchromium_src-de44a15528ee0c0e85ef1f822f072ee99de64c0c.zip
chromium_src-de44a15528ee0c0e85ef1f822f072ee99de64c0c.tar.gz
chromium_src-de44a15528ee0c0e85ef1f822f072ee99de64c0c.tar.bz2
Mailbox support for texture layers.
A callback object is passed along with the mailbox name to the layer. This callback is triggered with a sync point to signal when the mailbox is no longer in use by the compositor. TextureLayerImpl packages a mailbox up as a resource on willDraw and releases it when a new mailbox is ready for consumption or when the layer is destroyed. BUG=123444 Review URL: https://chromiumcodereview.appspot.com/11638028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/texture_layer_impl.h')
-rw-r--r--cc/texture_layer_impl.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/cc/texture_layer_impl.h b/cc/texture_layer_impl.h
index 47e9ca5..7e434e44 100644
--- a/cc/texture_layer_impl.h
+++ b/cc/texture_layer_impl.h
@@ -5,6 +5,9 @@
#ifndef CC_TEXTURE_LAYER_IMPL_H_
#define CC_TEXTURE_LAYER_IMPL_H_
+#include <string>
+
+#include "base/callback.h"
#include "cc/cc_export.h"
#include "cc/layer_impl.h"
@@ -12,9 +15,9 @@ namespace cc {
class CC_EXPORT TextureLayerImpl : public LayerImpl {
public:
- static scoped_ptr<TextureLayerImpl> create(LayerTreeImpl* treeImpl, int id)
+ static scoped_ptr<TextureLayerImpl> create(LayerTreeImpl* treeImpl, int id, bool usesMailbox)
{
- return make_scoped_ptr(new TextureLayerImpl(treeImpl, id));
+ return make_scoped_ptr(new TextureLayerImpl(treeImpl, id, usesMailbox));
}
virtual ~TextureLayerImpl();
@@ -37,8 +40,10 @@ public:
// 0--3
void setVertexOpacity(const float vertexOpacity[4]);
+ void setTextureMailbox(const std::string& mailboxName, const base::Callback<void(unsigned)>& releaseCallback);
+
private:
- TextureLayerImpl(LayerTreeImpl* treeImpl, int id);
+ TextureLayerImpl(LayerTreeImpl* treeImpl, int id, bool usesMailbox);
virtual const char* layerTypeAsString() const OVERRIDE;
@@ -48,6 +53,11 @@ private:
bool m_flipped;
gfx::RectF m_uvRect;
float m_vertexOpacity[4];
+
+ bool m_hasPendingMailbox;
+ std::string m_pendingMailboxName;
+ base::Callback<void(unsigned)> m_pendingMailboxReleaseCallback;
+ bool m_usesMailbox;
};
}