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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 RecomputePosition(); | 683 RecomputePosition(); |
684 SchedulePaint(gfx::Rect(bounds_.size())); | 684 SchedulePaint(gfx::Rect(bounds_.size())); |
685 if (delegate_) | 685 if (delegate_) |
686 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); | 686 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); |
687 for (size_t i = 0; i < children_.size(); ++i) | 687 for (size_t i = 0; i < children_.size(); ++i) |
688 children_[i]->OnDeviceScaleFactorChanged(device_scale_factor); | 688 children_[i]->OnDeviceScaleFactorChanged(device_scale_factor); |
689 if (layer_mask_) | 689 if (layer_mask_) |
690 layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor); | 690 layer_mask_->OnDeviceScaleFactorChanged(device_scale_factor); |
691 } | 691 } |
692 | 692 |
| 693 void Layer::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) { |
| 694 DCHECK(delegated_renderer_layer_ || surface_layer_); |
| 695 if (!delegate_) |
| 696 return; |
| 697 delegate_->OnDelegatedFrameDamage(damage_rect_in_dip); |
| 698 } |
| 699 |
693 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { | 700 void Layer::RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request) { |
694 cc_layer_->RequestCopyOfOutput(request.Pass()); | 701 cc_layer_->RequestCopyOfOutput(request.Pass()); |
695 } | 702 } |
696 | 703 |
697 void Layer::PaintContents(SkCanvas* sk_canvas, | 704 void Layer::PaintContents(SkCanvas* sk_canvas, |
698 const gfx::Rect& clip, | 705 const gfx::Rect& clip, |
699 gfx::RectF* opaque, | 706 gfx::RectF* opaque, |
700 ContentLayerClient::GraphicsContextStatus gc_status) { | 707 ContentLayerClient::GraphicsContextStatus gc_status) { |
701 TRACE_EVENT0("ui", "Layer::PaintContents"); | 708 TRACE_EVENT0("ui", "Layer::PaintContents"); |
702 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( | 709 scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 children_.end(), | 1035 children_.end(), |
1029 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), | 1036 std::bind2nd(std::mem_fun(&Layer::RemoveAnimatorsInTreeFromCollection), |
1030 collection)); | 1037 collection)); |
1031 } | 1038 } |
1032 | 1039 |
1033 bool Layer::IsAnimating() const { | 1040 bool Layer::IsAnimating() const { |
1034 return animator_ && animator_->is_animating(); | 1041 return animator_ && animator_->is_animating(); |
1035 } | 1042 } |
1036 | 1043 |
1037 } // namespace ui | 1044 } // namespace ui |
OLD | NEW |