OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 2422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2433 const float tolerance = | 2433 const float tolerance = |
2434 col == 3 && row < 3 ? translation_tolerance : component_tolerance; | 2434 col == 3 && row < 3 ? translation_tolerance : component_tolerance; |
2435 if (delta > tolerance) | 2435 if (delta > tolerance) |
2436 return false; | 2436 return false; |
2437 } | 2437 } |
2438 } | 2438 } |
2439 | 2439 |
2440 return true; | 2440 return true; |
2441 } | 2441 } |
2442 | 2442 |
| 2443 void VerifyPropertyTreeValuesForSurface(RenderSurfaceImpl* render_surface, |
| 2444 PropertyTrees* property_trees) { |
| 2445 const bool render_surface_draw_transforms_match = |
| 2446 ApproximatelyEqual(render_surface->draw_transform(), |
| 2447 DrawTransformOfRenderSurfaceFromPropertyTrees( |
| 2448 render_surface, property_trees->transform_tree)); |
| 2449 CHECK(render_surface_draw_transforms_match) |
| 2450 << "expected: " << render_surface->draw_transform().ToString() |
| 2451 << " actual: " |
| 2452 << DrawTransformOfRenderSurfaceFromPropertyTrees( |
| 2453 render_surface, property_trees->transform_tree) |
| 2454 .ToString(); |
| 2455 } |
| 2456 |
2443 void VerifyPropertyTreeValuesForLayer(LayerImpl* current_layer, | 2457 void VerifyPropertyTreeValuesForLayer(LayerImpl* current_layer, |
2444 PropertyTrees* property_trees, | 2458 PropertyTrees* property_trees, |
2445 bool layers_always_allowed_lcd_text, | 2459 bool layers_always_allowed_lcd_text, |
2446 bool can_use_lcd_text) { | 2460 bool can_use_lcd_text) { |
2447 const bool visible_rects_match = | 2461 const bool visible_rects_match = |
2448 ApproximatelyEqual(current_layer->visible_layer_rect(), | 2462 ApproximatelyEqual(current_layer->visible_layer_rect(), |
2449 current_layer->visible_rect_from_property_trees()); | 2463 current_layer->visible_rect_from_property_trees()); |
2450 CHECK(visible_rects_match) | 2464 CHECK(visible_rects_match) |
2451 << "expected: " << current_layer->visible_layer_rect().ToString() | 2465 << "expected: " << current_layer->visible_layer_rect().ToString() |
2452 << " actual: " | 2466 << " actual: " |
(...skipping 28 matching lines...) Expand all Loading... |
2481 LayerTreeHostCommon::CalcDrawPropsMainInputs* inputs) { | 2495 LayerTreeHostCommon::CalcDrawPropsMainInputs* inputs) { |
2482 } | 2496 } |
2483 | 2497 |
2484 void VerifyPropertyTreeValues( | 2498 void VerifyPropertyTreeValues( |
2485 LayerTreeHostCommon::CalcDrawPropsImplInputs* inputs) { | 2499 LayerTreeHostCommon::CalcDrawPropsImplInputs* inputs) { |
2486 LayerIterator it, end; | 2500 LayerIterator it, end; |
2487 for (it = LayerIterator::Begin(inputs->render_surface_layer_list), | 2501 for (it = LayerIterator::Begin(inputs->render_surface_layer_list), |
2488 end = LayerIterator::End(inputs->render_surface_layer_list); | 2502 end = LayerIterator::End(inputs->render_surface_layer_list); |
2489 it != end; ++it) { | 2503 it != end; ++it) { |
2490 LayerImpl* current_layer = *it; | 2504 LayerImpl* current_layer = *it; |
| 2505 if (it.represents_target_render_surface()) |
| 2506 VerifyPropertyTreeValuesForSurface(current_layer->render_surface(), |
| 2507 inputs->property_trees); |
2491 if (!it.represents_itself() || !current_layer->DrawsContent()) | 2508 if (!it.represents_itself() || !current_layer->DrawsContent()) |
2492 continue; | 2509 continue; |
2493 VerifyPropertyTreeValuesForLayer(current_layer, inputs->property_trees, | 2510 VerifyPropertyTreeValuesForLayer(current_layer, inputs->property_trees, |
2494 inputs->layers_always_allowed_lcd_text, | 2511 inputs->layers_always_allowed_lcd_text, |
2495 inputs->can_use_lcd_text); | 2512 inputs->can_use_lcd_text); |
2496 } | 2513 } |
2497 } | 2514 } |
2498 | 2515 |
2499 enum PropertyTreeOption { | 2516 enum PropertyTreeOption { |
2500 BUILD_PROPERTY_TREES_IF_NEEDED, | 2517 BUILD_PROPERTY_TREES_IF_NEEDED, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2609 | 2626 |
2610 PropertyTrees* GetPropertyTrees(Layer* layer) { | 2627 PropertyTrees* GetPropertyTrees(Layer* layer) { |
2611 return layer->layer_tree_host()->property_trees(); | 2628 return layer->layer_tree_host()->property_trees(); |
2612 } | 2629 } |
2613 | 2630 |
2614 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 2631 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
2615 return layer->layer_tree_impl()->property_trees(); | 2632 return layer->layer_tree_impl()->property_trees(); |
2616 } | 2633 } |
2617 | 2634 |
2618 } // namespace cc | 2635 } // namespace cc |
OLD | NEW |