Commit 195ff384 authored by Yi Gu's avatar Yi Gu Committed by Commit Bot

[CodeHealth] Remove IsVizHitTestingDrawQuadEnabled from features

Previously we had both kEnableVizHitTestDrawQuad (VizHitTesting v1) and
kEnableVizHitTestSurfaceLayer(v2). After v1 being shipped, the function
IsVizHitTestingDrawQuadEnabled() was no longer useful. It just returns
!IsVizHitTestingSurfaceLayerEnabled().

Bug: 917015
Change-Id: Id7791763704235238cf0cfbc91bbf580128fa543
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762588Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688705}
parent 6a718bb1
......@@ -67,10 +67,6 @@ bool IsVizHitTestingDebugEnabled() {
switches::kEnableVizHitTestDebug);
}
bool IsVizHitTestingDrawQuadEnabled() {
return !IsVizHitTestingSurfaceLayerEnabled();
}
// VizHitTestSurfaceLayer is enabled when this feature is explicitly enabled on
// chrome://flags, or when it is enabled by finch and chrome://flags does not
// conflict.
......
......@@ -20,7 +20,6 @@ VIZ_COMMON_EXPORT extern const base::Feature kVizDisplayCompositor;
VIZ_COMMON_EXPORT bool IsSurfaceSynchronizationEnabled();
VIZ_COMMON_EXPORT bool IsVizDisplayCompositorEnabled();
VIZ_COMMON_EXPORT bool IsVizHitTestingDebugEnabled();
VIZ_COMMON_EXPORT bool IsVizHitTestingDrawQuadEnabled();
VIZ_COMMON_EXPORT bool IsVizHitTestingSurfaceLayerEnabled();
VIZ_COMMON_EXPORT bool IsUsingSkiaForGLReadback();
VIZ_COMMON_EXPORT bool IsUsingSkiaRenderer();
......
......@@ -6573,11 +6573,11 @@ IN_PROC_BROWSER_TEST_P(SitePerProcessHitTestDataGenerationBrowserTest,
// path hit testing for the iframe in V2 hit testing.
// When VizDisplayCompositor is enabled, HitTestDataProviderDrawQuad will
// override LTHI's hit test data.
if (features::IsVizHitTestingDrawQuadEnabled()) {
if (!features::IsVizHitTestingSurfaceLayerEnabled()) {
// In V1 hit testing, we expect slow path and the submitted region should be
// equivalent to the unclipped iframe bounds.
expected_flags = kSlowHitTestFlags;
} else if (features::IsVizHitTestingSurfaceLayerEnabled()) {
} else {
// In V2 hit testing fast path, we expect precise clipped iframe bounds in
// its own space.
expected_transformed_region = gfx::ScaleToEnclosingRect(
......@@ -6617,7 +6617,7 @@ IN_PROC_BROWSER_TEST_P(SitePerProcessHitTestDataGenerationBrowserTest,
gfx::Transform expected_transform;
gfx::Rect expected_region = gfx::ScaleToEnclosingRect(
gfx::Rect(200, 200), device_scale_factor, device_scale_factor);
if (!features::IsVizHitTestingDrawQuadEnabled()) {
if (features::IsVizHitTestingSurfaceLayerEnabled()) {
expected_region = gfx::ScaleToEnclosingRect(
gfx::Rect(100 / 1.414, 100), device_scale_factor, device_scale_factor);
}
......@@ -6749,9 +6749,9 @@ IN_PROC_BROWSER_TEST_P(SitePerProcessHitTestDataGenerationBrowserTest,
EXPECT_EQ(expected_region.ToString(), hit_test_data[2].rect.ToString());
EXPECT_TRUE(
expected_transform2.ApproximatelyEqual(hit_test_data[2].transform()));
if (features::IsVizHitTestingDrawQuadEnabled())
if (!features::IsVizHitTestingSurfaceLayerEnabled())
EXPECT_EQ(kSlowHitTestFlags, hit_test_data[2].flags);
else if (features::IsVizHitTestingSurfaceLayerEnabled())
else
EXPECT_EQ(kFastHitTestFlags, hit_test_data[2].flags);
}
......
......@@ -1890,7 +1890,7 @@ void RenderThreadImpl::RequestNewLayerTreeFrameSink(
params.enable_surface_synchronization = true;
params.local_surface_id_provider =
std::make_unique<RendererLocalSurfaceIdProvider>();
if (features::IsVizHitTestingDrawQuadEnabled()) {
if (!features::IsVizHitTestingSurfaceLayerEnabled()) {
params.hit_test_data_provider =
std::make_unique<viz::HitTestDataProviderDrawQuad>(
true /* should_ask_for_child_region */,
......
......@@ -1172,7 +1172,7 @@ std::unique_ptr<cc::LayerTreeFrameSink> Window::CreateLayerTreeFrameSink() {
bool root_accepts_events =
(event_targeting_policy_ == EventTargetingPolicy::kTargetOnly) ||
(event_targeting_policy_ == EventTargetingPolicy::kTargetAndDescendants);
if (features::IsVizHitTestingDrawQuadEnabled()) {
if (!features::IsVizHitTestingSurfaceLayerEnabled()) {
params.hit_test_data_provider =
std::make_unique<viz::HitTestDataProviderDrawQuad>(
true /* should_ask_for_child_region */, root_accepts_events);
......
......@@ -147,7 +147,7 @@ void HostContextFactoryPrivate::ConfigureCompositor(
params.pipes.compositor_frame_sink_associated_info = std::move(sink_info);
params.pipes.client_request = std::move(client_request);
params.enable_surface_synchronization = true;
if (features::IsVizHitTestingDrawQuadEnabled()) {
if (!features::IsVizHitTestingSurfaceLayerEnabled()) {
params.hit_test_data_provider =
std::make_unique<viz::HitTestDataProviderDrawQuad>(
false /* should_ask_for_child_region */,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment