| 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 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 | 914 |
| 915 scoped_refptr<cc::DisplayItemList> Layer::PaintContentsToDisplayList( | 915 scoped_refptr<cc::DisplayItemList> Layer::PaintContentsToDisplayList( |
| 916 ContentLayerClient::PaintingControlSetting painting_control) { | 916 ContentLayerClient::PaintingControlSetting painting_control) { |
| 917 TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_); | 917 TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_); |
| 918 gfx::Rect local_bounds(bounds().size()); | 918 gfx::Rect local_bounds(bounds().size()); |
| 919 gfx::Rect invalidation( | 919 gfx::Rect invalidation( |
| 920 gfx::IntersectRects(paint_region_.bounds(), local_bounds)); | 920 gfx::IntersectRects(paint_region_.bounds(), local_bounds)); |
| 921 paint_region_.Clear(); | 921 paint_region_.Clear(); |
| 922 auto display_list = make_scoped_refptr(new cc::DisplayItemList); | 922 auto display_list = make_scoped_refptr(new cc::DisplayItemList); |
| 923 if (delegate_) { | 923 if (delegate_) { |
| 924 delegate_->OnPaintLayer( | 924 delegate_->OnPaintLayer(PaintContext( |
| 925 PaintContext(display_list.get(), device_scale_factor_, invalidation)); | 925 display_list.get(), device_scale_factor_, invalidation, size())); |
| 926 } | 926 } |
| 927 display_list->Finalize(); | 927 display_list->Finalize(); |
| 928 // TODO(domlaskowski): Move mirror invalidation to Layer::SchedulePaint. | 928 // TODO(domlaskowski): Move mirror invalidation to Layer::SchedulePaint. |
| 929 for (const auto& mirror : mirrors_) | 929 for (const auto& mirror : mirrors_) |
| 930 mirror->dest()->SchedulePaint(invalidation); | 930 mirror->dest()->SchedulePaint(invalidation); |
| 931 return display_list; | 931 return display_list; |
| 932 } | 932 } |
| 933 | 933 |
| 934 bool Layer::FillsBoundsCompletely() const { return fills_bounds_completely_; } | 934 bool Layer::FillsBoundsCompletely() const { return fills_bounds_completely_; } |
| 935 | 935 |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), | 1242 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), |
| 1243 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { | 1243 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { |
| 1244 return mirror_ptr.get() == mirror; | 1244 return mirror_ptr.get() == mirror; |
| 1245 }); | 1245 }); |
| 1246 | 1246 |
| 1247 DCHECK(it != mirrors_.end()); | 1247 DCHECK(it != mirrors_.end()); |
| 1248 mirrors_.erase(it); | 1248 mirrors_.erase(it); |
| 1249 } | 1249 } |
| 1250 | 1250 |
| 1251 } // namespace ui | 1251 } // namespace ui |
| OLD | NEW |