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

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: Linker Fix Created 7 years, 8 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 f6f87bc3d78069ce153b48e0db814f8d1aaac421..e1ce978e8f234f979cd9b8192b4d8ae21366f9ae 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -34,8 +34,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)
@@ -70,7 +71,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) {
@@ -167,7 +171,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