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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 gfx::Rect request_in_layer_space = request->area(); | 243 gfx::Rect request_in_layer_space = request->area(); |
244 request_in_layer_space.Intersect(gfx::Rect(bounds())); | 244 request_in_layer_space.Intersect(gfx::Rect(bounds())); |
245 request->set_area(MathUtil::MapEnclosingClippedRect( | 245 request->set_area(MathUtil::MapEnclosingClippedRect( |
246 DrawTransform(), request_in_layer_space)); | 246 DrawTransform(), request_in_layer_space)); |
247 } | 247 } |
248 | 248 |
249 layer_tree_impl()->RemoveLayerWithCopyOutputRequest(this); | 249 layer_tree_impl()->RemoveLayerWithCopyOutputRequest(this); |
250 layer_tree_impl()->set_needs_update_draw_properties(); | 250 layer_tree_impl()->set_needs_update_draw_properties(); |
251 } | 251 } |
252 | 252 |
253 bool LayerImpl::InsideCopyRequest() const { | |
254 EffectTree& effect_tree = layer_tree_impl()->property_trees()->effect_tree; | |
255 EffectNode* node = effect_tree.Node(effect_tree_index_); | |
256 | |
257 for (; node; node = effect_tree.parent(node)) { | |
258 if (node->data.has_copy_request) | |
259 return true; | |
260 } | |
261 return false; | |
262 } | |
263 | |
264 void LayerImpl::ClearRenderSurfaceLayerList() { | 253 void LayerImpl::ClearRenderSurfaceLayerList() { |
265 if (render_surface_) | 254 if (render_surface_) |
266 render_surface_->ClearLayerLists(); | 255 render_surface_->ClearLayerLists(); |
267 } | 256 } |
268 | 257 |
269 void LayerImpl::PopulateSharedQuadState(SharedQuadState* state) const { | 258 void LayerImpl::PopulateSharedQuadState(SharedQuadState* state) const { |
270 state->SetAll(draw_properties_.target_space_transform, bounds(), | 259 state->SetAll(draw_properties_.target_space_transform, bounds(), |
271 draw_properties_.visible_layer_rect, draw_properties_.clip_rect, | 260 draw_properties_.visible_layer_rect, draw_properties_.clip_rect, |
272 draw_properties_.is_clipped, draw_properties_.opacity, | 261 draw_properties_.is_clipped, draw_properties_.opacity, |
273 draw_blend_mode_, sorting_context_id_); | 262 draw_blend_mode_, sorting_context_id_); |
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 .layer_transforms_should_scale_layer_contents) { | 1400 .layer_transforms_should_scale_layer_contents) { |
1412 return default_scale; | 1401 return default_scale; |
1413 } | 1402 } |
1414 | 1403 |
1415 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1404 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
1416 DrawTransform(), default_scale); | 1405 DrawTransform(), default_scale); |
1417 return std::max(transform_scales.x(), transform_scales.y()); | 1406 return std::max(transform_scales.x(), transform_scales.y()); |
1418 } | 1407 } |
1419 | 1408 |
1420 } // namespace cc | 1409 } // namespace cc |
OLD | NEW |