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

Unified Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1781093002: Add CONTEXT_TYPE_OPENGLES2_PEPPER (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rev bug list json version Created 4 years, 9 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/test/test_web_graphics_context_3d.h ('k') | gpu/command_buffer/common/capabilities.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5be1b466a9c113e001acdbf422c31a5af0dbee44..9c968bde7260904a7f4396d75272bab4f705ae85 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -10188,6 +10188,42 @@ TEST_F(LayerTreeHostImplTest, GpuRasterizationStatusModes) {
EXPECT_TRUE(host_impl_->use_gpu_rasterization());
}
+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);
+ auto msaa_is_normal_output_surface =
+ FakeOutputSurface::Create3d(context_provider);
+ EXPECT_TRUE(
+ CreateHostImpl(settings, std::move(msaa_is_normal_output_surface)));
+ }
+};
+
+TEST_F(MsaaIsSlowLayerTreeHostImplTest, GpuRasterizationStatusMsaaIsSlow) {
+ // Ensure that without the msaa_is_slow cap we raster unsuitable content with
+ // msaa.
+ CreateHostImplWithMsaaIsSlow(false);
+ host_impl_->SetHasGpuRasterizationTrigger(true);
+ host_impl_->SetContentIsSuitableForGpuRasterization(false);
+ EXPECT_EQ(GpuRasterizationStatus::MSAA_CONTENT,
+ host_impl_->gpu_rasterization_status());
+ EXPECT_TRUE(host_impl_->use_gpu_rasterization());
+
+ // Ensure that with the msaa_is_slow cap we don't raster unsuitable content
+ // with msaa.
+ CreateHostImplWithMsaaIsSlow(true);
+ host_impl_->SetHasGpuRasterizationTrigger(true);
+ host_impl_->SetContentIsSuitableForGpuRasterization(false);
+ EXPECT_EQ(GpuRasterizationStatus::OFF_CONTENT,
+ host_impl_->gpu_rasterization_status());
+ EXPECT_FALSE(host_impl_->use_gpu_rasterization());
+}
+
// A mock output surface which lets us detect calls to ForceReclaimResources.
class MockReclaimResourcesOutputSurface : public FakeOutputSurface {
public:
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | gpu/command_buffer/common/capabilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698