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(const cc::SurfaceInfo& surface_info) { |
| 679 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); |
| 680 DCHECK(surface_layer_); |
| 681 |
| 682 // TODO(fsamuel): We should compute the gutter in the display compositor. |
| 683 surface_layer_->SetFallbackSurfaceInfo(surface_info); |
| 684 |
| 685 for (const auto& mirror : mirrors_) |
| 686 mirror->dest()->SetFallbackSurface(surface_info); |
| 687 } |
| 688 |
678 void Layer::SetShowSolidColorContent() { | 689 void Layer::SetShowSolidColorContent() { |
679 DCHECK_EQ(type_, LAYER_SOLID_COLOR); | 690 DCHECK_EQ(type_, LAYER_SOLID_COLOR); |
680 | 691 |
681 if (solid_color_layer_.get()) | 692 if (solid_color_layer_.get()) |
682 return; | 693 return; |
683 | 694 |
684 scoped_refptr<cc::SolidColorLayer> new_layer = cc::SolidColorLayer::Create(); | 695 scoped_refptr<cc::SolidColorLayer> new_layer = cc::SolidColorLayer::Create(); |
685 SwitchToLayer(new_layer); | 696 SwitchToLayer(new_layer); |
686 solid_color_layer_ = new_layer; | 697 solid_color_layer_ = new_layer; |
687 | 698 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), | 1187 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), |
1177 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { | 1188 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { |
1178 return mirror_ptr.get() == mirror; | 1189 return mirror_ptr.get() == mirror; |
1179 }); | 1190 }); |
1180 | 1191 |
1181 DCHECK(it != mirrors_.end()); | 1192 DCHECK(it != mirrors_.end()); |
1182 mirrors_.erase(it); | 1193 mirrors_.erase(it); |
1183 } | 1194 } |
1184 | 1195 |
1185 } // namespace ui | 1196 } // namespace ui |
OLD | NEW |