Home | History | Annotate | Download | only in trees

Lines Matching refs:host_impl_

126     host_impl_->ActivatePendingTree();
172 host_impl_ = LayerTreeHostImpl::Create(settings,
178 bool init = host_impl_->InitializeRenderer(output_surface.Pass());
179 host_impl_->SetViewportSize(gfx::Size(10, 10));
189 host_impl_->active_tree()->SetRootLayer(root.Pass());
277 host_impl_->active_tree(), content_size);
278 host_impl_->active_tree()->DidBecomeActive();
289 LayerImpl::Create(host_impl_->active_tree(), id);
300 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
301 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
302 host_impl_->DidDrawAllLayers(frame);
315 EXPECT_FALSE(host_impl_->CanDraw());
320 EXPECT_TRUE(host_impl_->CanDraw());
325 host_impl_->active_tree()->SetRootLayer(scoped_ptr<LayerImpl>());
326 EXPECT_FALSE(host_impl_->CanDraw());
331 EXPECT_TRUE(host_impl_->CanDraw());
336 host_impl_->SetViewportSize(gfx::Size());
338 EXPECT_TRUE(host_impl_->CanDraw());
340 EXPECT_FALSE(host_impl_->CanDraw());
345 host_impl_->SetViewportSize(gfx::Size(100, 100));
346 EXPECT_TRUE(host_impl_->CanDraw());
353 host_impl_->SetMemoryPolicy(ManagedMemoryPolicy(
354 host_impl_->memory_allocation_limit_bytes() - 1));
355 EXPECT_TRUE(host_impl_->CanDraw());
361 host_impl_->SetMemoryPolicy(ManagedMemoryPolicy(
362 host_impl_->memory_allocation_limit_bytes() - 1));
364 EXPECT_TRUE(host_impl_->CanDraw());
366 EXPECT_FALSE(host_impl_->CanDraw());
371 host_impl_->active_tree()->ResetContentsTexturesPurged();
372 EXPECT_TRUE(host_impl_->CanDraw());
386 host_impl_->PrepareToDraw(&frame_data);
387 host_impl_->DidDrawAllLayers(frame_data);
395 scoped_ptr<LayerTreeHostImpl> host_impl_;
426 ASSERT_FALSE(host_impl_->active_tree()->root_layer());
428 scoped_ptr<ScrollAndScaleSet> scroll_info = host_impl_->ProcessScrollDeltas();
435 LayerImpl::Create(host_impl_->active_tree(), 1);
436 host_impl_->active_tree(), 2));
437 root->AddChild(LayerImpl::Create(host_impl_->active_tree(), 3));
439 LayerImpl::Create(host_impl_->active_tree(), 4));
441 LayerImpl::Create(host_impl_->active_tree(), 5));
443 LayerImpl::Create(host_impl_->active_tree(), 6));
444 host_impl_->active_tree()->SetRootLayer(root.Pass());
446 LayerImpl* root = host_impl_->active_tree()->root_layer();
452 scroll_info = host_impl_->ProcessScrollDeltas();
456 scroll_info = host_impl_->ProcessScrollDeltas();
466 LayerImpl::Create(host_impl_->active_tree(), 2);
468 LayerImpl::Create(host_impl_->active_tree(), 1);
476 host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
478 LayerImpl* root = host_impl_->active_tree()->root_layer()->children()[0];
482 scroll_info = host_impl_->ProcessScrollDeltas();
489 scroll_info = host_impl_->ProcessScrollDeltas();
495 scroll_info = host_impl_->ProcessScrollDeltas();
501 host_impl_->SetViewportSize(gfx::Size(50, 50));
505 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
506 EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
508 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
509 EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(0, 10),
511 host_impl_->ScrollEnd();
512 EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
521 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
541 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
546 host_impl_->SetViewportSize(gfx::Size(50, 50));
551 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
552 host_impl_->active_tree()->DetachLayerTree();
559 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
560 host_impl_->ScrollEnd();
561 scoped_ptr<ScrollAndScaleSet> scroll_info = host_impl_->ProcessScrollDeltas();
567 host_impl_->SetViewportSize(gfx::Size(50, 50));
572 host_impl_->active_tree()->root_layer()->ClearRenderSurface();
573 host_impl_->active_tree()->set_needs_update_draw_properties();
576 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
581 host_impl_->SetViewportSize(gfx::Size(50, 50));
583 LayerImpl* root = host_impl_->active_tree()->root_layer();
590 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
594 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
599 host_impl_->SetViewportSize(gfx::Size(50, 50));
604 host_impl_->FlingScrollBegin());
608 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
612 host_impl_->FlingScrollBegin());
617 host_impl_->SetViewportSize(gfx::Size(50, 50));
622 host_impl_->FlingScrollBegin());
626 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
630 host_impl_->FlingScrollBegin());
635 host_impl_->SetViewportSize(gfx::Size(50, 50));
637 LayerImpl* root = host_impl_->active_tree()->root_layer();
643 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
647 host_impl_->FlingScrollBegin());
652 host_impl_->SetViewportSize(gfx::Size(50, 50));
654 LayerImpl* root = host_impl_->active_tree()->root_layer();
659 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
661 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
666 host_impl_->SetViewportSize(gfx::Size(100, 100));
668 LayerImpl* root = host_impl_->active_tree()->root_layer();
676 host_impl_->ScrollBegin(gfx::Point(25, 25),
678 EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(25, 25),
681 host_impl_->ScrollBegin(gfx::Point(25, 25),
683 EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(25, 25),
688 host_impl_->ScrollBegin(gfx::Point(75, 75),
690 EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
692 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
693 EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(25, 25),
695 host_impl_->ScrollEnd();
696 EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
699 host_impl_->ScrollBegin(gfx::Point(75, 75),
701 EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
703 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
704 host_impl_->ScrollEnd();
705 EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(75, 75),
711 host_impl_->SetViewportSize(gfx::Size(100, 100));
713 LayerImpl* root = host_impl_->active_tree()->root_layer();
723 host_impl_->ScrollBegin(gfx::Point(40, 10),
725 EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(40, 10),
727 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 1));
728 host_impl_->ScrollEnd();
732 host_impl_->ScrollBegin(gfx::Point(10, 10),
739 host_impl_->SetViewportSize(gfx::Size(50, 50));
742 EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
743 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
744 EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
745 host_impl_->ScrollEnd();
746 EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
752 host_impl_->SetViewportSize(gfx::Size(50, 50));
755 EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
756 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
757 EXPECT_TRUE(host_impl_->scroll_affects_scroll_handler());
758 host_impl_->ScrollEnd();
759 EXPECT_FALSE(host_impl_->scroll_affects_scroll_handler());
764 host_impl_->SetViewportSize(gfx::Size(100, 100));
769 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
772 EXPECT_FALSE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(-10, 0)));
773 EXPECT_FALSE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, -10)));
774 EXPECT_FALSE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(-10, -10)));
777 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(10, 0)));
778 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10)));
779 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(10, 10)));
782 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(-10, 0)));
783 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, -10)));
784 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(-10, -10)));
787 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(10, -10)));
788 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(-10, 0)));
789 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(-10, 10)));
792 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(5000, 5000)));
797 host_impl_->SetViewportSize(gfx::Size(100, 1000));
802 host_impl_->ScrollBegin(gfx::Point(),
806 EXPECT_FALSE(host_impl_->ScrollVerticallyByPage(
808 EXPECT_FALSE(host_impl_->ScrollVerticallyByPage(
813 host_impl_->active_tree(),
817 host_impl_->InnerViewportScrollLayer()->AddScrollbar(
821 EXPECT_TRUE(host_impl_->ScrollVerticallyByPage(
824 host_impl_->InnerViewportScrollLayer()->ScrollDelta().y());
825 EXPECT_TRUE(host_impl_->ScrollVerticallyByPage(
833 host_impl_->SetViewportSize(gfx::Size(100, 100));
848 host_impl_->ScrollBegin(scroll_position, InputHandler::Wheel));
853 host_impl_->ScrollBy(scroll_position, scroll_delta);
854 host_impl_->ScrollEnd();
861 host_impl_->ScrollBegin(scroll_position, InputHandler::Wheel));
865 host_impl_->ScrollBy(scroll_position, scroll_delta);
866 host_impl_->ScrollEnd();
873 host_impl_->ScrollBegin(scroll_position, InputHandler::Wheel));
877 host_impl_->ScrollBy(scroll_position, scroll_delta);
878 host_impl_->ScrollEnd();
886 host_impl_->SetViewportSize(gfx::Size(50, 50));
891 host_impl_->active_tree()->root_layer()->ClearRenderSurface();
892 host_impl_->active_tree()->set_needs_update_draw_properties();
894 EXPECT_EQ(host_impl_->HaveTouchEventHandlersAt(gfx::Point()), false);
899 host_impl_->SetViewportSize(gfx::Size(50, 50));
902 EXPECT_EQ(scroll_layer, host_impl_->InnerViewportScrollLayer());
911 host_impl_->active_tree()->SetPageScaleFactorAndLimits(
913 host_impl_->active_tree()->SetPageScaleDelta(1.f);
922 host_impl_->ScrollBegin(gfx::Point(50, 50), InputHandler::Gesture);
923 host_impl_->PinchGestureBegin();
924 host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(50, 50));
930 host_impl_->PinchGestureEnd();
931 host_impl_->ScrollEnd();
938 host_impl_->ProcessScrollDeltas();
948 host_impl_->active_tree()->SetPageScaleFactorAndLimits(
950 host_impl_->active_tree()->SetPageScaleDelta(1.f);
954 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
955 host_impl_->PinchGestureBegin();
956 host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point());
957 host_impl_->PinchGestureEnd();
958 host_impl_->ScrollEnd();
962 host_impl_->ScrollBegin(gfx::Point(5, 5),
964 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
965 host_impl_->ScrollEnd();
968 host_impl_->ProcessScrollDeltas();
977 host_impl_->SetViewportSize(gfx::Size(50, 50));
980 LayerImpl* scroll_layer = host_impl_->InnerViewportScrollLayer();
986 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f,
1002 host_impl_->DidChangeTopControlsPosition();
1008 host_impl_->SetViewportSize(gfx::Size(50, 50));
1023 host_impl_->DidChangeTopControlsPosition();
1032 host_impl_->SetViewportSize(gfx::Size(50, 50));
1035 LayerImpl* scroll_layer = host_impl_->InnerViewportScrollLayer();
1043 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f,
1049 host_impl_->ScrollBegin(gfx::Point(50, 50), InputHandler::Gesture);
1050 host_impl_->PinchGestureBegin();
1051 host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(50, 50));
1052 host_impl_->PinchGestureEnd();
1053 host_impl_->ScrollEnd();
1059 host_impl_->ProcessScrollDeltas();
1065 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f,
1071 host_impl_->ScrollBegin(gfx::Point(50, 50), InputHandler::Gesture);
1072 host_impl_->PinchGestureBegin();
1073 host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(50, 50));
1074 host_impl_->PinchGestureEnd();
1075 host_impl_->ScrollEnd();
1078 host_impl_->ProcessScrollDeltas();
1084 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f,
1091 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
1092 host_impl_->PinchGestureBegin();
1093 host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point());
1094 host_impl_->PinchGestureEnd();
1095 host_impl_->ScrollEnd();
1098 host_impl_->ProcessScrollDeltas();
1106 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f,
1113 host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::Gesture);
1114 host_impl_->PinchGestureBegin();
1115 host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(10, 10));
1116 host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(20, 20));
1117 host_impl_->PinchGestureEnd();
1118 host_impl_->ScrollEnd();
1121 host_impl_->ProcessScrollDeltas();
1128 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f,
1135 host_impl_->ScrollBegin(gfx::Point(10, 10), InputHandler::Gesture);
1136 host_impl_->PinchGestureBegin();
1137 host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(10, 10));
1138 host_impl_->ScrollBy(gfx::Point(10, 10), gfx::Vector2d(-10, -10));
1139 host_impl_->PinchGestureUpdate(page_scale_delta, gfx::Point(20, 20));
1140 host_impl_->PinchGestureEnd();
1141 host_impl_->ScrollEnd();
1144 host_impl_->ProcessScrollDeltas();
1151 host_impl_->active_tree()->SetPageScaleFactorAndLimits(0.5f,
1157 host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Gesture);
1158 host_impl_->PinchGestureBegin();
1159 host_impl_->PinchGestureUpdate(2.f, gfx::Point(0, 0));
1160 host_impl_->PinchGestureUpdate(1.f, gfx::Point(0, 0));
1161 host_impl_->ScrollBy(gfx::Point(0, 0), gfx::Vector2d(10, 10));
1162 host_impl_->PinchGestureUpdate(1.f, gfx::Point(10, 10));
1163 host_impl_->PinchGestureEnd();
1164 host_impl_->ScrollEnd();
1167 host_impl_->ProcessScrollDeltas();
1175 host_impl_->SetViewportSize(gfx::Size(50, 50));
1178 LayerImpl* scroll_layer = host_impl_->InnerViewportScrollLayer();
1191 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f,
1198 host_impl_->StartPageScaleAnimation(gfx::Vector2d(), false, 2.f, duration);
1204 host_impl_->Animate(start_time);
1210 host_impl_->Animate(halfway_through_animation);
1217 host_impl_->Animate(end_time);
1222 host_impl_->ProcessScrollDeltas();
1229 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f,
1236 host_impl_->StartPageScaleAnimation(
1243 host_impl_->Animate(start_time);
1250 host_impl_->Animate(end_time);
1256 host_impl_->ProcessScrollDeltas();
1265 host_impl_->SetViewportSize(gfx::Size(50, 50));
1268 LayerImpl* scroll_layer = host_impl_->InnerViewportScrollLayer();
1281 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f,
1286 host_impl_->StartPageScaleAnimation(gfx::Vector2d(), true, 1.f, duration);
1287 host_impl_->Animate(start_time);
1288 host_impl_->Animate(halfway_through_animation);
1290 host_impl_->Animate(end_time);
1294 host_impl_->ProcessScrollDeltas();
1337 host_impl_ = make_scoped_ptr(host_impl_override_time); \
1338 host_impl_->InitializeRenderer(CreateOutputSurface()); \
1339 host_impl_->SetViewportSize(viewport_size); \
1342 LayerImpl::Create(host_impl_->active_tree(), 1); \
1346 LayerImpl::Create(host_impl_->active_tree(), 2); \
1355 LayerImpl::Create(host_impl_->active_tree(), 3); \
1362 host_impl_->active_tree(), 4, VERTICAL, 10, 0, false, true); \
1371 host_impl_->active_tree()->SetRootLayer(root.Pass()); \
1372 host_impl_->active_tree()->SetViewportLayersFromIds( \
1374 host_impl_->active_tree()->DidBecomeActive(); \
1391 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
1392 host_impl_->ScrollEnd();
1398 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
1399 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(5, 0));
1400 host_impl_->ScrollEnd();
1409 host_impl_->Animate(fake_now);
1420 host_impl_->InnerViewportScrollLayer()->SetScrollOffset(gfx::Vector2d(5, 5));
1439 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f);
1445 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
1446 host_impl_->ScrollEnd();
1452 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
1453 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(5, 0));
1454 host_impl_->ScrollEnd();
1466 host_impl_->active_tree()->SetPageScaleDelta(1.1f);
1469 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel);
1470 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(5, 0));
1471 host_impl_->ScrollEnd();
1482 host_impl_->Animate(fake_now);
1499 host_impl_->SetDeviceScaleFactor(device_scale_factor);
1500 host_impl_->SetViewportSize(device_viewport_size);
1503 LayerImpl::Create(host_impl_->active_tree(), 1);
1507 LayerImpl::Create(host_impl_->active_tree(), 2);
1515 LayerImpl::Create(host_impl_->active_tree(), 3);
1522 PaintedScrollbarLayerImpl::Create(host_impl_->active_tree(), 5, VERTICAL);
1534 host_impl_->active_tree()->SetRootLayer(root.Pass());
1535 host_impl_->active_tree()->SetViewportLayersFromIds(1, 2, Layer::INVALID_ID);
1536 host_impl_->active_tree()->DidBecomeActive();
1540 host_impl_->active_tree()->InnerViewportScrollLayer();
1547 host_impl_->MouseMoveAt(gfx::Point(1, 1));
1550 host_impl_->MouseMoveAt(gfx::Point(200, 50));
1553 host_impl_->MouseMoveAt(gfx::Point(184, 100));
1557 host_impl_->MouseMoveAt(gfx::Point(184, 100));
1561 EXPECT_EQ(0, host_impl_->scroll_layer_id_when_mouse_over_scrollbar());
1562 host_impl_->MouseMoveAt(gfx::Point(290, 100));
1563 EXPECT_EQ(2, host_impl_->scroll_layer_id_when_mouse_over_scrollbar());
1564 host_impl_->MouseMoveAt(gfx::Point(290, 120));
1565 EXPECT_EQ(2, host_impl_->scroll_layer_id_when_mouse_over_scrollbar());
1566 host_impl_->MouseMoveAt(gfx::Point(150, 120));
1567 EXPECT_EQ(0, host_impl_->scroll_layer_id_when_mouse_over_scrollbar());
1580 host_impl_->SetViewportSize(gfx::Size(50, 50));
1581 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
1585 host_impl_->MakeCompositorFrameMetadata();
1596 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
1597 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
1600 host_impl_->MakeCompositorFrameMetadata();
1603 host_impl_->ScrollEnd();
1606 host_impl_->MakeCompositorFrameMetadata();
1611 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
1612 host_impl_->PinchGestureBegin();
1613 host_impl_->PinchGestureUpdate(2.f, gfx::Point());
1614 host_impl_->PinchGestureEnd();
1615 host_impl_->ScrollEnd();
1618 host_impl_->MakeCompositorFrameMetadata();
1628 host_impl_->ProcessScrollDeltas();
1629 host_impl_->active_tree()->SetPageScaleFactorAndLimits(4.f, 0.5f, 4.f);
1630 host_impl_->active_tree()->SetPageScaleDelta(1.f);
1633 host_impl_->MakeCompositorFrameMetadata();
1703 host_impl_->active_tree()->SetRootLayer(
1704 DidDrawCheckLayer::Create(host_impl_->active_tree(), 1));
1706 host_impl_->active_tree()->root_layer());
1708 root->AddChild(DidDrawCheckLayer::Create(host_impl_->active_tree(), 2));
1714 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
1715 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1716 host_impl_->DidDrawAllLayers(frame);
1723 host_impl_->SetViewportDamage(gfx::Rect(10, 10));
1731 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
1732 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1733 host_impl_->DidDrawAllLayers(frame);
1744 host_impl_->active_tree()->SetRootLayer(
1745 DidDrawCheckLayer::Create(host_impl_->active_tree(), 1));
1747 host_impl_->active_tree()->root_layer());
1750 root->AddChild(DidDrawCheckLayer::Create(host_impl_->active_tree(), 2));
1763 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
1764 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1765 host_impl_->DidDrawAllLayers(frame);
1778 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
1779 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1780 host_impl_->DidDrawAllLayers(frame);
1790 host_impl_->SetViewportSize(big_size);
1792 host_impl_->active_tree()->SetRootLayer(
1793 DidDrawCheckLayer::Create(host_impl_->active_tree(), 1));
1795 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
1797 root->AddChild(DidDrawCheckLayer::Create(host_impl_->active_tree(), 2));
1801 root->AddChild(DidDrawCheckLayer::Create(host_impl_->active_tree(), 3));
1817 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
1818 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1819 host_impl_->DidDrawAllLayers(frame);
1828 host_impl_->active_tree()->SetRootLayer(
1829 DidDrawCheckLayer::Create(host_impl_->active_tree(), 1));
1831 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
1833 root->AddChild(DidDrawCheckLayer::Create(host_impl_->active_tree(), 2));
1837 layer1->AddChild(DidDrawCheckLayer::Create(host_impl_->active_tree(), 3));
1849 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
1850 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1851 host_impl_->DidDrawAllLayers(frame);
1906 host_impl_->active_tree()->SetRootLayer(
1907 DidDrawCheckLayer::Create(host_impl_->active_tree(), 1));
1909 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
1915 MissingTextureAnimatingLayer::Create(host_impl_->active_tree(),
1920 host_impl_->resource_provider()));
1924 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
1925 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1926 host_impl_->DidDrawAllLayers(frame);
1930 host_impl_->active_tree()->SetRootLayer(
1931 DidDrawCheckLayer::Create(host_impl_->active_tree(), 1));
1933 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
1938 MissingTextureAnimatingLayer::Create(host_impl_->active_tree(),
1943 host_impl_->resource_provider()));
1947 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
1948 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1949 host_impl_->DidDrawAllLayers(frame);
1953 host_impl_->active_tree()->SetRootLayer(
1954 DidDrawCheckLayer::Create(host_impl_->active_tree(), 3));
1956 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
1962 MissingTextureAnimatingLayer::Create(host_impl_->active_tree(),
1967 host_impl_->resource_provider()));
1969 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
1970 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1971 host_impl_->DidDrawAllLayers(frame);
1975 host_impl_->active_tree()->SetRootLayer(
1976 DidDrawCheckLayer::Create(host_impl_->active_tree(), 3));
1978 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
1984 MissingTextureAnimatingLayer::Create(host_impl_->active_tree(),
1989 host_impl_->resource_provider()));
1991 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
1992 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1993 host_impl_->DidDrawAllLayers(frame);
1998 host_impl_->active_tree()->SetRootLayer(
1999 DidDrawCheckLayer::Create(host_impl_->active_tree(), 5));
2001 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
2006 MissingTextureAnimatingLayer::Create(host_impl_->active_tree(),
2011 host_impl_->resource_provider()));
2014 host_impl_->PrepareToDraw(&frame));
2015 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
2016 host_impl_->DidDrawAllLayers(frame);
2021 host_impl_->active_tree()->SetRootLayer(
2022 DidDrawCheckLayer::Create(host_impl_->active_tree(), 5));
2024 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
2029 MissingTextureAnimatingLayer::Create(host_impl_->active_tree(),
2034 host_impl_->resource_provider()));
2036 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
2037 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
2038 host_impl_->DidDrawAllLayers(frame);
2042 host_impl_->active_tree()->SetRootLayer(
2043 DidDrawCheckLayer::Create(host_impl_->active_tree(), 7));
2045 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
2050 MissingTextureAnimatingLayer::Create(host_impl_->active_tree(),
2055 host_impl_->resource_provider()));
2056 host_impl_->active_tree()->SetRequiresHighResToDraw();
2058 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
2059 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
2060 host_impl_->DidDrawAllLayers(frame);
2065 host_impl_->active_tree()->SetRootLayer(
2066 DidDrawCheckLayer::Create(host_impl_->active_tree(), 7));
2068 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
2073 MissingTextureAnimatingLayer::Create(host_impl_->active_tree(),
2078 host_impl_->resource_provider()));
2079 host_impl_->active_tree()->SetRequiresHighResToDraw();
2082 host_impl_->PrepareToDraw(&frame));
2083 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
2084 host_impl_->DidDrawAllLayers(frame);
2089 host_impl_->active_tree()->SetRootLayer(
2090 DidDrawCheckLayer::Create(host_impl_->active_tree(), 7));
2092 static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
2097 MissingTextureAnimatingLayer::Create(host_impl_->active_tree(),
2102 host_impl_->resource_provider()));
2103 host_impl_->active_tree()->SetRequiresHighResToDraw();
2105 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
2106 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
2107 host_impl_->DidDrawAllLayers(frame);
2111 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
2113 host_impl_->active_tree()->SetRootLayer(root.Pass());
2118 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
2142 LayerImpl::Create(host_impl_->active_tree(), 1);
2144 LayerImpl::Create(host_impl_->active_tree(), 2);
2155 host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
2156 host_impl_->active_tree()->SetViewportLayersFromIds(
2160 host_impl_->SetViewportSize(viewport_size_);
2161 LayerImpl* root_clip_ptr = host_impl_->active_tree()->root_layer();
2178 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
2184 host_impl_->top_controls_manager()->ScrollBegin();
2185 host_impl_->top_controls_manager()->ScrollBy(top_controls_scroll_delta);
2186 host_impl_->top_controls_manager()->ScrollEnd();
2189 host_impl_->active_tree()->InnerViewportScrollLayer();
2191 host_impl_->ScrollEnd();
2201 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
2204 host_impl_->active_tree()->SetPageScaleFactorAndLimits(page_scale, 1.f, 2.f);
2209 host_impl_->top_controls_manager()->ScrollBegin();
2210 host_impl_->top_controls_manager()->ScrollBy(top_controls_scroll_delta);
2211 host_impl_->top_controls_manager()->ScrollEnd();
2214 host_impl_->active_tree()->InnerViewportScrollLayer();
2216 host_impl_->ScrollEnd();
2233 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
2235 host_impl_->top_controls_manager()->ScrollBegin();
2236 host_impl_->top_controls_manager()->ScrollBy(gfx::Vector2dF(0.f, 50.f));
2237 host_impl_->top_controls_manager()->ScrollEnd();
2238 EXPECT_EQ(0.f, host_impl_->top_controls_manager()->content_top_offset());
2240 LayerImpl* root_clip_ptr = host_impl_->active_tree()->root_layer();
2243 host_impl_->ScrollEnd();
2246 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
2249 host_impl_->top_controls_manager()->ScrollBegin();
2250 host_impl_->top_controls_manager()->ScrollBy(
2253 host_impl_->top_controls_manager()->content_top_offset());
2259 host_impl_->top_controls_manager()->ScrollBy(
2261 host_impl_->top_controls_manager()->ScrollEnd();
2263 host_impl_->top_controls_manager()->content_top_offset());
2267 host_impl_->ScrollEnd();
2272 host_impl_->active_tree()->InnerViewportScrollLayer()->MaxScrollOffset());
2275 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
2285 LayerImpl::Create(host_impl_->active_tree(), 1);
2293 LayerImpl::Create(host_impl_->active_tree(), 3);
2297 LayerImpl::Create(host_impl_->active_tree(), 2);
2305 host_impl_->active_tree()->SetRootLayer(scroll_clip_layer.Pass());
2306 host_impl_->SetViewportSize(surface_size);
2310 host_impl_->ScrollBegin(gfx::Point(5, 5),
2312 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
2313 host_impl_->ScrollEnd();
2321 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
2325 host_impl_->active_tree()->SetRootLayer(root.Pass());
2326 host_impl_->SetViewportSize(surface_size);
2330 host_impl_->ScrollBegin(gfx::Point(5, 5),
2332 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
2333 host_impl_->ScrollEnd();
2340 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
2342 host_impl_->active_tree()->SetRootLayer(root.Pass());
2343 host_impl_->SetViewportSize(surface_size);
2349 host_impl_->ScrollBegin(gfx::Point(15, 5),
2357 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
2360 host_impl_->SetViewportSize(surface_size);
2368 host_impl_->active_tree()->SetRootLayer(root.Pass());
2374 host_impl_->ScrollBegin(gfx::Point(5, 5),
2383 LayerImpl::Create(host_impl_->active_tree(), 3);
2396 host_impl_->active_tree()->SetRootLayer(clip_layer.Pass());
2397 host_impl_->SetViewportSize(surface_size);
2403 host_impl_->ScrollBegin(gfx::Point(5, 5),
2411 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
2413 LayerImpl::Create(host_impl_->active_tree(), 2);
2420 host_impl_->active_tree()->SetRootLayer(root.Pass());
2423 host_impl_->active_tree()->SetViewportLayersFromIds(1, 3, Layer::INVALID_ID);
2424 host_impl_->active_tree()->DidBecomeActive();
2425 host_impl_->SetViewportSize(viewport_size);
2429 host_impl_->active_tree()->InnerViewportScrollLayer();
2436 host_impl_->ScrollBegin(gfx::Point(5, 5),
2438 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
2439 host_impl_->ScrollEnd();
2442 host_impl_->active_tree()->SetPageScaleFactorAndLimits(page_scale,
2446 scoped_ptr<ScrollAndScaleSet> scroll_info = host_impl_->ProcessScrollDeltas();
2454 EXPECT_EQ(1.f, host_impl_->active_tree()->page_scale_delta());
2461 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
2463 LayerImpl::Create(host_impl_->active_tree(), 2);
2470 host_impl_->active_tree()->SetRootLayer(root.Pass());
2473 host_impl_->active_tree()->SetViewportLayersFromIds(1, 3, Layer::INVALID_ID);
2474 host_impl_->active_tree()->DidBecomeActive();
2475 host_impl_->SetViewportSize(viewport_size);
2476 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 1.f, page_scale);
2480 host_impl_->active_tree()->InnerViewportScrollLayer();
2487 host_impl_->ScrollBegin(gfx::Point(5, 5),
2489 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
2490 host_impl_->ScrollEnd();
2493 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
2494 host_impl_->PinchGestureBegin();
2495 host_impl_->PinchGestureUpdate(page_scale, gfx::Point());
2496 host_impl_->PinchGestureEnd();
2497 host_impl_->ScrollEnd();
2501 scoped_ptr<ScrollAndScaleSet> scroll_info = host_impl_->ProcessScrollDeltas();
2508 EXPECT_EQ(page_scale, host_impl_->active_tree()->total_page_scale_factor());
2523 LayerImpl* root = host_impl_->active_tree()->root_layer();
2527 LayerImpl::Create(host_impl_->active_tree(), 6);
2535 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
2536 host_impl_->PinchGestureBegin();
2537 host_impl_->PinchGestureUpdate(new_page_scale, gfx::Point());
2538 host_impl_->PinchGestureEnd();
2539 host_impl_->ScrollEnd();
2554 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
2555 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
2556 host_impl_->DidDrawAllLayers(frame);
2572 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
2575 LayerImpl::Create(host_impl_->active_tree(), 2);
2587 host_impl_->active_tree()->SetRootLayer(root.Pass());
2588 host_impl_->active_tree()->SetViewportLayersFromIds(1, 2, Layer::INVALID_ID);
2589 host_impl_->active_tree()->DidBecomeActive();
2590 host_impl_->SetViewportSize(surface_size);
2597 host_impl_->ScrollBegin(gfx::Point(5, 5),
2599 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
2600 host_impl_->ScrollEnd();
2603 host_impl_->active_tree()->SetPageScaleFactorAndLimits(page_scale,
2609 scoped_ptr<ScrollAndScaleSet> scroll_info = host_impl_->ProcessScrollDeltas();
2618 EXPECT_EQ(1.f, host_impl_->active_tree()->page_scale_delta());
2627 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
2640 host_impl_->active_tree()->SetRootLayer(root.Pass());
2641 host_impl_->active_tree()->DidBecomeActive();
2642 host_impl_->SetViewportSize(surface_size);
2650 host_impl_->ScrollBegin(gfx::Point(),
2652 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
2653 host_impl_->ScrollEnd();
2656 host_impl_->ProcessScrollDeltas();
2659 LayerImpl* child = host_impl_->active_tree()->root_layer()->children()[0];
2673 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
2690 host_impl_->active_tree()->SetRootLayer(root.Pass());
2691 host_impl_->active_tree()->SetViewportLayersFromIds(1, 2, Layer::INVALID_ID);
2692 host_impl_->active_tree()->DidBecomeActive();
2693 host_impl_->SetViewportSize(viewport_size);
2702 host_impl_->ScrollBegin(gfx::Point(),
2704 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
2705 host_impl_->ScrollEnd();
2708 host_impl_->ProcessScrollDeltas();
2712 host_impl_->active_tree()->root_layer()->children()[0]->children()[0];
2722 host_impl_->ScrollBegin(gfx::Point(5, 5),
2724 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
2725 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
2726 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), child);
2727 host_impl_->ScrollEnd();
2729 scroll_info = host_impl_->ProcessScrollDeltas();
2741 host_impl_->ScrollBegin(gfx::Point(5, 5),
2743 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
2744 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
2745 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
2746 host_impl_->ScrollEnd();
2748 scroll_info = host_impl_->ProcessScrollDeltas();
2758 host_impl_->active_tree()->SetPageScaleFactorAndLimits(2.f, 2.f, 2.f);
2759 host_impl_->active_tree()->SetPageScaleDelta(1.f);
2763 host_impl_->ScrollBegin(gfx::Point(1, 1),
2765 EXPECT_EQ(grand_child, host_impl_->CurrentlyScrollingLayer());
2766 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
2767 host_impl_->ScrollEnd();
2769 scroll_info = host_impl_->ProcessScrollDeltas();
2781 LayerImpl::Create(host_impl_->active_tree(), 3);
2795 host_impl_->SetViewportSize(surface_size);
2796 host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
2797 host_impl_->active_tree()->SetViewportLayersFromIds(3, 2, Layer::INVALID_ID);
2798 host_impl_->active_tree()->DidBecomeActive();
2803 host_impl_->ScrollBegin(gfx::Point(5, 5),
2805 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
2806 host_impl_->ScrollEnd();
2809 host_impl_->ProcessScrollDeltas();
2820 LayerImpl::Create(host_impl_->active_tree(), 1);
2825 host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
2826 host_impl_->active_tree()->SetViewportLayersFromIds(1, 2, Layer::INVALID_ID);
2827 host_impl_
2828 host_impl_->SetViewportSize(surface_size);
2833 host_impl_->active_tree()->DetachLayerTree();
2835 LayerImpl::Create(host_impl_->active_tree(), 3);
2840 host_impl_->active_tree()->SetRootLayer(root_clip2.Pass());
2841 host_impl_->active_tree()->SetViewportLayersFromIds(3, 4, Layer::INVALID_ID);
2842 host_impl_->active_tree()->DidBecomeActive();
2846 host_impl_->ScrollBegin(gfx::Point(5, 5),
2856 host_impl_->active_tree()->root_layer()->SetTransform(rotate_transform);
2859 host_impl_->SetViewportSize(surface_size);
2865 host_impl_->ScrollBegin(gfx::Point(),
2867 host_impl_->ScrollBy(gfx::Point(), gesture_scroll_delta);
2868 host_impl_->ScrollEnd();
2871 scoped_ptr<ScrollAndScaleSet> scroll_info = host_impl_->ProcessScrollDeltas();
2880 host_impl_->ScrollBegin(gfx::Point(),
2882 host_impl_->ScrollBy(gfx::Point(), wheel_scroll_delta);
2883 host_impl_->ScrollEnd();
2886 scroll_info = host_impl_->ProcessScrollDeltas();
2900 LayerImpl::Create(host_impl_->active_tree(), child_clip_layer_id);
2922 host_impl_->SetViewportSize(surface_size);
2928 host_impl_->ScrollBegin(gfx::Point(1, 1),
2930 host_impl_->ScrollBy(gfx::Point(), gesture_scroll_delta);
2931 host_impl_->ScrollEnd();
2940 host_impl_->ProcessScrollDeltas();
2952 host_impl_->ScrollBegin(gfx::Point(1, 1),
2954 host_impl_->ScrollBy(gfx::Point(), gesture_scroll_delta);
2955 host_impl_->ScrollEnd();
2964 host_impl_->ProcessScrollDeltas();
2990 host_impl_->SetViewportSize(surface_size);
2996 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
2997 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
2998 host_impl_->ScrollEnd();
3002 scoped_ptr<ScrollAndScaleSet> scroll_info = host_impl_->ProcessScrollDeltas();
3011 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
3012 host_impl_->ScrollBy(gfx::Point(), wheel_scroll_delta);
3013 host_impl_->ScrollEnd();
3016 scroll_info = host_impl_->ProcessScrollDeltas();
3027 host_impl_->SetViewportSize(gfx::Size(width * scale - 1, height * scale));
3028 host_impl_->SetDeviceScaleFactor(scale);
3029 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
3032 host_impl_->active_tree()->InnerViewportScrollLayer();
3108 host_impl_->SetViewportSize(gfx::Size(10, 20));
3117 host_impl_->SetRootLayerScrollOffsetDelegate(&scroll_delegate);
3130 host_impl_->active_tree()->SetPageScaleFactorAndLimits(2.f, 0.5f, 4.f);
3134 host_impl_->active_tree()->SetPageScaleDelta(1.5f);
3138 host_impl_->active_tree()->SetPageScaleDelta(1.f);
3139 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
3147 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture);
3148 host_impl_->PinchGestureBegin();
3149 host_impl_->PinchGestureUpdate(2.f, gfx::Point());
3150 host_impl_->PinchGestureUpdate(.5f, gfx::Point());
3151 host_impl_->PinchGestureEnd();
3152 host_impl_->ScrollEnd();
3160 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
3162 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
3168 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
3171 host_impl_->ScrollEnd();
3177 host_impl_->CreatePendingTree();
3178 CreateScrollAndContentsLayers(host_impl_->pending_tree(), new_size);
3179 host_impl_->ActivatePendingTree();
3186 host_impl_->SetRootLayerScrollOffsetDelegate(NULL);
3205 host_impl_->SetViewportSize(gfx::Size(10, 20));
3209 host_impl_->SetRootLayerScrollOffsetDelegate(&scroll_delegate);
3214 EXPECT_FALSE(host_impl_->active_tree()->needs_update_draw_properties());
3219 host_impl_->OnRootLayerDelegatedScrollOffsetChanged();
3225 host_impl_->SetRootLayerScrollOffsetDelegate(NULL);
3230 host_impl_
3231 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
3233 EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
3237 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
3238 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
3239 EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
3242 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 50));
3243 EXPECT_EQ(gfx::Vector2dF(0, 10), host_impl_->accumulated_root_overscroll());
3246 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, -50));
3247 EXPECT_EQ(gfx::Vector2dF(0, 0), host_impl_->accumulated_root_overscroll());
3248 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, -10));
3249 EXPECT_EQ(gfx::Vector2dF(0, -10), host_impl_->accumulated_root_overscroll());
3250 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(10, 0));
3251 EXPECT_EQ(gfx::Vector2dF(0, -10), host_impl_->accumulated_root_overscroll());
3252 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(-15, 0));
3253 EXPECT_EQ(gfx::Vector2dF(-5, -10), host_impl_->accumulated_root_overscroll());
3254 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 60));
3255 EXPECT_EQ(gfx::Vector2dF(-5, 10), host_impl_->accumulated_root_overscroll());
3256 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(10, -60));
3257 EXPECT_EQ(gfx::Vector2dF(0, -10), host_impl_->accumulated_root_overscroll());
3261 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, -20));
3262 EXPECT_EQ(gfx::Vector2dF(0, -30), host_impl_->accumulated_root_overscroll());
3263 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, -20));
3264 EXPECT_EQ(gfx::Vector2dF(0, -50), host_impl_->accumulated_root_overscroll());
3266 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
3267 EXPECT_EQ(gfx::Vector2dF(0, 0), host_impl_->accumulated_root_overscroll());
3268 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, -20));
3269 EXPECT_EQ(gfx::Vector2dF(0, -10), host_impl_->accumulated_root_overscroll());
3270 host_impl_->ScrollEnd();
3279 LayerImpl::Create(host_impl_->active_tree(), 4);
3296 host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
3297 host_impl_->active_tree()->DidBecomeActive();
3298 host_impl_->SetViewportSize(surface_size);
3303 host_impl_->ScrollBegin(gfx::Point(),
3305 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
3306 EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
3307 host_impl_->ScrollEnd();
3313 host_impl_->ScrollBegin(gfx::Point(5, 5),
3315 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child_layer);
3316 EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
3317 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
3318 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), child_layer);
3319 EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
3320 host_impl_->ScrollEnd();
3326 host_impl_->ScrollBegin(gfx::Point(5, 5),
3328 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child_layer);
3329 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
3330 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child_layer);
3331 EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
3332 host_impl_->ScrollEnd();
3343 LayerImpl::Create(host_impl_->active_tree(), 3);
3354 host_impl_->SetViewportSize(surface_size);
3355 host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
3356 host_impl_->active_tree()->SetViewportLayersFromIds(3, 1, Layer::INVALID_ID);
3357 host_impl_->active_tree()->DidBecomeActive();
3362 host_impl_->ScrollBegin(gfx::Point(5, 5),
3364 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
3365 EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
3366 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
3367 EXPECT_EQ(gfx::Vector2dF(0, 6), host_impl_->accumulated_root_overscroll());
3368 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
3369 EXPECT_EQ(gfx::Vector2dF(0, 14), host_impl_->accumulated_root_overscroll());
3370 host_impl_->ScrollEnd();
3381 host_impl_->SetViewportSize(gfx::Size(50, 50));
3382 host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
3384 EXPECT_EQ(gfx::Vector2dF(), host_impl_->accumulated_root_overscroll());
3388 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
3389 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
3390 EXPECT_EQ(gfx::Vector2dF(0, 10), host_impl_->accumulated_root_overscroll());
3398 LayerImpl::Create(host_impl_->active_tree(), 3);
3405 host_impl_->active_tree()->SetPageScaleFactorAndLimits(
3407 host_impl_->active_tree()->SetPageScaleDelta(1.f);
3412 host_impl_->SetViewportSize(surface_size);
3413 host_impl_->SetDeviceScaleFactor(device_scale_factor);
3414 host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
3415 host_impl_->active_tree()->SetViewportLayersFromIds(3, 1, Layer::INVALID_ID);
3416 host_impl_->active_tree()->DidBecomeActive();
3423 host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel));
3424 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, -1));
3426 host_impl_->accumulated_root_overscroll().ToString());
3428 host_impl_->ScrollEnd();
3436 LayerImpl::Create(host_impl_->active_tree(), 3);
3447 host_impl_->SetViewportSize(surface_size);
3448 host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
3449 host_impl_->active_tree()->SetViewportLayersFromIds(3, 1, Layer::INVALID_ID);
3450 host_impl_->active_tree()->DidBecomeActive();
3457 host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel));
3458 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 100));
3460 host_impl_->accumulated_root_overscroll().ToString());
3461 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, -2.30f));
3463 host_impl_->accumulated_root_overscroll().ToString());
3464 host_impl_->ScrollEnd();
3468 host_impl_->ScrollBegin(gfx::Point(0, 0),
3470 EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
3471 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0, 20));
3473 host_impl_->accumulated_root_overscroll().ToString());
3475 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(0.02f, -0.01f));
3477 host_impl_->accumulated_root_overscroll().ToString());
3478 host_impl_->ScrollEnd();
3482 host_impl_->ScrollBegin(gfx::Point(0, 0), InputHandler::Wheel));
3483 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2dF(-0.12f, 0.1f));
3485 host_impl_->accumulated_root_overscroll().ToString());
3486 host_impl_->ScrollEnd();
3576 LayerImpl::Create(host_impl_->active_tree(), 1);
3580 host_impl_->active_tree()->SetRootLayer(root.Pass());
3582 LayerImpl* root = host_impl_->active_tree()->root_layer();
3585 BlendStateCheckLayer::Create(host_impl_->active_tree(),
3587 host_impl_->resource_provider()));
3598 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3599 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3601 host_impl_
3607 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3608 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3610 host_impl_->DidDrawAllLayers(frame);
3617 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3618 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3620 host_impl_->DidDrawAllLayers(frame);
3627 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3628 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3630 host_impl_->DidDrawAllLayers(frame);
3633 BlendStateCheckLayer::Create(host_impl_->active_tree(),
3635 host_impl_->resource_provider()));
3649 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3650 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3653 host_impl_->DidDrawAllLayers(frame);
3662 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3663 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3666 host_impl_->DidDrawAllLayers(frame);
3676 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3677 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3680 host_impl_->DidDrawAllLayers(frame);
3693 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3694 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3697 host_impl_->DidDrawAllLayers(frame);
3709 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3710 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3713 host_impl_->DidDrawAllLayers(frame);
3724 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3725 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3728 host_impl_->DidDrawAllLayers(frame);
3740 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3741 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3744 host_impl_->DidDrawAllLayers(frame);
3753 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3754 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3756 host_impl_->DidDrawAllLayers(frame);
3765 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3766 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3768 host_impl_->DidDrawAllLayers(frame);
3777 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3778 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3780 host_impl_->DidDrawAllLayers(frame);
3790 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3791 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
3793 host_impl_->DidDrawAllLayers(frame);
3812 host_impl_->active_tree()->set_background_color(SK_ColorGRAY);
3813 host_impl_->active_tree()->SetRootLayer(
3814 LayerImpl::Create(host_impl_->active_tree(), 1));
3815 host_impl_->active_tree()->root_layer()->AddChild(
3816 BlendStateCheckLayer::Create(host_impl_->active_tree(),
3818 host_impl_->resource_provider()));
3820 host_impl_->active_tree()->root_layer()->children()[0]);
3835 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3843 host_impl_->DidDrawAllLayers(frame);
3856 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3864 host_impl_->DidDrawAllLayers(frame);
3877 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3885 host_impl_->DidDrawAllLayers(frame);
3899 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
3906 host_impl_->DidDrawAllLayers(frame);
3942 gutter_texture_size_, host_impl_->device_scale_factor());
3956 gfx::ScaleSize(size, host_impl_->device_scale_factor()));
3972 host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_));
3986 host_impl_->SetDeviceScaleFactor(2.f);
3987 host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_));
4001 host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_));
4009 host_impl_->CreateUIResource(ui_resource_id, ui_resource_bitmap);
4010 host_impl_->SetOverhangUIResource(ui_resource_id, gfx::Size(32, 32));
4020 host_impl_->SetOverhangUIResource(ui_resource_id, gfx::Size(128, 16));
4029 host_impl_->SetDeviceScaleFactor(2.f);
4030 host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_));
4045 host_impl_->CreatePendingTree();
4046 host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_));
4047 EXPECT_TRUE(host_impl_->active_tree()->ViewportSizeInvalid());
4062 host_impl_->CreatePendingTree();
4065 host_impl_->SetViewportSize(DipSizeToPixelSize(larger_viewport));
4066 EXPECT_TRUE(host_impl_->active_tree()->ViewportSizeInvalid());
4067 host_impl_->ActivatePendingTree();
4069 EXPECT_FALSE(host_impl_->active_tree()->ViewportSizeInvalid());
4072 host_impl_->CreatePendingTree();
4073 host_impl_->SetViewportSize(DipSizeToPixelSize(viewport_size_));
4074 EXPECT_TRUE(host_impl_->active_tree()->ViewportSizeInvalid());
4102 FakeDrawableLayerImpl::Create(host_impl_->active_tree(), 1);
4106 host_impl_->active_tree()->SetRootLayer(root.Pass());
4111 host_impl_->SetViewportSize(gfx::Size(10, 10));
4112 host_impl_->SetDeviceScaleFactor(1.f);
4113 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4114 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4119 host_impl_->DidDrawAllLayers(frame);
4122 host_impl_->SetViewportSize(gfx::Size(20, 30));
4123 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4124 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4129 host_impl_->DidDrawAllLayers(frame);
4132 host_impl_->SetDeviceScaleFactor(2.f);
4133 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4134 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4139 host_impl_->DidDrawAllLayers(frame);
4202 host_impl_->DidDrawAllLayers(frame);
4221 host_impl_->DidDrawAllLayers(frame);
4230 FakeDrawableLayerImpl::Create(host_impl_->active_tree(), 1);
4232 FakeDrawableLayerImpl::Create(host_impl_->active_tree(), 2);
4242 host_impl_->active_tree()->SetRootLayer(root.Pass());
4246 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4249 host_impl_->DidDrawAllLayers(frame);
4376 SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1));
4383 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4384 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4385 host_impl_->DidDrawAllLayers(frame);
4391 host_impl_->active_tree()->root_layer()->SetMasksToBounds(true);
4396 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4397 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4398 host_impl_->DidDrawAllLayers(frame);
4413 SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1));
4420 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4421 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4422 host_impl_->DidDrawAllLayers(frame);
4427 host_impl_->active_tree()->root_layer()->SetUpdateRect(
4435 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4436 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4437 host_impl_->DidDrawAllLayers(frame);
4582 LayerImpl::Create(host_impl_->active_tree(), 1);
4591 VideoLayerImpl::Create(host_impl_->active_tree(), 4, &provider);
4598 IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5);
4605 host_impl_->active_tree()->SetRootLayer(root_layer.Pass());
4610 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4611 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4612 host_impl_->DidDrawAllLayers(frame);
4613 host_impl_->SwapBuffers(frame);
4618 host_impl_->active_tree()->SetRootLayer(
4619 LayerImpl::Create(host_impl_->active_tree(), 100));
4645 SetupRootLayerImpl(LayerImpl::Create(host_impl_->active_tree(), 1));
4646 host_impl_->active_tree()->set_background_color(SK_ColorWHITE);
4649 host_impl_->active_tree()->set_has_transparent_background(false);
4655 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4656 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4657 host_impl_->DidDrawAllLayers(frame);
4661 host_impl_->active_tree()->set_has_transparent_background(true);
4662 host_impl_->SetFullRootLayerDamage();
4663 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4664 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4665 host_impl_->DidDrawAllLayers(frame);
4675 host_impl_->set_max_memory_needed_bytes(
4676 host_impl_->memory_allocation_limit_bytes() - 1);
4677 host_impl_->SetMemoryPolicy(ManagedMemoryPolicy(
4678 host_impl_->memory_allocation_limit_bytes() - 1));
4686 host_impl_->set_max_memory_needed_bytes(
4687 host_impl_->memory_allocation_limit_bytes());
4688 host_impl_->SetMemoryPolicy(ManagedMemoryPolicy(
4689 host_impl_->memory_allocation_limit_bytes() - 1));
4696 host_impl_->set_max_memory_needed_bytes(1);
4697 host_impl_->SetMemoryPolicy(ManagedMemoryPolicy(
4698 host_impl_->memory_allocation_limit_bytes() - 1));
4704 host_impl_->SetMemoryPolicy(ManagedMemoryPolicy(
4705 host_impl_->memory_allocation_limit_bytes()));
4720 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4736 LayerImpl* child = host_impl_->active_tree()->root_layer()->children()[0];
4741 LayerImpl* root = host_impl_->active_tree()->root_layer();
4747 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4748 host_impl_->DidDrawAllLayers(frame);
4749 EXPECT_EQ(expect_to_draw, host_impl_->SwapBuffers(frame));
4755 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
4763 SolidColorLayerImpl::Create(host_impl_->active_tree(), 2);
4770 host_impl_->active_tree()->SetRootLayer(root.PassAs<LayerImpl>());
4773 gfx::Rect full_frame_damage(host_impl_->DrawViewportSize());
4779 host_impl_->active_tree()->root_layer()->SetUpdateRect(small_damage);
4792 EXPECT_FALSE(host_impl_->GetRendererCapabilities().allow_rasterize_on_demand);
4823 LayerImpl::Create(host_impl_->active_tree(), 1);
4825 host_impl_->active_tree()->SetRootLayer(scoped_root.Pass());
4828 LayerImpl::Create(host_impl_->active_tree(), 2);
4833 LayerImpl::Create(host_impl_->active_tree(), 3);
4838 FakeMaskLayerImpl::Create(host_impl_->active_tree(), 4);
4869 host_impl_->SetViewportSize(root_size);
4870 host_impl_->SetDeviceScaleFactor(device_scale_factor);
4873 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4886 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4887 host_impl_->DidDrawAllLayers(frame);
4896 host_impl_->SetViewportSize(device_viewport);
4897 host_impl_->SetDeviceScaleFactor(device_scale_factor);
4898 host_impl_->active_tree()->set_needs_update_draw_properties();
4901 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4914 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4915 host_impl_->DidDrawAllLayers(frame);
4928 host_impl_->active_tree()->set_needs_update_draw_properties();
4931 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
4944 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
4945 host_impl_->DidDrawAllLayers(frame);
4954 LayerImpl::Create(host_impl_->active_tree(), 1);
4956 host_impl_->active_tree()->SetRootLayer(scoped_root.Pass());
4959 LayerImpl::Create(host_impl_->active_tree(), 3);
4964 FakeMaskLayerImpl::Create(host_impl_->active_tree(), 4);
4987 host_impl_->SetViewportSize(root_size);
4988 host_impl_->SetDeviceScaleFactor(device_scale_factor);
4991 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5004 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5005 host_impl_->DidDrawAllLayers(frame);
5013 host_impl_->SetViewportSize(device_viewport);
5014 host_impl_->SetDeviceScaleFactor(device_scale_factor);
5015 host_impl_->active_tree()->set_needs_update_draw_properties();
5018 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5031 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5032 host_impl_->DidDrawAllLayers(frame);
5045 host_impl_->active_tree()->set_needs_update_draw_properties();
5048 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5061 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5062 host_impl_->DidDrawAllLayers(frame);
5070 host_impl_->active_tree()->set_needs_update_draw_properties();
5073 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5086 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5087 host_impl_->DidDrawAllLayers(frame);
5096 LayerImpl::Create(host_impl_->active_tree(), 1);
5098 host_impl_->active_tree()->SetRootLayer(scoped_root.Pass());
5101 LayerImpl::Create(host_impl_->active_tree(), 3);
5106 LayerImpl::Create(host_impl_->active_tree(), 2);
5111 FakeMaskLayerImpl::Create(host_impl_->active_tree(), 4);
5134 host_impl_->SetViewportSize(root_size);
5135 host_impl_->SetDeviceScaleFactor(device_scale_factor);
5138 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5152 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5153 host_impl_->DidDrawAllLayers(frame);
5161 host_impl_->SetViewportSize(device_viewport);
5162 host_impl_->SetDeviceScaleFactor(device_scale_factor);
5163 host_impl_->active_tree()->set_needs_update_draw_properties();
5166 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5180 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5181 host_impl_->DidDrawAllLayers(frame);
5194 host_impl_->active_tree()->set_needs_update_draw_properties();
5197 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5211 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5212 host_impl_->DidDrawAllLayers(frame);
5220 host_impl_->active_tree()->set_needs_update_draw_properties();
5223 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5237 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5238 host_impl_->DidDrawAllLayers(frame);
5247 LayerImpl::Create(host_impl_->active_tree(), 1);
5249 host_impl_->active_tree()->SetRootLayer(scoped_root.Pass());
5252 LayerImpl::Create(host_impl_->active_tree(), 2);
5257 LayerImpl::Create(host_impl_->active_tree(), 3);
5262 LayerImpl::Create(host_impl_->active_tree(), 4);
5267 FakeMaskLayerImpl::Create(host_impl_->active_tree(), 5);
5295 host_impl_->SetViewportSize(root_size);
5296 host_impl_->SetDeviceScaleFactor(device_scale_factor);
5299 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5324 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5325 host_impl_->DidDrawAllLayers(frame);
5333 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5358 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5359 host_impl_->DidDrawAllLayers(frame);
5369 LayerImpl::Create(host_impl_->active_tree(), 1);
5371 host_impl_->active_tree()->SetRootLayer(scoped_root.Pass());
5374 LayerImpl::Create(host_impl_->active_tree(), 2);
5379 LayerImpl::Create(host_impl_->active_tree(), 3);
5384 LayerImpl::Create(host_impl_->active_tree(), 4);
5389 FakeMaskLayerImpl::Create(host_impl_->active_tree(), 6);
5423 host_impl_->SetViewportSize(root_size);
5424 host_impl_->SetDeviceScaleFactor(device_scale_factor);
5427 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5449 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5450 host_impl_->DidDrawAllLayers(frame);
5463 host_impl_->SetDeviceScaleFactor(device_scale_factor);
5467 host_impl_->SetViewportSize(device_viewport_size);
5469 host_impl_->CreatePendingTree();
5470 host_impl_->pending_tree()
5474 LayerImpl::Create(host_impl_->pending_tree(), 1);
5477 host_impl_->pending_tree()->SetRootLayer(scoped_root.Pass());
5480 LayerImpl::Create(host_impl_->pending_tree(), 2);
5490 FakePictureLayerImpl::CreateWithPile(host_impl_->pending_tree(), 3, pile);
5502 host_impl_->ActivatePendingTree();
5504 host_impl_->active_tree()->UpdateDrawProperties();
5505 ASSERT_EQ(1u, host_impl_->active_tree()->RenderSurfaceLayerList().size());
5508 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5521 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5522 host_impl_->DidDrawAllLayers(frame);
5539 SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1));
5542 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5543 host_impl_->DrawLayers(&frame, base::TimeTicks());
5544 host_impl_->DidDrawAllLayers(frame);
5547 host_impl_->ReclaimResources(&ack);
5548 host_impl_->DidSwapBuffersComplete();
5579 host_impl_->SetViewportSize(gfx::Size(50, 50));
5587 host_impl_->SetExternalDrawConstraints(external_transform,
5603 EXPECT_TRUE(host_impl_->AsValue());
5604 EXPECT_TRUE(host_impl_->ActivationStateAsValue());
5622 host_impl_->SetExternalDrawConstraints(external_transform,
5631 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
5636 VideoLayerImpl::Create(host_impl_->active_tree(), 2, &provider);
5644 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5645 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5646 host_impl_->DidDrawAllLayers(frame);
5649 EXPECT_EQ(host_impl_->active_tree()->root_layer(), frame.will_draw_layers[0]);
5670 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
5690 EXPECT_FALSE(host_impl_->output_surface()->context_provider());
5697 host_impl_->output_surface()->context_provider());
5706 EXPECT_FALSE(host_impl_->output_surface()->context_provider());
5721 EXPECT_FALSE(host_impl_->output_surface()->context_provider());
5727 EXPECT_FALSE(host_impl_->output_surface()->context_provider());
5738 host_impl_ = LayerTreeHostImpl::Create(settings,
5747 host_impl_->InitializeRenderer(output_surface.Pass());
5748 EXPECT_LT(0ul, host_impl_->memory_allocation_limit_bytes());
5763 EXPECT_FALSE(host_impl_->active_tree()->use_gpu_rasterization());
5764 EXPECT_TRUE(host_impl_->pending_tree() == NULL);
5766 host_impl_->SetVisible(true);
5767 host_impl_->SetMemoryPolicy(policy1);
5771 host_impl_->SetVisible(false);
5775 host_impl_->SetVisible(true);
5783 host_impl_ = LayerTreeHostImpl::Create(
5785 host_impl_->SetUseGpuRasterization(true);
5786 host_impl_->SetVisible(true);
5787 host_impl_->SetMemoryPolicy(policy1);
5791 host_impl_->SetVisible(false);
5797 ASSERT_TRUE(host_impl_->active_tree());
5799 EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
5800 host_impl_->SetVisible(false);
5801 EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
5802 host_impl_->SetVisible(true);
5803 EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
5804 host_impl_->SetVisible(false);
5805 EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
5807 host_impl_->CreatePendingTree();
5808 host_impl_->ActivatePendingTree();
5810 EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
5811 host_impl_->SetVisible(true);
5812 EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
5816 ASSERT_TRUE(host_impl_->active_tree());
5817 EXPECT_FALSE(host_impl_->use_gpu_rasterization());
5819 EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
5820 host_impl_->SetUseGpuRasterization(false);
5821 EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
5822 host_impl_->SetUseGpuRasterization(true);
5823 EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
5824 host_impl_->SetUseGpuRasterization(false);
5825 EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
5827 host_impl_->CreatePendingTree();
5828 host_impl_->ActivatePendingTree();
5830 EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
5831 host_impl_->SetUseGpuRasterization(true);
5832 EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
5843 host_impl_.reset(fake_host_impl_);
5844 host_impl_->InitializeRenderer(CreateOutputSurface());
5845 host_impl_->SetViewportSize(gfx::Size(10, 10));
5870 host_impl_->CreateUIResource(ui_resource_id, bitmap);
5873 host_impl_->ResourceIdForUIResource(ui_resource_id);
5878 host_impl_->CreateUIResource(ui_resource_id, bitmap);
5881 host_impl_->ResourceIdForUIResource(ui_resource_id);
5886 host_impl_->DeleteUIResource(-1);
5891 EXPECT_EQ(0u, host_impl_->ResourceIdForUIResource(-1));
5894 host_impl_->DeleteUIResource(ui_resource_id);
5895 EXPECT_EQ(0u, host_impl_->ResourceIdForUIResource(ui_resource_id));
5899 host_impl_->DeleteUIResource(ui_resource_id);
5923 host_impl_->CreateUIResource(ui_resource_id, bitmap);
5926 host_impl_->ResourceIdForUIResource(ui_resource_id);
5941 SetupRootLayerImpl(LayerImpl::Create(host_impl_->active_tree(), 1));
5947 host_impl_->active_tree()->root_layer()->PassCopyRequests(&requests);
5950 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
5951 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
5952 host_impl_->DidDrawAllLayers(frame);
5959 host_impl_.reset();
5973 LayerImpl::Create(host_impl_->active_tree(), 3);
5984 host_impl_->SetViewportSize(surface_size);
5985 host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
5986 host_impl_->active_tree()->SetViewportLayersFromIds(3, 1, Layer::INVALID_ID);
5987 host_impl_->active_tree()->DidBecomeActive();
5991 host_impl_->ScrollBegin(gfx::Point(),
5995 host_impl_->FlingScrollBegin());
5998 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
5999 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
6001 host_impl_->ScrollEnd();
6004 host_impl_->ProcessScrollDeltas();
6016 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
6031 host_impl_->active_tree()->SetRootLayer(root.Pass());
6032 host_impl_->active_tree()->DidBecomeActive();
6033 host_impl_->SetViewportSize(surface_size);
6038 host_impl_->active_tree()->root_layer()->children()[0]->children()[0];
6043 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
6044 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), scroll_delta));
6047 scroll_info = host_impl_->ProcessScrollDeltas();
6050 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
6054 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), scroll_delta));
6055 scroll_info = host_impl_->ProcessScrollDeltas();
6059 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), grand_child);
6063 EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
6064 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), scroll_delta));
6065 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), child);
6068 scroll_info = host_impl_->ProcessScrollDeltas();
6074 EXPECT_FALSE(host_impl_->ScrollBy(gfx::Point(), scroll_delta));
6075 EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), child);
6076 host_impl_->ScrollEnd();
6086 LayerImpl::Create(host_impl_->active_tree(), 3);
6096 host_impl_->SetViewportSize(surface_size);
6097 host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
6098 host_impl_->active_tree()->DidBecomeActive();
6102 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
6105 host_impl_->FlingScrollBegin());
6108 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
6109 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
6111 host_impl_->ScrollEnd();
6114 host_impl_->ProcessScrollDeltas();
6130 host_impl_->active_tree()->LayerById(scroll_layer_id);
6135 host_impl_->active_tree()->LayerById(page_scale_layer_id);
6139 LayerImpl::Create(host_impl_->active_tree(), occluder_layer_id);
6151 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
6163 host_impl_->active_tree()->LayerById(scroll_layer_id);
6168 LayerImpl::Create(host_impl_->active_tree(), occluder_layer_id);
6176 LayerImpl::Create(host_impl_->active_tree(), child_scroll_clip_layer_id);
6190 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
6197 LayerImpl* root = host_impl_->active_tree()->LayerById(1);
6201 host_impl_->active_tree()->LayerById(scroll_layer_id);
6219 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
6221 EXPECT_EQ(2, host_impl_->CurrentlyScrollingLayer()->id());
6232 LayerImpl* root = host_impl_->active_tree()->LayerById(1);
6236 host_impl_->active_tree()->LayerById(scroll_layer_id);
6240 LayerImpl::Create(host_impl_->active_tree(), scroll_child_id);
6254 LayerImpl::Create(host_impl_->active_tree(), container_id);
6276 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
6278 EXPECT_EQ(7, host_impl_->CurrentlyScrollingLayer()->id());
6285 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
6291 host_impl_->active_tree()->SetRootLayer(root.PassAs<LayerImpl>());
6294 static_cast<FakeOutputSurface*>(host_impl_->output_surface());
6305 host_impl_->active_tree()->QueueSwapPromise(swap_promise.Pass());
6306 host_impl_->SetNeedsRedraw();
6308 gfx::Rect full_frame_damage(host_impl_->DrawViewportSize());
6310 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
6311 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
6312 host_impl_->DidDrawAllLayers(frame);
6313 EXPECT_TRUE(host_impl_->SwapBuffers(frame));
6354 host_impl_.get(),
6357 host_impl_->SetNeedsRedraw();
6364 host_impl_->SetNeedsRedraw();
6371 host_impl_.get(),
6374 host_impl_->SetNeedsRedrawRect(gfx::Rect(10, 10));
6382 host_impl_.get(),
6386 host_impl_->SetNeedsRedrawRect(gfx::Rect());
6410 host_impl_->Animate(base::TimeTicks());
6417 host_impl_->DidChangeTopControlsPosition();
6424 host_impl_->SetViewportSize(gfx::Size(100, 100));
6428 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
6429 EXPECT_EQ(0, host_impl_->top_controls_manager()->controls_top_offset());
6436 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, offset)));
6437 EXPECT_EQ(-offset, host_impl_->top_controls_manager()->controls_top_offset());
6444 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, offset)));
6446 host_impl_->top_controls_manager()->controls_top_offset());
6452 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, offset)));
6454 host_impl_->top_controls_manager()->controls_top_offset());
6460 EXPECT_TRUE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, offset)));
6461 EXPECT_EQ(0, host_impl_->top_controls_manager()->controls_top_offset());
6466 EXPECT_FALSE(host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, offset)));
6467 EXPECT_EQ(0, host_impl_->top_controls_manager()->controls_top_offset());
6471 host_impl_->ScrollEnd();
6479 LayerTreeImpl* layer_tree_impl = host_impl_->active_tree();
6533 host_impl_->active_tree()->DidBecomeActive();
6544 LayerImpl* outer_scroll = host_impl_->OuterViewportScrollLayer();
6545 LayerImpl* inner_scroll = host_impl_->InnerViewportScrollLayer();
6555 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
6556 EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
6559 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
6562 host_impl_->ScrollEnd();
6569 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Gesture));
6570 EXPECT_EQ(InputHandler::ScrollStarted, host_impl_->FlingScrollBegin());
6572 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
6575 host_impl_->ScrollBy(gfx::Point(), scroll_delta);
6578 host_impl_->ScrollEnd();
6600 host_impl_->SetMemoryPolicy(mem_policy);
6601 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes,
6603 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes,
6615 host_impl_->SetExternalDrawConstraints(external_transform,
6624 host_impl_->SetExternalDrawConstraints(external_transform,