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/json/json_writer.h" | 10 #include "base/json/json_writer.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 | |
565 bool Layer::TextureFlipped() const { | |
566 DCHECK(texture_layer_.get()); | |
567 return texture_layer_->flipped(); | |
568 } | |
569 | |
570 void Layer::SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider, | 560 void Layer::SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider, |
571 gfx::Size frame_size_in_dip) { | 561 gfx::Size frame_size_in_dip) { |
572 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); | 562 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); |
573 | 563 |
574 scoped_refptr<cc::DelegatedRendererLayer> new_layer = | 564 scoped_refptr<cc::DelegatedRendererLayer> new_layer = |
575 cc::DelegatedRendererLayer::Create(frame_provider); | 565 cc::DelegatedRendererLayer::Create(frame_provider); |
576 SwitchToLayer(new_layer); | 566 SwitchToLayer(new_layer); |
577 delegated_renderer_layer_ = new_layer; | 567 delegated_renderer_layer_ = new_layer; |
578 | 568 |
579 frame_size_in_dip_ = frame_size_in_dip; | 569 frame_size_in_dip_ = frame_size_in_dip; |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 children_.end(), | 1056 children_.end(), |
1067 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1057 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
1068 collection)); | 1058 collection)); |
1069 } | 1059 } |
1070 | 1060 |
1071 bool Layer::IsAnimating() const { | 1061 bool Layer::IsAnimating() const { |
1072 return animator_.get() && animator_->is_animating(); | 1062 return animator_.get() && animator_->is_animating(); |
1073 } | 1063 } |
1074 | 1064 |
1075 } // namespace ui | 1065 } // namespace ui |
OLD | NEW |