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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 SkCanvas* sk_canvas, | 744 SkCanvas* sk_canvas, |
745 const gfx::Rect& clip, | 745 const gfx::Rect& clip, |
746 ContentLayerClient::PaintingControlSetting painting_control) { | 746 ContentLayerClient::PaintingControlSetting painting_control) { |
747 TRACE_EVENT1("ui", "Layer::PaintContents", "name", name_); | 747 TRACE_EVENT1("ui", "Layer::PaintContents", "name", name_); |
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 void Layer::PaintContentsToDisplayList( | 754 scoped_refptr<cc::DisplayItemList> Layer::PaintContentsToDisplayList( |
755 cc::DisplayItemList* display_list, | |
756 const gfx::Rect& clip, | 755 const gfx::Rect& clip, |
757 ContentLayerClient::PaintingControlSetting painting_control) { | 756 ContentLayerClient::PaintingControlSetting painting_control) { |
758 TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_); | 757 TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_); |
| 758 scoped_refptr<cc::DisplayItemList> list = cc::DisplayItemList::Create(); |
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(display_list, device_scale_factor_, clip, invalidation)); | 766 PaintContext(list.get(), device_scale_factor_, clip, invalidation)); |
767 } | 767 } |
| 768 return list; |
768 } | 769 } |
769 | 770 |
770 bool Layer::FillsBoundsCompletely() const { return fills_bounds_completely_; } | 771 bool Layer::FillsBoundsCompletely() const { return fills_bounds_completely_; } |
771 | 772 |
772 bool Layer::PrepareTextureMailbox( | 773 bool Layer::PrepareTextureMailbox( |
773 cc::TextureMailbox* mailbox, | 774 cc::TextureMailbox* mailbox, |
774 scoped_ptr<cc::SingleReleaseCallback>* release_callback, | 775 scoped_ptr<cc::SingleReleaseCallback>* release_callback, |
775 bool use_shared_memory) { | 776 bool use_shared_memory) { |
776 if (!mailbox_release_callback_) | 777 if (!mailbox_release_callback_) |
777 return false; | 778 return false; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 children_.end(), | 1092 children_.end(), |
1092 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1093 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
1093 collection)); | 1094 collection)); |
1094 } | 1095 } |
1095 | 1096 |
1096 bool Layer::IsAnimating() const { | 1097 bool Layer::IsAnimating() const { |
1097 return animator_.get() && animator_->is_animating(); | 1098 return animator_.get() && animator_->is_animating(); |
1098 } | 1099 } |
1099 | 1100 |
1100 } // namespace ui | 1101 } // namespace ui |
OLD | NEW |