OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/debug/trace_event_argument.h" | 8 #include "base/debug/trace_event_argument.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 return; | 199 return; |
200 clip_children_.reset(children); | 200 clip_children_.reset(children); |
201 SetNeedsPushProperties(); | 201 SetNeedsPushProperties(); |
202 } | 202 } |
203 | 203 |
204 void LayerImpl::PassCopyRequests(ScopedPtrVector<CopyOutputRequest>* requests) { | 204 void LayerImpl::PassCopyRequests(ScopedPtrVector<CopyOutputRequest>* requests) { |
205 if (requests->empty()) | 205 if (requests->empty()) |
206 return; | 206 return; |
207 | 207 |
208 bool was_empty = copy_requests_.empty(); | 208 bool was_empty = copy_requests_.empty(); |
209 copy_requests_.insert_and_take(copy_requests_.end(), *requests); | 209 copy_requests_.insert_and_take(copy_requests_.end(), requests); |
210 requests->clear(); | 210 requests->clear(); |
211 | 211 |
212 if (was_empty && layer_tree_impl()->IsActiveTree()) | 212 if (was_empty && layer_tree_impl()->IsActiveTree()) |
213 layer_tree_impl()->AddLayerWithCopyOutputRequest(this); | 213 layer_tree_impl()->AddLayerWithCopyOutputRequest(this); |
214 NoteLayerPropertyChangedForSubtree(); | 214 NoteLayerPropertyChangedForSubtree(); |
215 } | 215 } |
216 | 216 |
217 void LayerImpl::TakeCopyRequestsAndTransformToTarget( | 217 void LayerImpl::TakeCopyRequestsAndTransformToTarget( |
218 ScopedPtrVector<CopyOutputRequest>* requests) { | 218 ScopedPtrVector<CopyOutputRequest>* requests) { |
219 DCHECK(!copy_requests_.empty()); | 219 DCHECK(!copy_requests_.empty()); |
220 DCHECK(layer_tree_impl()->IsActiveTree()); | 220 DCHECK(layer_tree_impl()->IsActiveTree()); |
221 | 221 |
222 size_t first_inserted_request = requests->size(); | 222 size_t first_inserted_request = requests->size(); |
223 requests->insert_and_take(requests->end(), copy_requests_); | 223 requests->insert_and_take(requests->end(), ©_requests_); |
224 copy_requests_.clear(); | 224 copy_requests_.clear(); |
225 | 225 |
226 for (size_t i = first_inserted_request; i < requests->size(); ++i) { | 226 for (size_t i = first_inserted_request; i < requests->size(); ++i) { |
227 CopyOutputRequest* request = requests->at(i); | 227 CopyOutputRequest* request = requests->at(i); |
228 if (!request->has_area()) | 228 if (!request->has_area()) |
229 continue; | 229 continue; |
230 | 230 |
231 gfx::Rect request_in_layer_space = request->area(); | 231 gfx::Rect request_in_layer_space = request->area(); |
232 gfx::Rect request_in_content_space = | 232 gfx::Rect request_in_content_space = |
233 LayerRectToContentRect(request_in_layer_space); | 233 LayerRectToContentRect(request_in_layer_space); |
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 } | 1538 } |
1539 | 1539 |
1540 void LayerImpl::NotifyAnimationFinished( | 1540 void LayerImpl::NotifyAnimationFinished( |
1541 base::TimeTicks monotonic_time, | 1541 base::TimeTicks monotonic_time, |
1542 Animation::TargetProperty target_property) { | 1542 Animation::TargetProperty target_property) { |
1543 if (target_property == Animation::ScrollOffset) | 1543 if (target_property == Animation::ScrollOffset) |
1544 layer_tree_impl_->InputScrollAnimationFinished(); | 1544 layer_tree_impl_->InputScrollAnimationFinished(); |
1545 } | 1545 } |
1546 | 1546 |
1547 } // namespace cc | 1547 } // namespace cc |
OLD | NEW |