| 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 | 562 |
| 563 scoped_refptr<cc::DelegatedRendererLayer> new_layer = | 563 scoped_refptr<cc::DelegatedRendererLayer> new_layer = |
| 564 cc::DelegatedRendererLayer::Create(frame_provider); | 564 cc::DelegatedRendererLayer::Create(frame_provider); |
| 565 SwitchToLayer(new_layer); | 565 SwitchToLayer(new_layer); |
| 566 delegated_renderer_layer_ = new_layer; | 566 delegated_renderer_layer_ = new_layer; |
| 567 | 567 |
| 568 frame_size_in_dip_ = frame_size_in_dip; | 568 frame_size_in_dip_ = frame_size_in_dip; |
| 569 RecomputeDrawsContentAndUVRect(); | 569 RecomputeDrawsContentAndUVRect(); |
| 570 } | 570 } |
| 571 | 571 |
| 572 void Layer::SetShowSurface(cc::SurfaceId id, gfx::Size frame_size_in_dip) { | 572 void Layer::SetShowSurface(scoped_refptr<cc::SurfaceHolder> surface_holder, |
| 573 gfx::Size frame_size_in_dip) { |
| 573 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); | 574 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); |
| 574 | 575 |
| 575 scoped_refptr<cc::SurfaceLayer> new_layer = cc::SurfaceLayer::Create(); | 576 scoped_refptr<cc::SurfaceLayer> new_layer = cc::SurfaceLayer::Create(); |
| 576 new_layer->SetSurfaceId(id); | 577 new_layer->SetSurfaceId(surface_holder); |
| 577 SwitchToLayer(new_layer); | 578 SwitchToLayer(new_layer); |
| 578 surface_layer_ = new_layer; | 579 surface_layer_ = new_layer; |
| 579 | 580 |
| 580 frame_size_in_dip_ = frame_size_in_dip; | 581 frame_size_in_dip_ = frame_size_in_dip; |
| 581 RecomputeDrawsContentAndUVRect(); | 582 RecomputeDrawsContentAndUVRect(); |
| 582 } | 583 } |
| 583 | 584 |
| 584 void Layer::SetShowSolidColorContent() { | 585 void Layer::SetShowSolidColorContent() { |
| 585 DCHECK_EQ(type_, LAYER_SOLID_COLOR); | 586 DCHECK_EQ(type_, LAYER_SOLID_COLOR); |
| 586 | 587 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 children_.end(), | 1042 children_.end(), |
| 1042 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1043 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
| 1043 collection)); | 1044 collection)); |
| 1044 } | 1045 } |
| 1045 | 1046 |
| 1046 bool Layer::IsAnimating() const { | 1047 bool Layer::IsAnimating() const { |
| 1047 return animator_.get() && animator_->is_animating(); | 1048 return animator_.get() && animator_->is_animating(); |
| 1048 } | 1049 } |
| 1049 | 1050 |
| 1050 } // namespace ui | 1051 } // namespace ui |
| OLD | NEW |