| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 "cc/layers/layer.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 470 |
| 471 void Layer::SetBackgroundFilters(const FilterOperations& filters) { | 471 void Layer::SetBackgroundFilters(const FilterOperations& filters) { |
| 472 DCHECK(IsPropertyChangeAllowed()); | 472 DCHECK(IsPropertyChangeAllowed()); |
| 473 if (inputs_.background_filters == filters) | 473 if (inputs_.background_filters == filters) |
| 474 return; | 474 return; |
| 475 inputs_.background_filters = filters; | 475 inputs_.background_filters = filters; |
| 476 SetLayerPropertyChanged(); | 476 SetLayerPropertyChanged(); |
| 477 SetNeedsCommit(); | 477 SetNeedsCommit(); |
| 478 } | 478 } |
| 479 | 479 |
| 480 void Layer::SetFiltersOrigin(const gfx::PointF& filters_origin) { |
| 481 DCHECK(IsPropertyChangeAllowed()); |
| 482 if (inputs_.filters_origin == filters_origin) |
| 483 return; |
| 484 inputs_.filters_origin = filters_origin; |
| 485 SetSubtreePropertyChanged(); |
| 486 SetNeedsCommit(); |
| 487 } |
| 488 |
| 480 void Layer::SetOpacity(float opacity) { | 489 void Layer::SetOpacity(float opacity) { |
| 481 DCHECK(IsPropertyChangeAllowed()); | 490 DCHECK(IsPropertyChangeAllowed()); |
| 482 DCHECK_GE(opacity, 0.f); | 491 DCHECK_GE(opacity, 0.f); |
| 483 DCHECK_LE(opacity, 1.f); | 492 DCHECK_LE(opacity, 1.f); |
| 484 | 493 |
| 485 if (inputs_.opacity == opacity) | 494 if (inputs_.opacity == opacity) |
| 486 return; | 495 return; |
| 487 // We need to force a property tree rebuild when opacity changes from 1 to a | 496 // We need to force a property tree rebuild when opacity changes from 1 to a |
| 488 // non-1 value or vice-versa as render surfaces can change. | 497 // non-1 value or vice-versa as render surfaces can change. |
| 489 bool force_rebuild = opacity == 1.f || inputs_.opacity == 1.f; | 498 bool force_rebuild = opacity == 1.f || inputs_.opacity == 1.f; |
| (...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1873 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1882 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
| 1874 return draw_property_utils::ScreenSpaceTransform( | 1883 return draw_property_utils::ScreenSpaceTransform( |
| 1875 this, layer_tree_->property_trees()->transform_tree); | 1884 this, layer_tree_->property_trees()->transform_tree); |
| 1876 } | 1885 } |
| 1877 | 1886 |
| 1878 LayerTree* Layer::GetLayerTree() const { | 1887 LayerTree* Layer::GetLayerTree() const { |
| 1879 return layer_tree_; | 1888 return layer_tree_; |
| 1880 } | 1889 } |
| 1881 | 1890 |
| 1882 } // namespace cc | 1891 } // namespace cc |
| OLD | NEW |