| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/compositor/layer.h" | 5 #include "ui/compositor/layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 filters.Append(cc::FilterOperation::CreateInvertFilter(1.0)); | 369 filters.Append(cc::FilterOperation::CreateInvertFilter(1.0)); |
| 370 // Brightness goes last, because the resulting colors neeed clamping, which | 370 // Brightness goes last, because the resulting colors neeed clamping, which |
| 371 // cause further color matrix filters to be applied separately. In this order, | 371 // cause further color matrix filters to be applied separately. In this order, |
| 372 // they all can be combined in a single pass. | 372 // they all can be combined in a single pass. |
| 373 if (layer_brightness_) { | 373 if (layer_brightness_) { |
| 374 filters.Append(cc::FilterOperation::CreateSaturatingBrightnessFilter( | 374 filters.Append(cc::FilterOperation::CreateSaturatingBrightnessFilter( |
| 375 layer_brightness_)); | 375 layer_brightness_)); |
| 376 } | 376 } |
| 377 if (alpha_shape_) { | 377 if (alpha_shape_) { |
| 378 filters.Append(cc::FilterOperation::CreateAlphaThresholdFilter( | 378 filters.Append(cc::FilterOperation::CreateAlphaThresholdFilter( |
| 379 *alpha_shape_, 1.f, 0.f)); | 379 *alpha_shape_, device_scale_factor_, 1.f, 0.f)); |
| 380 } | 380 } |
| 381 | 381 |
| 382 cc_layer_->SetFilters(filters); | 382 cc_layer_->SetFilters(filters); |
| 383 } | 383 } |
| 384 | 384 |
| 385 void Layer::SetLayerBackgroundFilters() { | 385 void Layer::SetLayerBackgroundFilters() { |
| 386 cc::FilterOperations filters; | 386 cc::FilterOperations filters; |
| 387 if (zoom_ != 1) | 387 if (zoom_ != 1) |
| 388 filters.Append(cc::FilterOperation::CreateZoomFilter(zoom_, zoom_inset_)); | 388 filters.Append(cc::FilterOperation::CreateZoomFilter(zoom_, zoom_inset_)); |
| 389 | 389 |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 children_.end(), | 988 children_.end(), |
| 989 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 989 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
| 990 collection)); | 990 collection)); |
| 991 } | 991 } |
| 992 | 992 |
| 993 bool Layer::IsAnimating() const { | 993 bool Layer::IsAnimating() const { |
| 994 return animator_ && animator_->is_animating(); | 994 return animator_ && animator_->is_animating(); |
| 995 } | 995 } |
| 996 | 996 |
| 997 } // namespace ui | 997 } // namespace ui |
| OLD | NEW |