| 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( |
| 573 cc::SurfaceId surface_id, |
| 574 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, |
| 575 const cc::SurfaceLayer::RequireCallback& require_callback, |
| 576 gfx::Size frame_size_in_dip) { |
| 573 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); | 577 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); |
| 574 | 578 |
| 575 scoped_refptr<cc::SurfaceLayer> new_layer = cc::SurfaceLayer::Create(); | 579 scoped_refptr<cc::SurfaceLayer> new_layer = |
| 576 new_layer->SetSurfaceId(id); | 580 cc::SurfaceLayer::Create(satisfy_callback, require_callback); |
| 581 new_layer->SetSurfaceId(surface_id); |
| 577 SwitchToLayer(new_layer); | 582 SwitchToLayer(new_layer); |
| 578 surface_layer_ = new_layer; | 583 surface_layer_ = new_layer; |
| 579 | 584 |
| 580 frame_size_in_dip_ = frame_size_in_dip; | 585 frame_size_in_dip_ = frame_size_in_dip; |
| 581 RecomputeDrawsContentAndUVRect(); | 586 RecomputeDrawsContentAndUVRect(); |
| 582 } | 587 } |
| 583 | 588 |
| 584 void Layer::SetShowSolidColorContent() { | 589 void Layer::SetShowSolidColorContent() { |
| 585 DCHECK_EQ(type_, LAYER_SOLID_COLOR); | 590 DCHECK_EQ(type_, LAYER_SOLID_COLOR); |
| 586 | 591 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 children_.end(), | 1046 children_.end(), |
| 1042 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1047 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
| 1043 collection)); | 1048 collection)); |
| 1044 } | 1049 } |
| 1045 | 1050 |
| 1046 bool Layer::IsAnimating() const { | 1051 bool Layer::IsAnimating() const { |
| 1047 return animator_.get() && animator_->is_animating(); | 1052 return animator_.get() && animator_->is_animating(); |
| 1048 } | 1053 } |
| 1049 | 1054 |
| 1050 } // namespace ui | 1055 } // namespace ui |
| OLD | NEW |