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

Unified Diff: cc/texture_layer.cc

Issue 12374028: Allow WebExternalTextureLayerClient to work with mailboxes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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: cc/texture_layer.cc
diff --git a/cc/texture_layer.cc b/cc/texture_layer.cc
index ffb22ac0ed9dee71993e9b3afe0befd5a93650e5..b60a6477d71d11797a398bd22c107072a0af1a31 100644
--- a/cc/texture_layer.cc
+++ b/cc/texture_layer.cc
@@ -26,12 +26,9 @@ static void PostCallbackToMainThread(
base::Bind(&RunCallbackOnMainThread, callback, sync_point));
}
-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::Create(TextureLayerClient* client,
+ bool usesMailbox) {
piman 2013/03/14 19:54:58 nit: uses_mailbox
alexst (slow to review) 2013/03/14 20:37:06 Done.
+ return scoped_refptr<TextureLayer>(new TextureLayer(client, usesMailbox));
}
TextureLayer::TextureLayer(TextureLayerClient* client, bool uses_mailbox)
@@ -158,7 +155,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);
piman 2013/03/14 19:54:58 How hard would it be to change the BrowserPluginCo
alexst (slow to review) 2013/03/14 20:37:06 Shouldn't be too bad, I'll look into it. As far a
+ } else {
+ texture_id_ = client_->prepareTexture(*queue);
+ }
context_lost_ =
client_->context()->getGraphicsResetStatusARB() != GL_NO_ERROR;
}

Powered by Google App Engine
This is Rietveld 408576698