Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Side by Side Diff: ui/compositor/layer.cc

Issue 2790673003: Aura-Mus: Enable Surface Synchronization behind flag (Closed)
Patch Set: Addressed Sadrul's comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698