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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 SwitchToLayer(new_layer); | 545 SwitchToLayer(new_layer); |
546 content_layer_ = new_layer; | 546 content_layer_ = new_layer; |
547 } | 547 } |
548 } | 548 } |
549 if (has_frame) | 549 if (has_frame) |
550 delegated_renderer_layer_->SetFrameData(frame.Pass()); | 550 delegated_renderer_layer_->SetFrameData(frame.Pass()); |
551 RecomputeDrawsContentAndUVRect(); | 551 RecomputeDrawsContentAndUVRect(); |
552 } | 552 } |
553 | 553 |
554 void Layer::TakeUnusedResourcesForChildCompositor( | 554 void Layer::TakeUnusedResourcesForChildCompositor( |
555 cc::TransferableResourceArray* list) { | 555 cc::ReturnedResourceArray* list) { |
556 if (delegated_renderer_layer_.get()) | 556 if (delegated_renderer_layer_.get()) |
557 delegated_renderer_layer_->TakeUnusedResourcesForChildCompositor(list); | 557 delegated_renderer_layer_->TakeUnusedResourcesForChildCompositor(list); |
558 } | 558 } |
559 | 559 |
560 void Layer::SetColor(SkColor color) { | 560 void Layer::SetColor(SkColor color) { |
561 GetAnimator()->SetColor(color); | 561 GetAnimator()->SetColor(color); |
562 } | 562 } |
563 | 563 |
564 bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) { | 564 bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) { |
565 if (type_ == LAYER_SOLID_COLOR || (!delegate_ && !texture_.get())) | 565 if (type_ == LAYER_SOLID_COLOR || (!delegate_ && !texture_.get())) |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); | 964 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); |
965 } | 965 } |
966 | 966 |
967 void Layer::RecomputePosition() { | 967 void Layer::RecomputePosition() { |
968 cc_layer_->SetPosition(gfx::ScalePoint( | 968 cc_layer_->SetPosition(gfx::ScalePoint( |
969 gfx::PointF(bounds_.x(), bounds_.y()), | 969 gfx::PointF(bounds_.x(), bounds_.y()), |
970 device_scale_factor_)); | 970 device_scale_factor_)); |
971 } | 971 } |
972 | 972 |
973 } // namespace ui | 973 } // namespace ui |
OLD | NEW |