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) { | |
| 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 // If the SurfaceLayer is NOT opaque, then the parent client should manually | |
| 686 // insert gutter layers. | |
|
sadrul
2017/03/31 01:26:20
Maybe just comment that we need to fix for gutteri
Fady Samuel
2017/03/31 01:57:43
I've gotten rid of the second sentence. We should
| |
| 687 surface_layer_->SetFallbackSurfaceInfo(surface_info); | |
| 688 | |
| 689 for (const auto& mirror : mirrors_) | |
| 690 mirror->dest()->SetFallbackSurface(surface_info, ref_factory); | |
| 691 } | |
| 692 | |
| 678 void Layer::SetShowSolidColorContent() { | 693 void Layer::SetShowSolidColorContent() { |
| 679 DCHECK_EQ(type_, LAYER_SOLID_COLOR); | 694 DCHECK_EQ(type_, LAYER_SOLID_COLOR); |
| 680 | 695 |
| 681 if (solid_color_layer_.get()) | 696 if (solid_color_layer_.get()) |
| 682 return; | 697 return; |
| 683 | 698 |
| 684 scoped_refptr<cc::SolidColorLayer> new_layer = cc::SolidColorLayer::Create(); | 699 scoped_refptr<cc::SolidColorLayer> new_layer = cc::SolidColorLayer::Create(); |
| 685 SwitchToLayer(new_layer); | 700 SwitchToLayer(new_layer); |
| 686 solid_color_layer_ = new_layer; | 701 solid_color_layer_ = new_layer; |
| 687 | 702 |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1176 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), | 1191 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), |
| 1177 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { | 1192 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { |
| 1178 return mirror_ptr.get() == mirror; | 1193 return mirror_ptr.get() == mirror; |
| 1179 }); | 1194 }); |
| 1180 | 1195 |
| 1181 DCHECK(it != mirrors_.end()); | 1196 DCHECK(it != mirrors_.end()); |
| 1182 mirrors_.erase(it); | 1197 mirrors_.erase(it); |
| 1183 } | 1198 } |
| 1184 | 1199 |
| 1185 } // namespace ui | 1200 } // namespace ui |
| OLD | NEW |