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" |
11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 12 #include "base/lazy_instance.h" |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "cc/base/scoped_ptr_algorithm.h" | 15 #include "cc/base/scoped_ptr_algorithm.h" |
15 #include "cc/layers/content_layer.h" | 16 #include "cc/layers/content_layer.h" |
16 #include "cc/layers/delegated_renderer_layer.h" | 17 #include "cc/layers/delegated_renderer_layer.h" |
17 #include "cc/layers/nine_patch_layer.h" | 18 #include "cc/layers/nine_patch_layer.h" |
18 #include "cc/layers/picture_layer.h" | 19 #include "cc/layers/picture_layer.h" |
19 #include "cc/layers/solid_color_layer.h" | 20 #include "cc/layers/solid_color_layer.h" |
20 #include "cc/layers/surface_layer.h" | 21 #include "cc/layers/surface_layer.h" |
21 #include "cc/layers/texture_layer.h" | 22 #include "cc/layers/texture_layer.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 572 |
572 void Layer::SetShowSurface( | 573 void Layer::SetShowSurface( |
573 cc::SurfaceId id, | 574 cc::SurfaceId id, |
574 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, | 575 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, |
575 const cc::SurfaceLayer::RequireCallback& require_callback, | 576 const cc::SurfaceLayer::RequireCallback& require_callback, |
576 gfx::Size frame_size_in_dip) { | 577 gfx::Size frame_size_in_dip) { |
577 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); | 578 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); |
578 | 579 |
579 scoped_refptr<cc::SurfaceLayer> new_layer = | 580 scoped_refptr<cc::SurfaceLayer> new_layer = |
580 cc::SurfaceLayer::Create(satisfy_callback, require_callback); | 581 cc::SurfaceLayer::Create(satisfy_callback, require_callback); |
581 new_layer->SetSurfaceId(id); | 582 new_layer->SetSurfaceId(id, 1.f, frame_size_in_dip); |
582 SwitchToLayer(new_layer); | 583 SwitchToLayer(new_layer); |
583 surface_layer_ = new_layer; | 584 surface_layer_ = new_layer; |
584 | 585 |
585 frame_size_in_dip_ = frame_size_in_dip; | 586 frame_size_in_dip_ = frame_size_in_dip; |
586 RecomputeDrawsContentAndUVRect(); | 587 RecomputeDrawsContentAndUVRect(); |
587 } | 588 } |
588 | 589 |
589 void Layer::SetShowSolidColorContent() { | 590 void Layer::SetShowSolidColorContent() { |
590 DCHECK_EQ(type_, LAYER_SOLID_COLOR); | 591 DCHECK_EQ(type_, LAYER_SOLID_COLOR); |
591 | 592 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 children_.end(), | 1047 children_.end(), |
1047 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1048 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
1048 collection)); | 1049 collection)); |
1049 } | 1050 } |
1050 | 1051 |
1051 bool Layer::IsAnimating() const { | 1052 bool Layer::IsAnimating() const { |
1052 return animator_.get() && animator_->is_animating(); | 1053 return animator_.get() && animator_->is_animating(); |
1053 } | 1054 } |
1054 | 1055 |
1055 } // namespace ui | 1056 } // namespace ui |
OLD | NEW |