Index: cc/texture_layer.cc |
diff --git a/cc/texture_layer.cc b/cc/texture_layer.cc |
index ffb22ac0ed9dee71993e9b3afe0befd5a93650e5..05d757a6a7d929db7ceb14ada493137ff7ffad71 100644 |
--- a/cc/texture_layer.cc |
+++ b/cc/texture_layer.cc |
@@ -26,15 +26,15 @@ 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::Create(TextureLayerClient* client, bool single_buffer) { |
+ return scoped_refptr<TextureLayer>(new TextureLayer(client, false, single_buffer)); |
} |
scoped_refptr<TextureLayer> TextureLayer::CreateForMailbox() { |
- return scoped_refptr<TextureLayer>(new TextureLayer(NULL, true)); |
+ return scoped_refptr<TextureLayer>(new TextureLayer(NULL, true, false)); |
} |
-TextureLayer::TextureLayer(TextureLayerClient* client, bool uses_mailbox) |
+TextureLayer::TextureLayer(TextureLayerClient* client, bool uses_mailbox, bool single_buffer) |
: Layer(), |
client_(client), |
uses_mailbox_(uses_mailbox), |
@@ -46,7 +46,8 @@ TextureLayer::TextureLayer(TextureLayerClient* client, bool uses_mailbox) |
context_lost_(false), |
texture_id_(0), |
content_committed_(false), |
- own_mailbox_(false) { |
+ own_mailbox_(false), |
+ single_buffer_(single_buffer) { |
vertex_opacity_[0] = 1.0f; |
vertex_opacity_[1] = 1.0f; |
vertex_opacity_[2] = 1.0f; |
@@ -192,9 +193,11 @@ void TextureLayer::PushPropertiesTo(LayerImpl* layer) { |
bool TextureLayer::BlocksPendingCommit() const { |
// Double-buffered texture layers need to be blocked until they can be made |
- // triple-buffered. Single-buffered layers already prevent draws, so |
- // can block too for simplicity. |
- return DrawsContent(); |
+ // triple-buffered. Single-buffered layers already prevent draws. |
+ if (single_buffer_) |
+ return false; |
+ else |
+ return DrawsContent(); |
} |
bool TextureLayer::CanClipSelf() const { |