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

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 266913021: Hit test on the layer tree rather than the RSLL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor cleanups. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 6122 matching lines...) Expand 10 before | Expand all | Expand 10 after
6133 LayerImpl* scroll_layer = 6133 LayerImpl* scroll_layer =
6134 host_impl_->active_tree()->LayerById(scroll_layer_id); 6134 host_impl_->active_tree()->LayerById(scroll_layer_id);
6135 scroll_layer->SetDrawsContent(true); 6135 scroll_layer->SetDrawsContent(true);
6136 6136
6137 int occluder_layer_id = 6; 6137 int occluder_layer_id = 6;
6138 scoped_ptr<LayerImpl> occluder_layer = 6138 scoped_ptr<LayerImpl> occluder_layer =
6139 LayerImpl::Create(host_impl_->active_tree(), occluder_layer_id); 6139 LayerImpl::Create(host_impl_->active_tree(), occluder_layer_id);
6140 occluder_layer->SetDrawsContent(true); 6140 occluder_layer->SetDrawsContent(true);
6141 occluder_layer->SetBounds(content_size); 6141 occluder_layer->SetBounds(content_size);
6142 occluder_layer->SetContentBounds(content_size); 6142 occluder_layer->SetContentBounds(content_size);
6143 occluder_layer->SetPosition(gfx::PointF()); 6143 occluder_layer->SetPosition(gfx::PointF(-10.f, -10.f));
6144 occluder_layer->SetAnchorPoint(gfx::PointF()); 6144 occluder_layer->SetAnchorPoint(gfx::PointF());
6145 6145
6146 int child_scroll_clip_layer_id = 7; 6146 int child_scroll_clip_layer_id = 7;
6147 scoped_ptr<LayerImpl> child_scroll_clip = 6147 scoped_ptr<LayerImpl> child_scroll_clip =
6148 LayerImpl::Create(host_impl_->active_tree(), child_scroll_clip_layer_id); 6148 LayerImpl::Create(host_impl_->active_tree(), child_scroll_clip_layer_id);
6149 6149
6150 int child_scroll_layer_id = 8; 6150 int child_scroll_layer_id = 8;
6151 scoped_ptr<LayerImpl> child_scroll = CreateScrollableLayer( 6151 scoped_ptr<LayerImpl> child_scroll = CreateScrollableLayer(
6152 child_scroll_layer_id, content_size, child_scroll_clip.get()); 6152 child_scroll_layer_id, content_size, child_scroll_clip.get());
6153 6153
6154 child_scroll->SetDrawsContent(false); 6154 child_scroll->SetPosition(gfx::PointF(10.f, 10.f));
6155 6155
6156 child_scroll->AddChild(occluder_layer.Pass()); 6156 child_scroll->AddChild(occluder_layer.Pass());
6157 scroll_layer->AddChild(child_scroll.Pass()); 6157 scroll_layer->AddChild(child_scroll.Pass());
6158 6158
6159 DrawFrame(); 6159 DrawFrame();
6160 6160
6161 EXPECT_EQ(InputHandler::ScrollUnknown, 6161 EXPECT_EQ(InputHandler::ScrollUnknown,
6162 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel)); 6162 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
6163 } 6163 }
6164 6164
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
6541 FakePictureLayerImpl* active_mask_content = 6541 FakePictureLayerImpl* active_mask_content =
6542 static_cast<FakePictureLayerImpl*>( 6542 static_cast<FakePictureLayerImpl*>(
6543 host_impl_->active_tree()->root_layer()->children()[0]->mask_layer()); 6543 host_impl_->active_tree()->root_layer()->children()[0]->mask_layer());
6544 gfx::Rect r2 = active_mask_content->visible_rect_for_tile_priority(); 6544 gfx::Rect r2 = active_mask_content->visible_rect_for_tile_priority();
6545 6545
6546 ASSERT_TRUE(!r2.IsEmpty()); 6546 ASSERT_TRUE(!r2.IsEmpty());
6547 } 6547 }
6548 6548
6549 } // namespace 6549 } // namespace
6550 } // namespace cc 6550 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698