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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 void Layer::SetShowSurface( | 658 void Layer::SetShowSurface( |
659 const cc::SurfaceId& surface_id, | 659 const cc::SurfaceId& surface_id, |
660 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, | 660 const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, |
661 const cc::SurfaceLayer::RequireCallback& require_callback, | 661 const cc::SurfaceLayer::RequireCallback& require_callback, |
662 const gfx::Size& surface_size_in_pixels, | 662 const gfx::Size& surface_size_in_pixels, |
663 float scale) { | 663 float scale) { |
664 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); | 664 DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); |
665 | 665 |
666 scoped_refptr<cc::SurfaceLayer> new_layer = | 666 scoped_refptr<cc::SurfaceLayer> new_layer = |
667 cc::SurfaceLayer::Create(satisfy_callback, require_callback); | 667 cc::SurfaceLayer::Create(satisfy_callback, require_callback); |
668 new_layer->SetSurfaceId(surface_id, scale, surface_size_in_pixels); | 668 new_layer->SetSurfaceId(surface_id, scale, surface_size_in_pixels, |
| 669 false /* stretch_content_to_fill_bounds */); |
669 SwitchToLayer(new_layer); | 670 SwitchToLayer(new_layer); |
670 surface_layer_ = new_layer; | 671 surface_layer_ = new_layer; |
671 | 672 |
672 frame_size_in_dip_ = gfx::ConvertSizeToDIP(scale, surface_size_in_pixels); | 673 frame_size_in_dip_ = gfx::ConvertSizeToDIP(scale, surface_size_in_pixels); |
673 RecomputeDrawsContentAndUVRect(); | 674 RecomputeDrawsContentAndUVRect(); |
674 | 675 |
675 for (const auto& mirror : mirrors_) { | 676 for (const auto& mirror : mirrors_) { |
676 mirror->dest()->SetShowSurface(surface_id, satisfy_callback, | 677 mirror->dest()->SetShowSurface(surface_id, satisfy_callback, |
677 require_callback, surface_size_in_pixels, | 678 require_callback, surface_size_in_pixels, |
678 scale); | 679 scale); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), | 1173 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), |
1173 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { | 1174 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { |
1174 return mirror_ptr.get() == mirror; | 1175 return mirror_ptr.get() == mirror; |
1175 }); | 1176 }); |
1176 | 1177 |
1177 DCHECK(it != mirrors_.end()); | 1178 DCHECK(it != mirrors_.end()); |
1178 mirrors_.erase(it); | 1179 mirrors_.erase(it); |
1179 } | 1180 } |
1180 | 1181 |
1181 } // namespace ui | 1182 } // namespace ui |
OLD | NEW |