Chromium Code Reviews| 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 572 void Layer::SetShowSurface( | 572 void Layer::SetShowSurface( |
| 573 cc::SurfaceId surface_id, | 573 cc::SurfaceId surface_id, |
| 574 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, | 574 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, |
| 575 const cc::SurfaceLayer::RequireCallback& require_callback, | 575 const cc::SurfaceLayer::RequireCallback& require_callback, |
| 576 gfx::Size surface_size, | 576 gfx::Size surface_size, |
| 577 gfx::Size frame_size_in_dip) { | 577 gfx::Size frame_size_in_dip) { |
| 578 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); | 578 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); |
| 579 | 579 |
| 580 scoped_refptr<cc::SurfaceLayer> new_layer = | 580 scoped_refptr<cc::SurfaceLayer> new_layer = |
| 581 cc::SurfaceLayer::Create(satisfy_callback, require_callback); | 581 cc::SurfaceLayer::Create(satisfy_callback, require_callback); |
| 582 new_layer->SetSurfaceId(surface_id, surface_size); | 582 float scale = |
| 583 frame_size_in_dip.width() > 0 | |
| 584 ? static_cast<float>(surface_size.width()) / frame_size_in_dip.width() | |
| 585 : 1.f; | |
|
piman
2014/11/12 02:36:57
Any reason we're not passing the renderer's DSF in
| |
| 586 new_layer->SetSurfaceId(surface_id, scale, surface_size); | |
| 583 SwitchToLayer(new_layer); | 587 SwitchToLayer(new_layer); |
| 584 surface_layer_ = new_layer; | 588 surface_layer_ = new_layer; |
| 585 | 589 |
| 586 frame_size_in_dip_ = frame_size_in_dip; | 590 frame_size_in_dip_ = frame_size_in_dip; |
| 587 RecomputeDrawsContentAndUVRect(); | 591 RecomputeDrawsContentAndUVRect(); |
| 588 } | 592 } |
| 589 | 593 |
| 590 void Layer::SetShowSolidColorContent() { | 594 void Layer::SetShowSolidColorContent() { |
| 591 DCHECK_EQ(type_, LAYER_SOLID_COLOR); | 595 DCHECK_EQ(type_, LAYER_SOLID_COLOR); |
| 592 | 596 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1047 children_.end(), | 1051 children_.end(), |
| 1048 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1052 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
| 1049 collection)); | 1053 collection)); |
| 1050 } | 1054 } |
| 1051 | 1055 |
| 1052 bool Layer::IsAnimating() const { | 1056 bool Layer::IsAnimating() const { |
| 1053 return animator_.get() && animator_->is_animating(); | 1057 return animator_.get() && animator_->is_animating(); |
| 1054 } | 1058 } |
| 1055 | 1059 |
| 1056 } // namespace ui | 1060 } // namespace ui |
| OLD | NEW |