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 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 void Layer::SetTextureFlipped(bool flipped) { | 559 void Layer::SetTextureFlipped(bool flipped) { |
560 DCHECK(texture_layer_.get()); | 560 DCHECK(texture_layer_.get()); |
561 texture_layer_->SetFlipped(flipped); | 561 texture_layer_->SetFlipped(flipped); |
562 } | 562 } |
563 | 563 |
564 bool Layer::TextureFlipped() const { | 564 bool Layer::TextureFlipped() const { |
565 DCHECK(texture_layer_.get()); | 565 DCHECK(texture_layer_.get()); |
566 return texture_layer_->flipped(); | 566 return texture_layer_->flipped(); |
567 } | 567 } |
568 | 568 |
| 569 void Layer::SetTextureAlpha(float alpha) { |
| 570 DCHECK(texture_layer_.get()); |
| 571 texture_layer_->SetVertexOpacity(alpha, alpha, alpha, alpha); |
| 572 } |
| 573 |
569 void Layer::SetShowSurface( | 574 void Layer::SetShowSurface( |
570 cc::SurfaceId surface_id, | 575 cc::SurfaceId surface_id, |
571 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, | 576 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, |
572 const cc::SurfaceLayer::RequireCallback& require_callback, | 577 const cc::SurfaceLayer::RequireCallback& require_callback, |
573 gfx::Size surface_size, | 578 gfx::Size surface_size, |
574 float scale, | 579 float scale, |
575 gfx::Size frame_size_in_dip) { | 580 gfx::Size frame_size_in_dip) { |
576 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); | 581 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); |
577 | 582 |
578 scoped_refptr<cc::SurfaceLayer> new_layer = | 583 scoped_refptr<cc::SurfaceLayer> new_layer = |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 if (animator_) { | 1021 if (animator_) { |
1017 animator_->ResetCompositor(compositor); | 1022 animator_->ResetCompositor(compositor); |
1018 animator_->RemoveFromCollection(collection); | 1023 animator_->RemoveFromCollection(collection); |
1019 } | 1024 } |
1020 | 1025 |
1021 for (auto* child : children_) | 1026 for (auto* child : children_) |
1022 child->ResetCompositorForAnimatorsInTree(compositor); | 1027 child->ResetCompositorForAnimatorsInTree(compositor); |
1023 } | 1028 } |
1024 | 1029 |
1025 } // namespace ui | 1030 } // namespace ui |
OLD | NEW |