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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 550 |
551 void Layer::SetTextureSize(gfx::Size texture_size_in_dip) { | 551 void Layer::SetTextureSize(gfx::Size texture_size_in_dip) { |
552 DCHECK(texture_layer_.get()); | 552 DCHECK(texture_layer_.get()); |
553 if (frame_size_in_dip_ == texture_size_in_dip) | 553 if (frame_size_in_dip_ == texture_size_in_dip) |
554 return; | 554 return; |
555 frame_size_in_dip_ = texture_size_in_dip; | 555 frame_size_in_dip_ = texture_size_in_dip; |
556 RecomputeDrawsContentAndUVRect(); | 556 RecomputeDrawsContentAndUVRect(); |
557 texture_layer_->SetNeedsDisplay(); | 557 texture_layer_->SetNeedsDisplay(); |
558 } | 558 } |
559 | 559 |
| 560 void Layer::SetTextureFlipped(bool flipped) { |
| 561 DCHECK(texture_layer_.get()); |
| 562 texture_layer_->SetFlipped(flipped); |
| 563 } |
| 564 |
560 void Layer::SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider, | 565 void Layer::SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider, |
561 gfx::Size frame_size_in_dip) { | 566 gfx::Size frame_size_in_dip) { |
562 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); | 567 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); |
563 | 568 |
564 scoped_refptr<cc::DelegatedRendererLayer> new_layer = | 569 scoped_refptr<cc::DelegatedRendererLayer> new_layer = |
565 cc::DelegatedRendererLayer::Create(frame_provider); | 570 cc::DelegatedRendererLayer::Create(frame_provider); |
566 SwitchToLayer(new_layer); | 571 SwitchToLayer(new_layer); |
567 delegated_renderer_layer_ = new_layer; | 572 delegated_renderer_layer_ = new_layer; |
568 | 573 |
569 frame_size_in_dip_ = frame_size_in_dip; | 574 frame_size_in_dip_ = frame_size_in_dip; |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 children_.end(), | 1061 children_.end(), |
1057 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1062 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
1058 collection)); | 1063 collection)); |
1059 } | 1064 } |
1060 | 1065 |
1061 bool Layer::IsAnimating() const { | 1066 bool Layer::IsAnimating() const { |
1062 return animator_.get() && animator_->is_animating(); | 1067 return animator_.get() && animator_->is_animating(); |
1063 } | 1068 } |
1064 | 1069 |
1065 } // namespace ui | 1070 } // namespace ui |
OLD | NEW |