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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 filters.Append(cc::FilterOperation::CreateInvertFilter(1.0)); | 371 filters.Append(cc::FilterOperation::CreateInvertFilter(1.0)); |
372 // Brightness goes last, because the resulting colors neeed clamping, which | 372 // Brightness goes last, because the resulting colors neeed clamping, which |
373 // cause further color matrix filters to be applied separately. In this order, | 373 // cause further color matrix filters to be applied separately. In this order, |
374 // they all can be combined in a single pass. | 374 // they all can be combined in a single pass. |
375 if (layer_brightness_) { | 375 if (layer_brightness_) { |
376 filters.Append(cc::FilterOperation::CreateSaturatingBrightnessFilter( | 376 filters.Append(cc::FilterOperation::CreateSaturatingBrightnessFilter( |
377 layer_brightness_)); | 377 layer_brightness_)); |
378 } | 378 } |
379 if (alpha_shape_) { | 379 if (alpha_shape_) { |
380 filters.Append(cc::FilterOperation::CreateAlphaThresholdFilter( | 380 filters.Append(cc::FilterOperation::CreateAlphaThresholdFilter( |
381 *alpha_shape_, 1.f, 0.f)); | 381 *alpha_shape_, 0.f, 0.f)); |
382 } | 382 } |
383 | 383 |
384 cc_layer_->SetFilters(filters); | 384 cc_layer_->SetFilters(filters); |
385 } | 385 } |
386 | 386 |
387 void Layer::SetLayerBackgroundFilters() { | 387 void Layer::SetLayerBackgroundFilters() { |
388 cc::FilterOperations filters; | 388 cc::FilterOperations filters; |
389 if (zoom_ != 1) | 389 if (zoom_ != 1) |
390 filters.Append(cc::FilterOperation::CreateZoomFilter(zoom_, zoom_inset_)); | 390 filters.Append(cc::FilterOperation::CreateZoomFilter(zoom_, zoom_inset_)); |
391 | 391 |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 children_.end(), | 1028 children_.end(), |
1029 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1029 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
1030 collection)); | 1030 collection)); |
1031 } | 1031 } |
1032 | 1032 |
1033 bool Layer::IsAnimating() const { | 1033 bool Layer::IsAnimating() const { |
1034 return animator_ && animator_->is_animating(); | 1034 return animator_ && animator_->is_animating(); |
1035 } | 1035 } |
1036 | 1036 |
1037 } // namespace ui | 1037 } // namespace ui |
OLD | NEW |