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

Unified Diff: cc/layers/texture_layer.cc

Issue 12374028: Allow WebExternalTextureLayerClient to work with mailboxes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « cc/layers/texture_layer.h ('k') | cc/layers/texture_layer_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/texture_layer.cc
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index 078b1f642834c94ca4f822a7a3d4d5cf311be2d9..1a20b107483f4c7b4683b82989b3ce05e602174d 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -30,8 +30,9 @@ scoped_refptr<TextureLayer> TextureLayer::Create(TextureLayerClient* client) {
return scoped_refptr<TextureLayer>(new TextureLayer(client, false));
}
-scoped_refptr<TextureLayer> TextureLayer::CreateForMailbox() {
- return scoped_refptr<TextureLayer>(new TextureLayer(NULL, true));
+scoped_refptr<TextureLayer> TextureLayer::CreateForMailbox(
+ TextureLayerClient* client) {
+ return scoped_refptr<TextureLayer>(new TextureLayer(client, true));
}
TextureLayer::TextureLayer(TextureLayerClient* client, bool uses_mailbox)
@@ -66,7 +67,10 @@ TextureLayer::~TextureLayer() {
void TextureLayer::ClearClient() {
client_ = NULL;
- SetTextureId(0);
+ if (uses_mailbox_)
+ SetTextureMailbox(TextureMailbox());
+ else
+ SetTextureId(0);
}
scoped_ptr<LayerImpl> TextureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
@@ -163,7 +167,13 @@ void TextureLayer::Update(ResourceUpdateQueue* queue,
const OcclusionTracker* occlusion,
RenderingStats* stats) {
if (client_) {
- texture_id_ = client_->PrepareTexture(queue);
+ if (uses_mailbox_) {
+ TextureMailbox mailbox;
+ if (client_->PrepareTextureMailbox(&mailbox))
+ SetTextureMailbox(mailbox);
+ } else {
+ texture_id_ = client_->PrepareTexture(queue);
+ }
context_lost_ =
client_->Context3d()->getGraphicsResetStatusARB() != GL_NO_ERROR;
}
« no previous file with comments | « cc/layers/texture_layer.h ('k') | cc/layers/texture_layer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698