Commit d7d9e582 authored by Ria Jiang's avatar Ria Jiang Committed by Commit Bot

Delete HitTestDataProviderAura.

HitTestDataProviderAura is no longer in use; all previous use cases
were updated to use HitTestDataProviderDrawQuad. Clean up
HitTestDataProviderAura related code.

Bug: none
Change-Id: I2e67411c1c145cf5e5fe527c79ec2bfbd00c6570
Reviewed-on: https://chromium-review.googlesource.com/c/1338327Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Ria Jiang <riajiang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608636}
parent 786b4918
...@@ -32,7 +32,6 @@ jumbo_component("aura") { ...@@ -32,7 +32,6 @@ jumbo_component("aura") {
"env_input_state_controller.h", "env_input_state_controller.h",
"env_observer.h", "env_observer.h",
"event_injector.h", "event_injector.h",
"hit_test_data_provider_aura.h",
"input_state_lookup.h", "input_state_lookup.h",
"input_state_lookup_win.h", "input_state_lookup_win.h",
"layout_manager.h", "layout_manager.h",
...@@ -108,7 +107,6 @@ jumbo_component("aura") { ...@@ -108,7 +107,6 @@ jumbo_component("aura") {
"env.cc", "env.cc",
"env_input_state_controller.cc", "env_input_state_controller.cc",
"event_injector.cc", "event_injector.cc",
"hit_test_data_provider_aura.cc",
"input_state_lookup.cc", "input_state_lookup.cc",
"input_state_lookup_win.cc", "input_state_lookup_win.cc",
"layout_manager.cc", "layout_manager.cc",
...@@ -381,7 +379,6 @@ test("aura_unittests") { ...@@ -381,7 +379,6 @@ test("aura_unittests") {
"../compositor_extra/shadow_unittest.cc", "../compositor_extra/shadow_unittest.cc",
"//ui/aura_extra/window_occlusion_impl_unittest_win.cc", "//ui/aura_extra/window_occlusion_impl_unittest_win.cc",
"gestures/gesture_recognizer_unittest.cc", "gestures/gesture_recognizer_unittest.cc",
"hit_test_data_provider_aura_unittest.cc",
"mouse_location_manager_unittest.cc", "mouse_location_manager_unittest.cc",
"mus/drag_drop_controller_mus_unittest.cc", "mus/drag_drop_controller_mus_unittest.cc",
"mus/focus_synchronizer_unittest.cc", "mus/focus_synchronizer_unittest.cc",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/aura/hit_test_data_provider_aura.h"
#include "base/containers/adapters.h"
#include "components/viz/common/hit_test/hit_test_region_list.h"
#include "services/ws/public/mojom/window_tree_constants.mojom.h"
#include "ui/aura/window.h"
#include "ui/aura/window_targeter.h"
namespace {
void PopulateHitTestRegion(viz::HitTestRegion* hit_test_region,
const aura::Window* window,
uint32_t flags,
const gfx::Rect& rect) {
const ui::Layer* layer = window->layer();
DCHECK(layer);
DCHECK(window->GetFrameSinkId().is_valid());
hit_test_region->frame_sink_id = window->GetFrameSinkId();
// Checking |layer| may not be correct, since the actual layer that embeds
// the surface may be a descendent of |layer|, instead of |layer| itself.
if (window->IsEmbeddingClient())
hit_test_region->flags =
flags | viz::HitTestRegionFlags::kHitTestChildSurface;
else
hit_test_region->flags = flags | viz::HitTestRegionFlags::kHitTestMine;
hit_test_region->rect = rect;
hit_test_region->transform = layer->transform();
}
} // namespace
namespace aura {
HitTestDataProviderAura::HitTestDataProviderAura(aura::Window* window)
: window_(window) {}
HitTestDataProviderAura::~HitTestDataProviderAura() {}
base::Optional<viz::HitTestRegionList> HitTestDataProviderAura::GetHitTestData(
const viz::CompositorFrame& compositor_frame) const {
const ws::mojom::EventTargetingPolicy event_targeting_policy =
window_->event_targeting_policy();
if (!window_->IsVisible() ||
event_targeting_policy == ws::mojom::EventTargetingPolicy::NONE)
return base::nullopt;
base::Optional<viz::HitTestRegionList> hit_test_region_list(base::in_place);
hit_test_region_list->flags =
event_targeting_policy ==
ws::mojom::EventTargetingPolicy::DESCENDANTS_ONLY
? viz::HitTestRegionFlags::kHitTestIgnore
: viz::HitTestRegionFlags::kHitTestMine;
// TODO(crbug.com/805416): Use pixels instead of DIP units for bounds.
hit_test_region_list->bounds = window_->bounds();
GetHitTestDataRecursively(window_, &*hit_test_region_list);
return hit_test_region_list;
}
void HitTestDataProviderAura::GetHitTestDataRecursively(
aura::Window* window,
viz::HitTestRegionList* hit_test_region_list) const {
if (window->IsEmbeddingClient())
return;
WindowTargeter* parent_targeter = window->targeter();
// TODO(varkha): Figure out if we need to add hit-test regions for |window|.
// Walk the children in Z-order (reversed order of children()) to produce
// the hit-test data. Each child's hit test data is added before the hit-test
// data from the child's descendants because the child could clip its
// descendants for the purpose of event handling.
for (aura::Window* child : base::Reversed(window->children())) {
const ws::mojom::EventTargetingPolicy event_targeting_policy =
child->event_targeting_policy();
if (!child->IsVisible() ||
event_targeting_policy == ws::mojom::EventTargetingPolicy::NONE)
continue;
if (event_targeting_policy !=
ws::mojom::EventTargetingPolicy::DESCENDANTS_ONLY) {
gfx::Rect rect_mouse(child->bounds());
gfx::Rect rect_touch;
bool touch_and_mouse_are_same = true;
WindowTargeter* targeter = child->targeter();
if (!targeter)
targeter = parent_targeter;
// Use the |child|'s (when set) or the |window|'s |targeter| to query for
// possibly expanded hit-test area. Use the |child| bounds with mouse and
// touch flags when there is no |targeter|.
if (targeter &&
targeter->GetHitTestRects(child, &rect_mouse, &rect_touch)) {
touch_and_mouse_are_same = rect_mouse == rect_touch;
}
auto shape_rects =
targeter ? targeter->GetExtraHitTestShapeRects(child) : nullptr;
if (shape_rects) {
// The |child| has a complex shape. Clip it to |rect_mouse|.
const gfx::Vector2d offset = child->bounds().OffsetFromOrigin();
for (const gfx::Rect& shape_rect : *shape_rects) {
gfx::Rect rect = shape_rect;
rect.Offset(offset);
rect.Intersect(rect_mouse);
if (rect.IsEmpty())
continue;
hit_test_region_list->regions.emplace_back();
PopulateHitTestRegion(&hit_test_region_list->regions.back(), child,
viz::HitTestRegionFlags::kHitTestMouse |
viz::HitTestRegionFlags::kHitTestTouch,
rect);
}
} else {
// The |child| has possibly same mouse and touch hit-test areas.
if (!rect_mouse.IsEmpty()) {
hit_test_region_list->regions.emplace_back();
PopulateHitTestRegion(&hit_test_region_list->regions.back(), child,
touch_and_mouse_are_same
? (viz::HitTestRegionFlags::kHitTestMouse |
viz::HitTestRegionFlags::kHitTestTouch)
: viz::HitTestRegionFlags::kHitTestMouse,
rect_mouse);
}
if (!touch_and_mouse_are_same && !rect_touch.IsEmpty()) {
hit_test_region_list->regions.emplace_back();
PopulateHitTestRegion(&hit_test_region_list->regions.back(), child,
viz::HitTestRegionFlags::kHitTestTouch,
rect_touch);
}
}
}
if (event_targeting_policy != ws::mojom::EventTargetingPolicy::TARGET_ONLY)
GetHitTestDataRecursively(child, hit_test_region_list);
}
}
} // namespace aura
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_AURA_HIT_TEST_DATA_PROVIDER_AURA_H_
#define UI_AURA_HIT_TEST_DATA_PROVIDER_AURA_H_
#include "base/macros.h"
#include "components/viz/client/hit_test_data_provider.h"
#include "ui/aura/aura_export.h"
namespace aura {
class Window;
// A HitTestDataProvider that captures hit-test areas from a aura::Window tree
// and packages it to be submitted to compositor frame sink. The |window| used
// when creating the HitTestDataProviderAura should outlive the data provider.
class AURA_EXPORT HitTestDataProviderAura : public viz::HitTestDataProvider {
public:
explicit HitTestDataProviderAura(Window* window);
~HitTestDataProviderAura() override;
// HitTestDataProvider:
base::Optional<viz::HitTestRegionList> GetHitTestData(
const viz::CompositorFrame& compositor_frame) const override;
private:
// Recursively walks the children of |window| and uses |window|'s
// EventTargeter to generate hit-test data for the |window|'s descendants.
// Populates |hit_test_region_list|.
void GetHitTestDataRecursively(
aura::Window* window,
viz::HitTestRegionList* hit_test_region_list) const;
aura::Window* const window_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(HitTestDataProviderAura);
};
} // namespace aura
#endif // UI_AURA_HIT_TEST_DATA_PROVIDER_AURA_H_
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/aura/hit_test_data_provider_aura.h"
#include "components/viz/client/hit_test_data_provider.h"
#include "components/viz/common/hit_test/hit_test_region_list.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/test/mus/window_port_mus_test_helper.h"
#include "ui/aura/window.h"
#include "ui/aura/window_targeter.h"
#include "ui/gfx/geometry/rect.h"
namespace aura {
namespace {
// Custom WindowTargeter that replaces hit-test area on a window with a frame
// rectangle and a hole in the middle 1/3.
// ----------------------
// | hit hit |
// | ---------- |
// | | | |
// | | No hit | hit |
// | | | |
// | hit | | |
// | ---------- |
// | hit hit |
// ----------------------
class TestHoleWindowTargeter : public WindowTargeter {
public:
TestHoleWindowTargeter() = default;
~TestHoleWindowTargeter() override {}
private:
// WindowTargeter:
std::unique_ptr<WindowTargeter::HitTestRects> GetExtraHitTestShapeRects(
Window* target) const override {
gfx::Rect bounds = target->bounds();
int x0 = 0;
int x1 = bounds.width() / 3;
int x2 = bounds.width() - bounds.width() / 3;
int x3 = bounds.width();
int y0 = 0;
int y1 = bounds.height() / 3;
int y2 = bounds.height() - bounds.height() / 3;
int y3 = bounds.height();
auto shape_rects = std::make_unique<WindowTargeter::HitTestRects>();
shape_rects->emplace_back(x0, y0, bounds.width(), y1 - y0);
shape_rects->emplace_back(x0, y1, x1 - x0, y2 - y1);
shape_rects->emplace_back(x2, y1, x3 - x2, y2 - y1);
shape_rects->emplace_back(x0, y2, bounds.width(), y3 - y2);
return shape_rects;
}
DISALLOW_COPY_AND_ASSIGN(TestHoleWindowTargeter);
};
} // namespace
// Creates a root window, child windows and a viz::HitTestDataProvider.
// root
// +- window2
// |_ window3
// |_ window4
class HitTestDataProviderAuraTest : public test::AuraTestBaseMus {
public:
HitTestDataProviderAuraTest() {}
~HitTestDataProviderAuraTest() override {}
void SetUp() override {
test::AuraTestBaseMus::SetUp();
root_ = std::make_unique<Window>(nullptr);
root_->Init(ui::LAYER_NOT_DRAWN);
root_->SetEventTargeter(std::make_unique<WindowTargeter>());
root_->SetBounds(gfx::Rect(0, 0, 300, 200));
root_->Show();
window2_ = new Window(nullptr);
window2_->Init(ui::LAYER_TEXTURED);
window2_->SetBounds(gfx::Rect(20, 30, 40, 60));
window2_->Show();
window3_ = new Window(nullptr);
window3_->Init(ui::LAYER_TEXTURED);
window3_->SetEventTargeter(std::make_unique<WindowTargeter>());
window3_->SetBounds(gfx::Rect(50, 60, 100, 40));
window3_->Show();
window4_ = new Window(nullptr);
window4_->Init(ui::LAYER_TEXTURED);
window4_->SetBounds(gfx::Rect(20, 10, 60, 30));
window4_->Show();
window3_->AddChild(window4_);
root_->AddChild(window2_);
root_->AddChild(window3_);
compositor_frame_ = viz::CompositorFrame();
hit_test_data_provider_ = std::make_unique<HitTestDataProviderAura>(root());
}
protected:
const viz::HitTestDataProvider* hit_test_data_provider() const {
return hit_test_data_provider_.get();
}
Window* root() { return root_.get(); }
Window* window2() { return window2_; }
Window* window3() { return window3_; }
Window* window4() { return window4_; }
viz::CompositorFrame compositor_frame_;
private:
std::unique_ptr<Window> root_;
Window* window2_;
Window* window3_;
Window* window4_;
std::unique_ptr<viz::HitTestDataProvider> hit_test_data_provider_;
DISALLOW_COPY_AND_ASSIGN(HitTestDataProviderAuraTest);
};
// TODO(riajiang): Add test cases for kHitTestChildSurface to ensure
// that local_surface_id is set and used correctly.
// Tests that the order of reported hit-test regions matches windows Z-order.
TEST_F(HitTestDataProviderAuraTest, Stacking) {
const base::Optional<viz::HitTestRegionList> hit_test_data_1 =
hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data_1);
EXPECT_EQ(hit_test_data_1->flags, viz::HitTestRegionFlags::kHitTestMine);
EXPECT_EQ(hit_test_data_1->bounds, root()->bounds());
Window* expected_order_1[] = {window3(), window4(), window2()};
EXPECT_EQ(hit_test_data_1->regions.size(), arraysize(expected_order_1));
int i = 0;
for (const auto& region : hit_test_data_1->regions) {
EXPECT_EQ(region.flags, viz::HitTestRegionFlags::kHitTestMine |
viz::HitTestRegionFlags::kHitTestMouse |
viz::HitTestRegionFlags::kHitTestTouch);
EXPECT_EQ(region.frame_sink_id, expected_order_1[i]->GetFrameSinkId());
EXPECT_EQ(region.rect.ToString(), expected_order_1[i]->bounds().ToString());
i++;
}
root()->StackChildAbove(window2(), window3());
const base::Optional<viz::HitTestRegionList> hit_test_data_2 =
hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data_2);
EXPECT_EQ(hit_test_data_2->flags, viz::HitTestRegionFlags::kHitTestMine);
EXPECT_EQ(hit_test_data_2->bounds, root()->bounds());
Window* expected_order_2[] = {window2(), window3(), window4()};
EXPECT_EQ(hit_test_data_2->regions.size(), arraysize(expected_order_2));
i = 0;
for (const auto& region : hit_test_data_2->regions) {
EXPECT_EQ(region.flags, viz::HitTestRegionFlags::kHitTestMine |
viz::HitTestRegionFlags::kHitTestMouse |
viz::HitTestRegionFlags::kHitTestTouch);
EXPECT_EQ(region.frame_sink_id, expected_order_2[i]->GetFrameSinkId());
EXPECT_EQ(region.rect.ToString(), expected_order_2[i]->bounds().ToString());
i++;
}
}
// Tests that the hit-test regions get expanded with a custom event targeter.
TEST_F(HitTestDataProviderAuraTest, CustomTargeter) {
constexpr int kMouseInset = -5;
constexpr int kTouchInset = -10;
auto targeter = std::make_unique<WindowTargeter>();
targeter->SetInsets(gfx::Insets(kMouseInset), gfx::Insets(kTouchInset));
window3()->SetEventTargeter(std::move(targeter));
targeter = std::make_unique<WindowTargeter>();
targeter->SetInsets(gfx::Insets(kMouseInset), gfx::Insets(kTouchInset));
window4()->SetEventTargeter(std::move(targeter));
window2()->SetEmbedFrameSinkId(viz::FrameSinkId(1, 2));
const base::Optional<viz::HitTestRegionList> hit_test_data =
hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->flags, viz::HitTestRegionFlags::kHitTestMine);
EXPECT_EQ(hit_test_data->bounds, root()->bounds());
// Children of a window that has the custom targeter installed as well as that
// window will get reported twice, once with hit-test bounds optimized for
// mouse events and another time with bounds expanded more for touch input.
struct {
Window* window;
uint32_t flags;
int insets;
} expected[] = {{window3(),
viz::HitTestRegionFlags::kHitTestMine |
viz::HitTestRegionFlags::kHitTestMouse,
kMouseInset},
{window3(),
viz::HitTestRegionFlags::kHitTestMine |
viz::HitTestRegionFlags::kHitTestTouch,
kTouchInset},
{window4(),
viz::HitTestRegionFlags::kHitTestMine |
viz::HitTestRegionFlags::kHitTestMouse,
kMouseInset},
{window4(),
viz::HitTestRegionFlags::kHitTestMine |
viz::HitTestRegionFlags::kHitTestTouch,
kTouchInset},
{window2(),
viz::HitTestRegionFlags::kHitTestChildSurface |
viz::HitTestRegionFlags::kHitTestMouse |
viz::HitTestRegionFlags::kHitTestTouch,
0}};
ASSERT_EQ(hit_test_data->regions.size(), arraysize(expected));
ASSERT_EQ(hit_test_data->regions.size(), arraysize(expected));
ASSERT_EQ(hit_test_data->regions.size(), arraysize(expected));
int i = 0;
for (const auto& region : hit_test_data->regions) {
EXPECT_EQ(region.frame_sink_id, expected[i].window->GetFrameSinkId());
EXPECT_EQ(region.flags, expected[i].flags);
gfx::Rect expected_bounds = expected[i].window->bounds();
expected_bounds.Inset(gfx::Insets(expected[i].insets));
EXPECT_EQ(region.rect.ToString(), expected_bounds.ToString());
i++;
}
}
// Tests that the complex hit-test shape can be set with a custom targeter.
TEST_F(HitTestDataProviderAuraTest, HoleTargeter) {
window3()->SetEventTargeter(std::make_unique<TestHoleWindowTargeter>());
const base::Optional<viz::HitTestRegionList> hit_test_data =
hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->flags, viz::HitTestRegionFlags::kHitTestMine);
EXPECT_EQ(hit_test_data->bounds, root()->bounds());
// Children of a container that has the custom targeter installed as well as
// that container will get reported 4 times for each of the hit test regions
// defined by the custom targeter.
// original window3 is at gfx::Rect(50, 60, 100, 40).
// original window4 is at gfx::Rect(20, 10, 60, 30).
struct {
Window* window;
gfx::Rect bounds;
} expected[] = {
{window3(), {50, 60, 100, 13}}, {window3(), {50, 73, 33, 14}},
{window3(), {117, 73, 33, 14}}, {window3(), {50, 87, 100, 13}},
{window4(), {20, 10, 60, 10}}, {window4(), {20, 20, 20, 10}},
{window4(), {60, 20, 20, 10}}, {window4(), {20, 30, 60, 10}},
{window2(), window2()->bounds()}};
constexpr uint32_t expected_flags = viz::HitTestRegionFlags::kHitTestMine |
viz::HitTestRegionFlags::kHitTestMouse |
viz::HitTestRegionFlags::kHitTestTouch;
ASSERT_EQ(hit_test_data->regions.size(), arraysize(expected));
int i = 0;
for (const auto& region : hit_test_data->regions) {
EXPECT_EQ(region.frame_sink_id, expected[i].window->GetFrameSinkId());
EXPECT_EQ(region.flags, expected_flags);
EXPECT_EQ(region.rect.ToString(), expected[i].bounds.ToString());
i++;
}
}
TEST_F(HitTestDataProviderAuraTest, TargetingPolicies) {
root()->SetEventTargetingPolicy(ws::mojom::EventTargetingPolicy::NONE);
base::Optional<viz::HitTestRegionList> hit_test_data =
hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_FALSE(hit_test_data);
root()->SetEventTargetingPolicy(ws::mojom::EventTargetingPolicy::TARGET_ONLY);
window3()->SetEventTargetingPolicy(
ws::mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS);
hit_test_data = hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->flags, viz::HitTestRegionFlags::kHitTestMine);
EXPECT_EQ(hit_test_data->regions.size(), 3u);
root()->SetEventTargetingPolicy(ws::mojom::EventTargetingPolicy::TARGET_ONLY);
window3()->SetEventTargetingPolicy(
ws::mojom::EventTargetingPolicy::TARGET_ONLY);
hit_test_data = hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->flags, viz::HitTestRegionFlags::kHitTestMine);
EXPECT_EQ(hit_test_data->regions.size(), 2u);
root()->SetEventTargetingPolicy(
ws::mojom::EventTargetingPolicy::DESCENDANTS_ONLY);
window3()->SetEventTargetingPolicy(
ws::mojom::EventTargetingPolicy::DESCENDANTS_ONLY);
hit_test_data = hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->flags, viz::HitTestRegionFlags::kHitTestIgnore);
EXPECT_EQ(hit_test_data->regions.size(), 2u);
root()->SetEventTargetingPolicy(
ws::mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS);
window3()->SetEventTargetingPolicy(
ws::mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS);
hit_test_data = hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->flags, viz::HitTestRegionFlags::kHitTestMine);
EXPECT_EQ(hit_test_data->regions.size(), 3u);
}
// Tests that we do not submit hit-test data for invisible windows and for
// children of a child surface.
TEST_F(HitTestDataProviderAuraTest, DoNotSubmit) {
base::Optional<viz::HitTestRegionList> hit_test_data =
hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->regions.size(), 3u);
window2()->Hide();
hit_test_data = hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->regions.size(), 2u);
window3()->SetEmbedFrameSinkId(viz::FrameSinkId(1, 3));
hit_test_data = hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->regions.size(), 1u);
root()->Hide();
hit_test_data = hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_FALSE(hit_test_data);
root()->Show();
hit_test_data = hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->regions.size(), 1u);
root()->SetEmbedFrameSinkId(viz::FrameSinkId(1, 1));
hit_test_data = hit_test_data_provider()->GetHitTestData(compositor_frame_);
ASSERT_TRUE(hit_test_data);
EXPECT_EQ(hit_test_data->regions.size(), 0u);
}
} // namespace aura
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "services/ws/public/mojom/window_tree_constants.mojom.h" #include "services/ws/public/mojom/window_tree_constants.mojom.h"
#include "ui/aura/client/cursor_client.h" #include "ui/aura/client/cursor_client.h"
#include "ui/aura/env.h" #include "ui/aura/env.h"
#include "ui/aura/hit_test_data_provider_aura.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/aura/window_delegate.h" #include "ui/aura/window_delegate.h"
#include "ui/aura/window_occlusion_tracker.h" #include "ui/aura/window_occlusion_tracker.h"
...@@ -169,19 +168,14 @@ WindowPortLocal::CreateLayerTreeFrameSink() { ...@@ -169,19 +168,14 @@ WindowPortLocal::CreateLayerTreeFrameSink() {
params.pipes.client_request = std::move(client_request); params.pipes.client_request = std::move(client_request);
params.enable_surface_synchronization = true; params.enable_surface_synchronization = true;
params.client_name = kExo; params.client_name = kExo;
if (features::IsVizHitTestingDrawQuadEnabled()) { bool root_accepts_events =
bool root_accepts_events = (window_->event_targeting_policy() ==
(window_->event_targeting_policy() == ws::mojom::EventTargetingPolicy::TARGET_ONLY) ||
ws::mojom::EventTargetingPolicy::TARGET_ONLY) || (window_->event_targeting_policy() ==
(window_->event_targeting_policy() == ws::mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS);
ws::mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS); params.hit_test_data_provider =
params.hit_test_data_provider = std::make_unique<viz::HitTestDataProviderDrawQuad>(
std::make_unique<viz::HitTestDataProviderDrawQuad>( true /* should_ask_for_child_region */, root_accepts_events);
true /* should_ask_for_child_region */, root_accepts_events);
} else {
params.hit_test_data_provider =
std::make_unique<HitTestDataProviderAura>(window_);
}
auto frame_sink = auto frame_sink =
std::make_unique<cc::mojo_embedder::AsyncLayerTreeFrameSink>( std::make_unique<cc::mojo_embedder::AsyncLayerTreeFrameSink>(
nullptr /* context_provider */, nullptr /* worker_context_provider */, nullptr /* context_provider */, nullptr /* worker_context_provider */,
......
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