Chromium Code Reviews| 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 | 748 |
| 749 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { | 749 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { |
| 750 cc_layer_->RequestCopyOfOutput(request.Pass()); | 750 cc_layer_->RequestCopyOfOutput(request.Pass()); |
| 751 } | 751 } |
| 752 | 752 |
| 753 gfx::Rect Layer::PaintableRegion() { | 753 gfx::Rect Layer::PaintableRegion() { |
| 754 return gfx::Rect(size()); | 754 return gfx::Rect(size()); |
| 755 } | 755 } |
| 756 | 756 |
| 757 scoped_refptr<cc::DisplayItemList> Layer::PaintContentsToDisplayList( | 757 scoped_refptr<cc::DisplayItemList> Layer::PaintContentsToDisplayList( |
| 758 const gfx::Rect& clip, | |
| 759 ContentLayerClient::PaintingControlSetting painting_control) { | 758 ContentLayerClient::PaintingControlSetting painting_control) { |
| 760 TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_); | 759 TRACE_EVENT1("ui", "Layer::PaintContentsToDisplayList", "name", name_); |
| 761 gfx::Rect local_bounds(bounds().size()); | 760 gfx::Rect local_bounds(bounds().size()); |
| 762 gfx::Rect invalidation( | 761 gfx::Rect invalidation( |
| 763 gfx::IntersectRects(damaged_region_.bounds(), local_bounds)); | 762 gfx::IntersectRects(damaged_region_.bounds(), local_bounds)); |
| 764 DCHECK(clip.Contains(invalidation)); | |
| 765 ClearDamagedRects(); | 763 ClearDamagedRects(); |
| 766 cc::DisplayItemListSettings settings; | 764 cc::DisplayItemListSettings settings; |
| 767 settings.use_cached_picture = false; | 765 settings.use_cached_picture = false; |
| 768 scoped_refptr<cc::DisplayItemList> display_list = | 766 scoped_refptr<cc::DisplayItemList> display_list = |
| 769 cc::DisplayItemList::Create(clip, settings); | 767 cc::DisplayItemList::Create(PaintableRegion(), settings); |
|
enne (OOO)
2015/12/01 22:46:25
Should this as well be the valid painted rect? Or,
chrishtr
2015/12/01 23:01:20
Valid painted rect? Not sure what you mean.
Also,
| |
| 770 if (delegate_) { | 768 if (delegate_) { |
| 771 delegate_->OnPaintLayer( | 769 delegate_->OnPaintLayer( |
| 772 PaintContext(display_list.get(), device_scale_factor_, invalidation)); | 770 PaintContext(display_list.get(), device_scale_factor_, invalidation)); |
| 773 } | 771 } |
| 774 display_list->Finalize(); | 772 display_list->Finalize(); |
| 775 return display_list; | 773 return display_list; |
| 776 } | 774 } |
| 777 | 775 |
| 778 bool Layer::FillsBoundsCompletely() const { return fills_bounds_completely_; } | 776 bool Layer::FillsBoundsCompletely() const { return fills_bounds_completely_; } |
| 779 | 777 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1078 animator_->RemoveFromCollection(collection); | 1076 animator_->RemoveFromCollection(collection); |
| 1079 for (auto* child : children_) | 1077 for (auto* child : children_) |
| 1080 child->RemoveAnimatorsInTreeFromCollection(collection); | 1078 child->RemoveAnimatorsInTreeFromCollection(collection); |
| 1081 } | 1079 } |
| 1082 | 1080 |
| 1083 bool Layer::IsAnimating() const { | 1081 bool Layer::IsAnimating() const { |
| 1084 return animator_.get() && animator_->is_animating(); | 1082 return animator_.get() && animator_->is_animating(); |
| 1085 } | 1083 } |
| 1086 | 1084 |
| 1087 } // namespace ui | 1085 } // namespace ui |
| OLD | NEW |