| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 bool Layer::HasAncestor(const Layer* ancestor) const { | 345 bool Layer::HasAncestor(const Layer* ancestor) const { |
| 346 for (const Layer* layer = parent(); layer; layer = layer->parent()) { | 346 for (const Layer* layer = parent(); layer; layer = layer->parent()) { |
| 347 if (layer == ancestor) | 347 if (layer == ancestor) |
| 348 return true; | 348 return true; |
| 349 } | 349 } |
| 350 return false; | 350 return false; |
| 351 } | 351 } |
| 352 | 352 |
| 353 void Layer::RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request) { | 353 void Layer::RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request) { |
| 354 DCHECK(IsPropertyChangeAllowed()); | 354 DCHECK(IsPropertyChangeAllowed()); |
| 355 if (void* source = request->source()) { | 355 if (request->has_source()) { |
| 356 const base::UnguessableToken& source = request->source(); |
| 356 auto it = | 357 auto it = |
| 357 std::find_if(inputs_.copy_requests.begin(), inputs_.copy_requests.end(), | 358 std::find_if(inputs_.copy_requests.begin(), inputs_.copy_requests.end(), |
| 358 [source](const std::unique_ptr<CopyOutputRequest>& x) { | 359 [&source](const std::unique_ptr<CopyOutputRequest>& x) { |
| 359 return x->source() == source; | 360 return x->has_source() && x->source() == source; |
| 360 }); | 361 }); |
| 361 if (it != inputs_.copy_requests.end()) | 362 if (it != inputs_.copy_requests.end()) |
| 362 inputs_.copy_requests.erase(it); | 363 inputs_.copy_requests.erase(it); |
| 363 } | 364 } |
| 364 if (request->IsEmpty()) | 365 if (request->IsEmpty()) |
| 365 return; | 366 return; |
| 366 inputs_.copy_requests.push_back(std::move(request)); | 367 inputs_.copy_requests.push_back(std::move(request)); |
| 367 SetSubtreePropertyChanged(); | 368 SetSubtreePropertyChanged(); |
| 368 SetNeedsCommit(); | 369 SetNeedsCommit(); |
| 369 } | 370 } |
| (...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 ->num_copy_requests_in_subtree; | 1572 ->num_copy_requests_in_subtree; |
| 1572 } | 1573 } |
| 1573 | 1574 |
| 1574 gfx::Transform Layer::screen_space_transform() const { | 1575 gfx::Transform Layer::screen_space_transform() const { |
| 1575 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1576 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
| 1576 return draw_property_utils::ScreenSpaceTransform( | 1577 return draw_property_utils::ScreenSpaceTransform( |
| 1577 this, layer_tree_host_->property_trees()->transform_tree); | 1578 this, layer_tree_host_->property_trees()->transform_tree); |
| 1578 } | 1579 } |
| 1579 | 1580 |
| 1580 } // namespace cc | 1581 } // namespace cc |
| OLD | NEW |