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

Unified Diff: cc/test/layer_tree_json_parser.cc

Issue 23983047: Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to r248052. Created 6 years, 11 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/layers/solid_color_scrollbar_layer_impl.cc ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_json_parser.cc
diff --git a/cc/test/layer_tree_json_parser.cc b/cc/test/layer_tree_json_parser.cc
index e7f3e9bf092d64408f0e2773443aac2d17470044..e543f1d6090424da69040388d6b38fc5e0988a4b 100644
--- a/cc/test/layer_tree_json_parser.cc
+++ b/cc/test/layer_tree_json_parser.cc
@@ -101,8 +101,27 @@ scoped_refptr<Layer> ParseTreeFromValue(base::Value* val,
new_layer->SetContentsOpaque(contents_opaque);
bool scrollable;
+ // TODO(wjmaclean) At some time in the future we may wish to test that a
+ // reconstructed layer tree contains the correct linkage for the scroll
+ // clip layer. This is complicated by the fact that the json output doesn't
+ // (currently) re-construct the tree with the same layer IDs as the original.
+ // But, since a clip layer is always an ancestor of the scrollable layer, we
+ // can just count the number of upwards hops to the clip layer and write that
+ // into the json file (with 0 hops implying no clip layer, i.e. not
+ // scrollable). Reconstructing the tree can then be accomplished by passing
+ // the parent pointer to this function and traversing the same number of
+ // ancestors to determine the pointer to the clip layer. The LayerTreesMatch()
+ // function should then check that both original and reconstructed layers
+ // have the same positioning with respect to their clip layers.
+ //
+ // For now, we can safely indicate a layer is scrollable by giving it a
+ // pointer to itself, something not normally allowed in a working tree.
+ //
+ // https://code.google.com/p/chromium/issues/detail?id=330622
+ //
if (dict->GetBoolean("Scrollable", &scrollable))
- new_layer->SetScrollable(scrollable);
+ new_layer->SetScrollClipLayerId(scrollable ? new_layer->id()
+ : Layer::INVALID_ID);
bool wheel_handler;
if (dict->GetBoolean("WheelHandler", &wheel_handler))
« no previous file with comments | « cc/layers/solid_color_scrollbar_layer_impl.cc ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698