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 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 668 surface_layer_->SetPrimarySurfaceInfo(surface_info); | 668 surface_layer_->SetPrimarySurfaceInfo(surface_info); |
| 669 | 669 |
| 670 frame_size_in_dip_ = gfx::ConvertSizeToDIP(surface_info.device_scale_factor(), | 670 frame_size_in_dip_ = gfx::ConvertSizeToDIP(surface_info.device_scale_factor(), |
| 671 surface_info.size_in_pixels()); | 671 surface_info.size_in_pixels()); |
| 672 RecomputeDrawsContentAndUVRect(); | 672 RecomputeDrawsContentAndUVRect(); |
| 673 | 673 |
| 674 for (const auto& mirror : mirrors_) | 674 for (const auto& mirror : mirrors_) |
| 675 mirror->dest()->SetShowPrimarySurface(surface_info, ref_factory); | 675 mirror->dest()->SetShowPrimarySurface(surface_info, ref_factory); |
| 676 } | 676 } |
| 677 | 677 |
| 678 void Layer::SetFallbackSurface( | |
| 679 const cc::SurfaceInfo& surface_info, | |
| 680 scoped_refptr<cc::SurfaceReferenceFactory> ref_factory) { | |
|
sadrul
2017/03/31 05:23:00
It doesn't look like |ref_factory| is needed?
Fady Samuel
2017/03/31 12:51:27
Heh, you're right. It's a remnant of an old versio
| |
| 681 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); | |
| 682 DCHECK(surface_layer_); | |
| 683 | |
| 684 // TODO(fsamuel): We should compute the gutter in the display compositor. | |
| 685 surface_layer_->SetFallbackSurfaceInfo(surface_info); | |
| 686 | |
| 687 for (const auto& mirror : mirrors_) | |
| 688 mirror->dest()->SetFallbackSurface(surface_info, ref_factory); | |
| 689 } | |
| 690 | |
| 678 void Layer::SetShowSolidColorContent() { | 691 void Layer::SetShowSolidColorContent() { |
| 679 DCHECK_EQ(type_, LAYER_SOLID_COLOR); | 692 DCHECK_EQ(type_, LAYER_SOLID_COLOR); |
| 680 | 693 |
| 681 if (solid_color_layer_.get()) | 694 if (solid_color_layer_.get()) |
| 682 return; | 695 return; |
| 683 | 696 |
| 684 scoped_refptr<cc::SolidColorLayer> new_layer = cc::SolidColorLayer::Create(); | 697 scoped_refptr<cc::SolidColorLayer> new_layer = cc::SolidColorLayer::Create(); |
| 685 SwitchToLayer(new_layer); | 698 SwitchToLayer(new_layer); |
| 686 solid_color_layer_ = new_layer; | 699 solid_color_layer_ = new_layer; |
| 687 | 700 |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1176 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), | 1189 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), |
| 1177 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { | 1190 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { |
| 1178 return mirror_ptr.get() == mirror; | 1191 return mirror_ptr.get() == mirror; |
| 1179 }); | 1192 }); |
| 1180 | 1193 |
| 1181 DCHECK(it != mirrors_.end()); | 1194 DCHECK(it != mirrors_.end()); |
| 1182 mirrors_.erase(it); | 1195 mirrors_.erase(it); |
| 1183 } | 1196 } |
| 1184 | 1197 |
| 1185 } // namespace ui | 1198 } // namespace ui |
| OLD | NEW |