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

Unified Diff: cc/layers/picture_layer.cc

Issue 181063022: cc: Trigger GPU rasterization based on a per-layer hint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use a single switch with string values Created 6 years, 10 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/layers/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index 6707307da9ab8c24b7ea1f81c58267c60541e967..5bdfa8cb3dcc14cbbf2e374722e267d227bb639f 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -20,6 +20,7 @@ PictureLayer::PictureLayer(ContentLayerClient* client)
pile_(make_scoped_refptr(new PicturePile())),
instrumentation_object_tracker_(id()),
is_mask_(false),
+ has_gpu_rasterization_hint_(false),
update_source_frame_number_(-1) {
}
@@ -51,6 +52,8 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
}
layer_impl->SetIsMask(is_mask_);
+ layer_impl->SetHasGpuRasterizationHint(has_gpu_rasterization_hint_);
+
// Unlike other properties, invalidation must always be set on layer_impl.
// See PictureLayerImpl::PushPropertiesTo for more details.
layer_impl->invalidation_.Clear();
@@ -134,6 +137,14 @@ void PictureLayer::SetIsMask(bool is_mask) {
is_mask_ = is_mask;
}
+void PictureLayer::SetHasGpuRasterizationHint(bool has_hint) {
+ DCHECK(IsPropertyChangeAllowed());
+ if (has_gpu_rasterization_hint_ == has_hint)
+ return;
+ has_gpu_rasterization_hint_ = has_hint;
+ SetNeedsCommit();
+}
+
bool PictureLayer::SupportsLCDText() const {
return true;
}

Powered by Google App Engine
This is Rietveld 408576698