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

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

Issue 1077033004: cc: Make DisplayItemList::Append replay into an SkPicture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 8 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
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 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
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
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
OLDNEW
« cc/resources/display_item_list_unittest.cc ('K') | « cc/trees/layer_tree_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698