summaryrefslogtreecommitdiff
path: root/chromium/components/viz/common/hit_test/aggregated_hit_test_region.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/viz/common/hit_test/aggregated_hit_test_region.h')
-rw-r--r--chromium/components/viz/common/hit_test/aggregated_hit_test_region.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/chromium/components/viz/common/hit_test/aggregated_hit_test_region.h b/chromium/components/viz/common/hit_test/aggregated_hit_test_region.h
index 9fb48ff47b5..42476fe1fcd 100644
--- a/chromium/components/viz/common/hit_test/aggregated_hit_test_region.h
+++ b/chromium/components/viz/common/hit_test/aggregated_hit_test_region.h
@@ -7,12 +7,17 @@
#include <stdint.h>
-#include "components/viz/common/surfaces/surface_id.h"
+#include "components/viz/common/surfaces/frame_sink_id.h"
+#include "mojo/public/cpp/bindings/struct_traits.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/transform.h"
namespace viz {
+namespace mojom {
+class AggregatedHitTestRegionDataView;
+}
+
// A AggregatedHitTestRegion element with child_count of kEndOfList indicates
// the last element and end of the list.
constexpr int32_t kEndOfList = -1;
@@ -24,10 +29,12 @@ constexpr int32_t kEndOfList = -1;
// write the hit_test data, and the viz host can read without
// process hops.
struct AggregatedHitTestRegion {
- AggregatedHitTestRegion(FrameSinkId frame_sink_id,
+ AggregatedHitTestRegion() = default;
+
+ AggregatedHitTestRegion(const FrameSinkId& frame_sink_id,
uint32_t flags,
- gfx::Rect rect,
- gfx::Transform transform,
+ const gfx::Rect& rect,
+ const gfx::Transform& transform,
int32_t child_count)
: frame_sink_id(frame_sink_id),
flags(flags),
@@ -39,9 +46,8 @@ struct AggregatedHitTestRegion {
// are routed to this surface.
FrameSinkId frame_sink_id;
- // Flags to indicate the type of region as defined for
- // mojom::HitTestRegion
- uint32_t flags;
+ // HitTestRegionFlags to indicate the type of region.
+ uint32_t flags = 0;
// The rectangle that defines the region in parent region's coordinate space.
gfx::Rect rect;
@@ -49,7 +55,7 @@ struct AggregatedHitTestRegion {
// 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.
- int32_t child_count;
+ int32_t child_count = 0;
// gfx::Transform is backed by SkMatrix44. SkMatrix44 has a mutable attribute
// which can be changed even during a const function call (e.g.
@@ -68,6 +74,9 @@ struct AggregatedHitTestRegion {
}
private:
+ friend struct mojo::StructTraits<mojom::AggregatedHitTestRegionDataView,
+ AggregatedHitTestRegion>;
+
// The transform applied to the rect in parent region's coordinate space.
gfx::Transform transform_;
};