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 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
748 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( | 748 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( |
749 sk_canvas, device_scale_factor_)); | 749 sk_canvas, device_scale_factor_)); |
750 if (delegate_) | 750 if (delegate_) |
751 delegate_->OnPaintLayer(PaintContext(canvas.get(), clip)); | 751 delegate_->OnPaintLayer(PaintContext(canvas.get(), clip)); |
752 } | 752 } |
753 | 753 |
754 scoped_refptr<cc::DisplayItemList> Layer::PaintContentsToDisplayList( | 754 scoped_refptr<cc::DisplayItemList> Layer::PaintContentsToDisplayList( |
755 const gfx::Rect& clip, | 755 const gfx::Rect& clip, |
756 ContentLayerClient::PaintingControlSetting painting_control) { | 756 ContentLayerClient::PaintingControlSetting painting_control) { |
757 TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_); | 757 TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_); |
758 scoped_refptr<cc::DisplayItemList> list = cc::DisplayItemList::Create(); | 758 scoped_refptr<cc::DisplayItemList> list = cc::DisplayItemList::Create(clip); |
danakj
2015/04/14 20:49:34
This is weird. Maybe cc should make the DisplayIte
ajuma
2015/04/14 21:51:27
Done. This approach seems a lot cleaner.
| |
759 if (delegate_) { | 759 if (delegate_) { |
760 // TODO(danakj): Save the invalidation on the layer and pass that down | 760 // TODO(danakj): Save the invalidation on the layer and pass that down |
761 // instead of the |clip| here. That will break everything until View | 761 // instead of the |clip| here. That will break everything until View |
762 // early-outs emit cached display items instead of nothing. | 762 // early-outs emit cached display items instead of nothing. |
763 gfx::Rect invalidation = clip; | 763 gfx::Rect invalidation = clip; |
764 DCHECK(clip.Contains(invalidation)); | 764 DCHECK(clip.Contains(invalidation)); |
765 delegate_->OnPaintLayer( | 765 delegate_->OnPaintLayer( |
766 PaintContext(list.get(), device_scale_factor_, clip, invalidation)); | 766 PaintContext(list.get(), device_scale_factor_, clip, invalidation)); |
767 } | 767 } |
768 return list; | 768 return list; |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1092 children_.end(), | 1092 children_.end(), |
1093 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1093 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
1094 collection)); | 1094 collection)); |
1095 } | 1095 } |
1096 | 1096 |
1097 bool Layer::IsAnimating() const { | 1097 bool Layer::IsAnimating() const { |
1098 return animator_.get() && animator_->is_animating(); | 1098 return animator_.get() && animator_->is_animating(); |
1099 } | 1099 } |
1100 | 1100 |
1101 } // namespace ui | 1101 } // namespace ui |
OLD | NEW |