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

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

Issue 2621653002: Remove stretch_content_to_fill_bounds from cc::SurfaceLayer::SetSurfaceInfo (Closed)
Patch Set: up Created 3 years, 11 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/android/delegated_frame_host_android.cc ('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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 return texture_layer_->flipped(); 653 return texture_layer_->flipped();
654 } 654 }
655 655
656 void Layer::SetShowSurface( 656 void Layer::SetShowSurface(
657 const cc::SurfaceInfo& surface_info, 657 const cc::SurfaceInfo& surface_info,
658 scoped_refptr<cc::SurfaceReferenceFactory> ref_factory) { 658 scoped_refptr<cc::SurfaceReferenceFactory> ref_factory) {
659 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); 659 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR);
660 660
661 scoped_refptr<cc::SurfaceLayer> new_layer = 661 scoped_refptr<cc::SurfaceLayer> new_layer =
662 cc::SurfaceLayer::Create(ref_factory); 662 cc::SurfaceLayer::Create(ref_factory);
663 new_layer->SetSurfaceInfo(surface_info, 663 new_layer->SetSurfaceInfo(surface_info);
664 false /* stretch_content_to_fill_bounds */);
665 SwitchToLayer(new_layer); 664 SwitchToLayer(new_layer);
666 surface_layer_ = new_layer; 665 surface_layer_ = new_layer;
667 666
668 frame_size_in_dip_ = gfx::ConvertSizeToDIP(surface_info.device_scale_factor(), 667 frame_size_in_dip_ = gfx::ConvertSizeToDIP(surface_info.device_scale_factor(),
669 surface_info.size_in_pixels()); 668 surface_info.size_in_pixels());
670 RecomputeDrawsContentAndUVRect(); 669 RecomputeDrawsContentAndUVRect();
671 670
672 for (const auto& mirror : mirrors_) { 671 for (const auto& mirror : mirrors_) {
673 mirror->dest()->SetShowSurface(surface_info, ref_factory); 672 mirror->dest()->SetShowSurface(surface_info, ref_factory);
674 } 673 }
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1166 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1168 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1167 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1169 return mirror_ptr.get() == mirror; 1168 return mirror_ptr.get() == mirror;
1170 }); 1169 });
1171 1170
1172 DCHECK(it != mirrors_.end()); 1171 DCHECK(it != mirrors_.end());
1173 mirrors_.erase(it); 1172 mirrors_.erase(it);
1174 } 1173 }
1175 1174
1176 } // namespace ui 1175 } // namespace ui
OLDNEW
« no previous file with comments | « ui/android/delegated_frame_host_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698