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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 if (scale_factor) | 521 if (scale_factor) |
522 *scale_factor = mailbox_scale_factor_; | 522 *scale_factor = mailbox_scale_factor_; |
523 return mailbox_; | 523 return mailbox_; |
524 } | 524 } |
525 | 525 |
526 void Layer::SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider, | 526 void Layer::SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider, |
527 gfx::Size frame_size_in_dip) { | 527 gfx::Size frame_size_in_dip) { |
528 DCHECK_EQ(type_, LAYER_TEXTURED); | 528 DCHECK_EQ(type_, LAYER_TEXTURED); |
529 | 529 |
530 scoped_refptr<cc::DelegatedRendererLayer> new_layer = | 530 scoped_refptr<cc::DelegatedRendererLayer> new_layer = |
531 cc::DelegatedRendererLayer::Create(NULL, frame_provider); | 531 cc::DelegatedRendererLayer::Create(frame_provider); |
532 SwitchToLayer(new_layer); | 532 SwitchToLayer(new_layer); |
533 delegated_renderer_layer_ = new_layer; | 533 delegated_renderer_layer_ = new_layer; |
534 layer_updated_externally_ = true; | 534 layer_updated_externally_ = true; |
535 | 535 |
536 delegated_frame_size_in_dip_ = frame_size_in_dip; | 536 delegated_frame_size_in_dip_ = frame_size_in_dip; |
537 RecomputeDrawsContentAndUVRect(); | 537 RecomputeDrawsContentAndUVRect(); |
538 } | 538 } |
539 | 539 |
540 void Layer::SetShowPaintedContent() { | 540 void Layer::SetShowPaintedContent() { |
541 if (content_layer_.get()) | 541 if (content_layer_.get()) |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); | 957 cc_layer_->SetBounds(ConvertSizeToPixel(this, size)); |
958 } | 958 } |
959 | 959 |
960 void Layer::RecomputePosition() { | 960 void Layer::RecomputePosition() { |
961 cc_layer_->SetPosition(gfx::ScalePoint( | 961 cc_layer_->SetPosition(gfx::ScalePoint( |
962 gfx::PointF(bounds_.x(), bounds_.y()), | 962 gfx::PointF(bounds_.x(), bounds_.y()), |
963 device_scale_factor_)); | 963 device_scale_factor_)); |
964 } | 964 } |
965 | 965 |
966 } // namespace ui | 966 } // namespace ui |
OLD | NEW |