Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1581)

Unified Diff: cc/test/layer_tree_host_common_test.cc

Issue 1136643006: Fix cc unit tests that depend on verify_property_trees=true (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/layer_tree_host_common_test.h ('k') | cc/trees/layer_tree_host_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_host_common_test.cc
diff --git a/cc/test/layer_tree_host_common_test.cc b/cc/test/layer_tree_host_common_test.cc
index d91652fe378ef165b1fd5f78f903e86f65dcb525..7019e8bfd2cb2b0c77c10f962f7c4732ddbf039d 100644
--- a/cc/test/layer_tree_host_common_test.cc
+++ b/cc/test/layer_tree_host_common_test.cc
@@ -7,6 +7,7 @@
#include "cc/layers/layer.h"
#include "cc/layers/layer_impl.h"
#include "cc/test/fake_layer_tree_host.h"
+#include "cc/trees/draw_property_utils.h"
#include "cc/trees/layer_tree_host_common.h"
namespace cc {
@@ -80,6 +81,50 @@ void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties(
LayerTreeHostCommon::CalculateDrawProperties(&inputs);
}
+void LayerTreeHostCommonTestBase::
+ ExecuteCalculateDrawPropertiesWithPropertyTrees(Layer* root_layer) {
+ DCHECK(root_layer->layer_tree_host());
+ LayerTreeHostCommon::PreCalculateMetaInformation(root_layer);
+
+ gfx::Transform identity_transform;
+ bool preserves_2d_axis_alignment = false;
+ bool can_render_to_separate_surface = true;
+ LayerTreeHostCommon::UpdateRenderSurfaces(
+ root_layer, can_render_to_separate_surface, identity_transform,
+ preserves_2d_axis_alignment);
+
+ Layer* page_scale_layer = nullptr;
+ float page_scale_factor = 1.f;
+ float device_scale_factor = 1.f;
+ gfx::Size device_viewport_size =
+ gfx::Size(root_layer->bounds().width() * device_scale_factor,
+ root_layer->bounds().height() * device_scale_factor);
+ LayerList update_layer_list;
+ BuildPropertyTreesAndComputeVisibleRects(
+ root_layer, page_scale_layer, page_scale_factor, device_scale_factor,
+ gfx::Rect(device_viewport_size), identity_transform,
+ root_layer->layer_tree_host()->property_trees(), &update_layer_list);
+}
+
+void LayerTreeHostCommonTestBase::
+ ExecuteCalculateDrawPropertiesWithPropertyTrees(LayerImpl* root_layer) {
+ DCHECK(root_layer->layer_tree_impl());
+ LayerTreeHostCommon::PreCalculateMetaInformationForTesting(root_layer);
+
+ gfx::Transform identity_transform;
+ LayerImpl* page_scale_layer = nullptr;
+ float page_scale_factor = 1.f;
+ float device_scale_factor = 1.f;
+ gfx::Size device_viewport_size =
+ gfx::Size(root_layer->bounds().width() * device_scale_factor,
+ root_layer->bounds().height() * device_scale_factor);
+ std::vector<LayerImpl*> update_layer_list;
+ BuildPropertyTreesAndComputeVisibleRects(
+ root_layer, page_scale_layer, page_scale_factor, device_scale_factor,
+ gfx::Rect(device_viewport_size), identity_transform,
+ root_layer->layer_tree_impl()->property_trees(), &update_layer_list);
+}
+
void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties(
LayerImpl* root_layer,
float device_scale_factor,
« no previous file with comments | « cc/test/layer_tree_host_common_test.h ('k') | cc/trees/layer_tree_host_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698