Index: cc/trees/layer_tree_host_impl_unittest.cc |
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc |
index 0bb9a54f624447c8c6f5ed482fe3b488d0c6ea75..d5fbea9c85279da93af77101a522960193484eb9 100644 |
--- a/cc/trees/layer_tree_host_impl_unittest.cc |
+++ b/cc/trees/layer_tree_host_impl_unittest.cc |
@@ -55,7 +55,6 @@ |
#include "cc/test/fake_raster_source.h" |
#include "cc/test/fake_video_frame_provider.h" |
#include "cc/test/geometry_test_utils.h" |
-#include "cc/test/gpu_rasterization_enabled_settings.h" |
#include "cc/test/layer_test_common.h" |
#include "cc/test/layer_tree_test.h" |
#include "cc/test/test_compositor_frame_sink.h" |
@@ -112,7 +111,6 @@ class LayerTreeHostImplTest : public testing::Test, |
LayerTreeSettings settings; |
settings.minimum_occlusion_tracking_size = gfx::Size(); |
settings.renderer_settings.texture_id_allocation_chunk_size = 1; |
- settings.gpu_rasterization_enabled = true; |
settings.verify_clip_tree_calculations = true; |
settings.renderer_settings.buffer_to_texture_target_map = |
DefaultBufferToTextureTargetMapForTesting(); |
@@ -469,7 +467,7 @@ class LayerTreeHostImplTest : public testing::Test, |
protected: |
virtual std::unique_ptr<CompositorFrameSink> CreateCompositorFrameSink() { |
- return FakeCompositorFrameSink::Create3d(); |
+ return FakeCompositorFrameSink::Create3dForGpuRasterization(); |
} |
void DrawOneFrame() { |
@@ -11237,7 +11235,8 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusDeviceScaleFactor) { |
std::unique_ptr<TestWebGraphicsContext3D> context_with_msaa = |
TestWebGraphicsContext3D::Create(); |
context_with_msaa->SetMaxSamples(4); |
- LayerTreeSettings msaaSettings = GpuRasterizationEnabledSettings(); |
+ context_with_msaa->set_gpu_rasterization(true); |
+ LayerTreeSettings msaaSettings = DefaultSettings(); |
msaaSettings.gpu_rasterization_msaa_sample_count = -1; |
EXPECT_TRUE(CreateHostImpl(msaaSettings, FakeCompositorFrameSink::Create3d( |
std::move(context_with_msaa)))); |
@@ -11274,7 +11273,8 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusExplicitMSAACount) { |
std::unique_ptr<TestWebGraphicsContext3D> context_with_msaa = |
TestWebGraphicsContext3D::Create(); |
context_with_msaa->SetMaxSamples(4); |
- LayerTreeSettings msaaSettings = GpuRasterizationEnabledSettings(); |
+ context_with_msaa->set_gpu_rasterization(true); |
+ LayerTreeSettings msaaSettings = DefaultSettings(); |
msaaSettings.gpu_rasterization_msaa_sample_count = 4; |
EXPECT_TRUE(CreateHostImpl(msaaSettings, FakeCompositorFrameSink::Create3d( |
std::move(context_with_msaa)))); |
@@ -11288,11 +11288,19 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusExplicitMSAACount) { |
EXPECT_TRUE(host_impl_->use_msaa()); |
} |
+class GpuRasterizationDisabledLayerTreeHostImplTest |
+ : public LayerTreeHostImplTest { |
+ public: |
+ std::unique_ptr<CompositorFrameSink> CreateCompositorFrameSink() override { |
+ return FakeCompositorFrameSink::Create3d(); |
+ } |
+}; |
+ |
// Tests that GPU rasterization overrides work as expected. |
-TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusOverrides) { |
+TEST_F(GpuRasterizationDisabledLayerTreeHostImplTest, |
+ GpuRasterizationStatusOverrides) { |
// GPU rasterization explicitly disabled. |
LayerTreeSettings settings = DefaultSettings(); |
- settings.gpu_rasterization_enabled = false; |
EXPECT_TRUE(CreateHostImpl(settings, FakeCompositorFrameSink::Create3d())); |
host_impl_->SetHasGpuRasterizationTrigger(true); |
host_impl_->SetContentIsSuitableForGpuRasterization(true); |
@@ -11317,11 +11325,11 @@ class MsaaIsSlowLayerTreeHostImplTest : public LayerTreeHostImplTest { |
public: |
void CreateHostImplWithMsaaIsSlow(bool msaa_is_slow) { |
LayerTreeSettings settings = DefaultSettings(); |
- settings.gpu_rasterization_enabled = true; |
settings.gpu_rasterization_msaa_sample_count = 4; |
auto context_provider = TestContextProvider::Create(); |
context_provider->UnboundTestContext3d()->SetMaxSamples(4); |
context_provider->UnboundTestContext3d()->set_msaa_is_slow(msaa_is_slow); |
+ context_provider->UnboundTestContext3d()->set_gpu_rasterization(true); |
auto msaa_is_normal_compositor_frame_sink = |
FakeCompositorFrameSink::Create3d(context_provider); |
EXPECT_TRUE(CreateHostImpl( |