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: ui/compositor/layer.cc

Issue 186123006: zero copy - NOT FOR REVIEW Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: re-upload Created 6 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: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 08988163f6fdc2053711c48c2605230e03fd0d36..37b243df818429455707bd9209a886c1c1ffc56f 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -14,6 +14,7 @@
#include "cc/base/scoped_ptr_algorithm.h"
#include "cc/layers/content_layer.h"
#include "cc/layers/delegated_renderer_layer.h"
+#include "cc/layers/picture_layer.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/layers/texture_layer.h"
#include "cc/output/copy_output_request.h"
@@ -32,6 +33,8 @@
#include "ui/gfx/point_conversions.h"
#include "ui/gfx/size_conversions.h"
+extern char GetZCopy();
+
namespace {
const ui::Layer* GetRoot(const ui::Layer* layer) {
@@ -469,7 +472,11 @@ void Layer::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) {
}
void Layer::SwitchCCLayerForTest() {
- scoped_refptr<cc::ContentLayer> new_layer = cc::ContentLayer::Create(this);
+ scoped_refptr<cc::Layer> new_layer;
+ if (GetZCopy())
+ new_layer = cc::PictureLayer::Create(this);
+ else
+ new_layer = cc::ContentLayer::Create(this);
SwitchToLayer(new_layer);
content_layer_ = new_layer;
}
@@ -536,7 +543,11 @@ void Layer::SetShowPaintedContent() {
if (content_layer_.get())
return;
- scoped_refptr<cc::ContentLayer> new_layer = cc::ContentLayer::Create(this);
+ scoped_refptr<cc::Layer> new_layer;
+ if (GetZCopy())
+ new_layer = cc::PictureLayer::Create(this);
+ else
+ new_layer = cc::ContentLayer::Create(this);
SwitchToLayer(new_layer);
content_layer_ = new_layer;
@@ -882,7 +893,10 @@ void Layer::CreateWebLayer() {
solid_color_layer_ = cc::SolidColorLayer::Create();
cc_layer_ = solid_color_layer_.get();
} else {
- content_layer_ = cc::ContentLayer::Create(this);
+ if (GetZCopy())
+ content_layer_ = cc::PictureLayer::Create(this);
+ else
+ content_layer_ = cc::ContentLayer::Create(this);
cc_layer_ = content_layer_.get();
}
cc_layer_->SetAnchorPoint(gfx::PointF());
« ui/compositor/layer.h ('K') | « ui/compositor/layer.h ('k') | ui/gfx/gpu_memory_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698