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

Unified Diff: ui/compositor/layer.cc

Issue 2921353003: [Merge to M60] Cloning a ui::Layer should also clone its target temperature (Closed)
Patch Set: Created 3 years, 6 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 | « ui/compositor/layer.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 8e6138549251fe4adfee427cd6283498c2d8af42..b4a5242be760fd4a3f34e9f0107ffe901440f82f 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -169,6 +169,7 @@ std::unique_ptr<Layer> Layer::Clone() const {
clone->SetBackgroundZoom(zoom_, zoom_inset_);
// Filters.
+ clone->SetLayerTemperature(GetTargetTemperature());
clone->SetLayerSaturation(layer_saturation_);
clone->SetLayerBrightness(GetTargetBrightness());
clone->SetLayerGrayscale(GetTargetGrayscale());
@@ -382,6 +383,14 @@ void Layer::SetLayerTemperature(float value) {
GetAnimator()->SetTemperature(value);
}
+float Layer::GetTargetTemperature() const {
+ if (animator_ &&
+ animator_->IsAnimatingProperty(LayerAnimationElement::TEMPERATURE)) {
+ return animator_->GetTargetTemperature();
+ }
+ return layer_temperature();
+}
+
void Layer::SetBackgroundBlur(int blur_radius) {
background_blur_radius_ = blur_radius;
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698