}
}
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* impl,
- LayerTreeHostImpl::FrameData* frame_data,
- bool result) OVERRIDE {
- EXPECT_TRUE(result);
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread(
+ LayerTreeHostImpl* impl,
+ LayerTreeHostImpl::FrameData* frame_data,
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE {
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result);
RenderSurfaceImpl* root_surface =
impl->active_tree()->root_layer()->render_surface();
}
++draw_count_;
- return result;
+ return draw_result;
}
virtual void AfterTest() OVERRIDE {}
}
}
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* impl,
- LayerTreeHostImpl::FrameData* frame_data,
- bool result) OVERRIDE {
- EXPECT_TRUE(result);
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread(
+ LayerTreeHostImpl* impl,
+ LayerTreeHostImpl::FrameData* frame_data,
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE {
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result);
RenderSurfaceImpl* root_surface =
impl->active_tree()->root_layer()->render_surface();
}
++draw_count_;
- return result;
+ return draw_result;
}
virtual void AfterTest() OVERRIDE {}
LayerTreeHostDamageTest::SetupTree();
}
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
- LayerTreeHostImpl::FrameData* frame_data,
- bool result) OVERRIDE {
- EXPECT_TRUE(result);
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread(
+ LayerTreeHostImpl* host_impl,
+ LayerTreeHostImpl::FrameData* frame_data,
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE {
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result);
int source_frame = host_impl->active_tree()->source_frame_number();
switch (source_frame) {
EndTest();
break;
}
- return result;
+ return draw_result;
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
LayerTreeHostDamageTest::SetupTree();
}
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
- LayerTreeHostImpl::FrameData* frame_data,
- bool result) OVERRIDE {
- EXPECT_TRUE(result);
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread(
+ LayerTreeHostImpl* host_impl,
+ LayerTreeHostImpl::FrameData* frame_data,
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE {
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result);
int source_frame = host_impl->active_tree()->source_frame_number();
switch (source_frame) {
NOTREACHED();
break;
}
- return result;
+ return draw_result;
}
virtual void DidCommitAndDrawFrame() OVERRIDE {
LayerTreeHostDamageTest::SetupTree();
}
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
- LayerTreeHostImpl::FrameData* frame_data,
- bool result) OVERRIDE {
- EXPECT_TRUE(result);
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread(
+ LayerTreeHostImpl* host_impl,
+ LayerTreeHostImpl::FrameData* frame_data,
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE {
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result);
RenderSurfaceImpl* root_surface =
host_impl->active_tree()->root_layer()->render_surface();
EndTest();
break;
}
- return result;
+ return draw_result;
}
virtual void DidCommitAndDrawFrame() OVERRIDE {
root_layer->SetMasksToBounds(true);
layer_tree_host()->SetRootLayer(root_layer);
+ scoped_refptr<Layer> scroll_clip_layer = Layer::Create();
scoped_refptr<Layer> content_layer = FakeContentLayer::Create(&client_);
- content_layer->SetScrollable(true);
+ content_layer->SetScrollClipLayerId(scroll_clip_layer->id());
content_layer->SetScrollOffset(gfx::Vector2d(10, 20));
- content_layer->SetMaxScrollOffset(gfx::Vector2d(30, 50));
content_layer->SetBounds(gfx::Size(100, 200));
- root_layer->AddChild(content_layer);
+ scroll_clip_layer->SetBounds(
+ gfx::Size(content_layer->bounds().width() - 30,
+ content_layer->bounds().height() - 50));
+ scroll_clip_layer->AddChild(content_layer);
+ root_layer->AddChild(scroll_clip_layer);
scoped_refptr<Layer> scrollbar_layer =
FakePaintedScrollbarLayer::Create(false, true, content_layer->id());
scrollbar_layer->SetPosition(gfx::Point(300, 300));
scrollbar_layer->SetBounds(gfx::Size(10, 100));
+ scrollbar_layer->ToScrollbarLayer()->SetClipLayer(scroll_clip_layer->id());
+ scrollbar_layer->ToScrollbarLayer()->SetScrollLayer(content_layer->id());
root_layer->AddChild(scrollbar_layer);
gfx::RectF content_rect(content_layer->position(),
PostSetNeedsCommitToMainThread();
}
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
- LayerTreeHostImpl::FrameData* frame_data,
- bool result) OVERRIDE {
- EXPECT_TRUE(result);
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread(
+ LayerTreeHostImpl* host_impl,
+ LayerTreeHostImpl::FrameData* frame_data,
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE {
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result);
RenderSurfaceImpl* root_surface =
host_impl->active_tree()->root_layer()->render_surface();
gfx::RectF root_damage =
EndTest();
break;
}
- return result;
+ return draw_result;
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
++did_swaps_;
EXPECT_TRUE(result);
LayerImpl* root = host_impl->active_tree()->root_layer();
- LayerImpl* scroll_layer = root->children()[0];
+ LayerImpl* scroll_clip_layer = root->children()[0];
+ LayerImpl* scroll_layer = scroll_clip_layer->children()[0];
switch (did_swaps_) {
case 1:
// Test that modifying the position of the content layer (not
host_impl->SetNeedsRedraw();
break;
case 3:
- scroll_layer->SetMaxScrollOffset(gfx::Vector2d(60, 100));
+ scroll_layer->SetBounds(gfx::Size(root->bounds().width() + 60,
+ root->bounds().height() + 100));
host_impl->SetNeedsRedraw();
break;
}
PostSetNeedsCommitToMainThread();
}
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
- LayerTreeHostImpl::FrameData* frame_data,
- bool result) OVERRIDE {
- EXPECT_TRUE(result);
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread(
+ LayerTreeHostImpl* host_impl,
+ LayerTreeHostImpl::FrameData* frame_data,
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE {
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result);
RenderSurfaceImpl* root_surface =
host_impl->active_tree()->root_layer()->render_surface();
gfx::RectF root_damage =
NOTREACHED();
break;
}
- return result;
+ return draw_result;
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
++did_swaps_;
EXPECT_TRUE(result);
LayerImpl* root = host_impl->active_tree()->root_layer();
- LayerImpl* scroll_layer = root->children()[0];
+ LayerImpl* scroll_clip_layer = root->children()[0];
+ LayerImpl* scroll_layer = scroll_clip_layer->children()[0];
switch (did_swaps_) {
case 1:
// Scroll on the thread. This should damage the scrollbar for the
update_visible_tile_count_ = 0;
}
- virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
- LayerTreeHostImpl::FrameData* frame_data,
- bool result) OVERRIDE {
- EXPECT_TRUE(result);
+ virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread(
+ LayerTreeHostImpl* host_impl,
+ LayerTreeHostImpl::FrameData* frame_data,
+ DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE {
+ EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result);
prepare_to_draw_count_++;
switch (prepare_to_draw_count_) {
case 1:
break;
}
- return result;
+ return draw_result;
}
virtual void UpdateVisibleTilesOnThread(