Chromium Code Reviews| Index: components/viz/common/display_hit_test_region.h |
| diff --git a/components/viz/common/display_hit_test_region.h b/components/viz/common/display_hit_test_region.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0edf7d01161708f469ede64b326384af390071f8 |
| --- /dev/null |
| +++ b/components/viz/common/display_hit_test_region.h |
| @@ -0,0 +1,50 @@ |
| +// 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 COMPONENTS_VIZ_COMMON_DISPLAY_HIT_TEST_REGION_H_ |
| +#define COMPONENTS_VIZ_COMMON_DISPLAY_HIT_TEST_REGION_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include "cc/surfaces/surface_id.h" |
| +#include "ui/gfx/geometry/rect.h" |
| +#include "ui/gfx/transform.h" |
| + |
| +namespace viz { |
| + |
| +// An array of DisplayHitTestRegion elements is used to define the |
|
danakj
2017/06/30 20:39:38
put this comment directly above the struct definit
gklassen
2017/07/12 14:43:51
Done.
|
| +// aggregated hit-test data for the Display. |
| +// |
| +// It is designed to be in shared memory so that the viz process can |
|
danakj
2017/06/30 20:39:38
viz service can write
gklassen
2017/07/12 14:43:51
Done.
|
| +// write the hit_test data, and the browser / ws process can read without |
|
danakj
2017/06/30 20:39:38
the viz host can read
gklassen
2017/07/12 14:43:51
Done.
|
| +// process hops. |
| + |
| +// A DisplayHitTestRegion element with child_count of kEndOfList indicates |
| +// the last element and end of the list. |
| +constexpr int kEndOfList = -1; |
| + |
| +struct DisplayHitTestRegion { |
|
danakj
2017/06/30 20:39:38
I suggest AggregatedHitTestRegion, because HitTest
gklassen
2017/07/12 14:43:51
Done.
|
| + // The cc::FrameSinkId corresponding to this region. Events that match |
| + // are routed to this surface. |
| + cc::FrameSinkId frame_sink_id; |
| + |
| + // Flags to indicate the type of region as defined in |
| + // services/viz/public/interfaces/hit_test_region_list.mojom.h. |
| + uint32_t flags; |
| + |
| + // The rectangle that defines the region in parent region's coordinate space. |
| + gfx::Rect rect; |
| + |
| + // The transform applied to the rect in parent region's coordinate space. |
| + gfx::Transform transform; |
| + |
| + // The number of children including their children below this entry. |
| + // If this element is not matched then child_count elements can be skipped |
| + // to move to the next entry. |
| + int child_count; |
| +}; |
| + |
| +} // namespace viz |
| + |
| +#endif // COMPONENTS_VIZ_COMMON_DISPLAY_HIT_TEST_REGION_H_ |