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

Unified Diff: cc/texture_layer.cc

Issue 12720022: cc: add layer usage hint to texture layer 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
« no previous file with comments | « cc/texture_layer.h ('k') | webkit/compositor_bindings/web_compositor_support_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « cc/texture_layer.h ('k') | webkit/compositor_bindings/web_compositor_support_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698