summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2015-09-22 14:16:30 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-22 21:36:49 +0000
commit0a5ec125b8be475c39b6e41cc3c15c33fc7a9de5 (patch)
tree2c0950abd2632680e8c04dcf713c9da6128abb10
parent0f5131e4f6ae03647aae0cac8154bf888b844e95 (diff)
downloadchromium_src-0a5ec125b8be475c39b6e41cc3c15c33fc7a9de5.zip
chromium_src-0a5ec125b8be475c39b6e41cc3c15c33fc7a9de5.tar.gz
chromium_src-0a5ec125b8be475c39b6e41cc3c15c33fc7a9de5.tar.bz2
Refactor Surfacehittest to return gfx::Transform
I'm working on adding input capture to OOPIFs in Mandoline. When a view has capture, all input events with locations go to that view, bypassing most of hit testing. Input events need to be transformed before sending to the View, so this CL changes surface hittesting to give us a gfx::Transform that we can cache for later use. This CL also tweaks the way some of the tests are written to allow easily writing more points to test and reducing code duplication. BUG=496953 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1346323005 Cr-Commit-Position: refs/heads/master@{#350231}
-rw-r--r--cc/surfaces/surface_hittest.cc46
-rw-r--r--cc/surfaces/surface_hittest.h5
-rw-r--r--cc/surfaces/surface_hittest_unittest.cc283
-rw-r--r--components/mus/display_manager.cc9
-rw-r--r--content/browser/compositor/delegated_frame_host.cc7
5 files changed, 246 insertions, 104 deletions
diff --git a/cc/surfaces/surface_hittest.cc b/cc/surfaces/surface_hittest.cc
index 89f4d3b..3a3864e 100644
--- a/cc/surfaces/surface_hittest.cc
+++ b/cc/surfaces/surface_hittest.cc
@@ -22,19 +22,18 @@ SurfaceHittest::SurfaceHittest(SurfaceManager* manager) : manager_(manager) {}
SurfaceHittest::~SurfaceHittest() {}
-SurfaceId SurfaceHittest::GetTargetSurfaceAtPoint(
- SurfaceId surface_id,
- const gfx::Point& point,
- gfx::Point* transformed_point) {
+SurfaceId SurfaceHittest::GetTargetSurfaceAtPoint(SurfaceId surface_id,
+ const gfx::Point& point,
+ gfx::Transform* transform) {
SurfaceId hittest_surface_id = surface_id;
-
- if (transformed_point)
- *transformed_point = point;
+ // Reset the output transform to identity.
+ if (transform)
+ *transform = gfx::Transform();
std::set<const RenderPass*> referenced_passes;
GetTargetSurfaceAtPointInternal(surface_id, RenderPassId(), point,
&referenced_passes, &hittest_surface_id,
- transformed_point);
+ transform);
return hittest_surface_id;
}
@@ -45,7 +44,7 @@ bool SurfaceHittest::GetTargetSurfaceAtPointInternal(
const gfx::Point& point_in_root_target,
std::set<const RenderPass*>* referenced_passes,
SurfaceId* out_surface_id,
- gfx::Point* out_transformed_point) {
+ gfx::Transform* out_transform) {
const RenderPass* render_pass =
GetRenderPassForSurfaceById(surface_id, render_pass_id);
if (!render_pass)
@@ -70,20 +69,24 @@ bool SurfaceHittest::GetTargetSurfaceAtPointInternal(
transform_from_root_target.TransformPoint(&point_in_render_pass_space);
for (const DrawQuad* quad : render_pass->quad_list) {
+ gfx::Transform target_to_quad_transform;
gfx::Point point_in_quad_space;
- if (!PointInQuad(quad, point_in_render_pass_space, &point_in_quad_space))
+ if (!PointInQuad(quad, point_in_render_pass_space,
+ &target_to_quad_transform, &point_in_quad_space)) {
continue;
+ }
if (quad->material == DrawQuad::SURFACE_CONTENT) {
// We've hit a SurfaceDrawQuad, we need to recurse into this
// Surface.
const SurfaceDrawQuad* surface_quad = SurfaceDrawQuad::MaterialCast(quad);
- gfx::Point point_in_child_space(point_in_quad_space);
+ gfx::Transform transform_to_child_space;
if (GetTargetSurfaceAtPointInternal(
surface_quad->surface_id, RenderPassId(), point_in_quad_space,
- referenced_passes, out_surface_id, &point_in_child_space)) {
- *out_transformed_point = point_in_child_space;
+ referenced_passes, out_surface_id, &transform_to_child_space)) {
+ *out_transform = transform_to_child_space * target_to_quad_transform *
+ transform_from_root_target;
return true;
}
@@ -96,20 +99,19 @@ bool SurfaceHittest::GetTargetSurfaceAtPointInternal(
const RenderPassDrawQuad* render_quad =
RenderPassDrawQuad::MaterialCast(quad);
- gfx::Point point_in_child_space(point_in_root_target);
+ gfx::Transform transform_to_child_space;
if (GetTargetSurfaceAtPointInternal(
surface_id, render_quad->render_pass_id, point_in_root_target,
- referenced_passes, out_surface_id, &point_in_child_space)) {
- *out_transformed_point = point_in_child_space;
+ referenced_passes, out_surface_id, &transform_to_child_space)) {
+ *out_transform = transform_to_child_space;
return true;
}
continue;
}
- // We've hit a different type of quad in the current Surface,
- // there's no need to iterate anymore, this is the quad that
- // receives the event;
+ // We've hit a different type of quad in the current Surface. There's no
+ // need to iterate anymore, this is the quad that receives the event.
*out_surface_id = surface_id;
return true;
}
@@ -147,6 +149,7 @@ const RenderPass* SurfaceHittest::GetRenderPassForSurfaceById(
bool SurfaceHittest::PointInQuad(const DrawQuad* quad,
const gfx::Point& point_in_render_pass_space,
+ gfx::Transform* target_to_quad_transform,
gfx::Point* point_in_quad_space) {
// First we test against the clip_rect. The clip_rect is in target space, so
// we can test the point directly.
@@ -158,14 +161,13 @@ bool SurfaceHittest::PointInQuad(const DrawQuad* quad,
// We now transform the point to content space and test if it hits the
// rect.
- gfx::Transform target_to_quad_transform;
if (!quad->shared_quad_state->quad_to_target_transform.GetInverse(
- &target_to_quad_transform)) {
+ target_to_quad_transform)) {
return false;
}
*point_in_quad_space = point_in_render_pass_space;
- target_to_quad_transform.TransformPoint(point_in_quad_space);
+ target_to_quad_transform->TransformPoint(point_in_quad_space);
return quad->rect.Contains(*point_in_quad_space);
}
diff --git a/cc/surfaces/surface_hittest.h b/cc/surfaces/surface_hittest.h
index 094d401..b5e1a67 100644
--- a/cc/surfaces/surface_hittest.h
+++ b/cc/surfaces/surface_hittest.h
@@ -33,7 +33,7 @@ class CC_SURFACES_EXPORT SurfaceHittest {
// surface space.
SurfaceId GetTargetSurfaceAtPoint(SurfaceId surface_id,
const gfx::Point& point,
- gfx::Point* transformed_point);
+ gfx::Transform* transform);
private:
bool GetTargetSurfaceAtPointInternal(
@@ -42,7 +42,7 @@ class CC_SURFACES_EXPORT SurfaceHittest {
const gfx::Point& point_in_root_target,
std::set<const RenderPass*>* referenced_passes,
SurfaceId* out_surface_id,
- gfx::Point* out_transformed_point);
+ gfx::Transform* out_transform);
const RenderPass* GetRenderPassForSurfaceById(
SurfaceId surface_id,
@@ -50,6 +50,7 @@ class CC_SURFACES_EXPORT SurfaceHittest {
bool PointInQuad(const DrawQuad* quad,
const gfx::Point& point_in_render_pass_space,
+ gfx::Transform* target_to_quad_transform,
gfx::Point* point_in_quad_space);
SurfaceManager* const manager_;
diff --git a/cc/surfaces/surface_hittest_unittest.cc b/cc/surfaces/surface_hittest_unittest.cc
index 5d9b1b2..a7f373f 100644
--- a/cc/surfaces/surface_hittest_unittest.cc
+++ b/cc/surfaces/surface_hittest_unittest.cc
@@ -69,6 +69,7 @@ void CreateRenderPassDrawQuad(RenderPass* pass,
gfx::Vector2dF(),
FilterOperations());
}
+
void CreateSurfaceDrawQuad(RenderPass* pass,
const gfx::Transform& transform,
const gfx::Rect& root_rect,
@@ -82,18 +83,34 @@ void CreateSurfaceDrawQuad(RenderPass* pass,
surface_id);
}
-scoped_ptr<CompositorFrame> CreateCompositorFrame(
- const gfx::Rect& root_rect,
- RenderPass** render_pass) {
- RenderPassId root_id(1, 1);
- scoped_ptr<RenderPass> root_pass = RenderPass::Create();
- root_pass->SetNew(root_id, root_rect, root_rect, gfx::Transform());
+void CreateRenderPass(const RenderPassId& render_pass_id,
+ const gfx::Rect& rect,
+ const gfx::Transform& transform_to_root_target,
+ RenderPassList* render_pass_list) {
+ scoped_ptr<RenderPass> render_pass = RenderPass::Create();
+ render_pass->SetNew(render_pass_id, rect, rect, transform_to_root_target);
+ render_pass_list->push_back(render_pass.Pass());
+}
+scoped_ptr<CompositorFrame> CreateCompositorFrameWithRenderPassList(
+ RenderPassList* render_pass_list) {
scoped_ptr<DelegatedFrameData> root_delegated_frame_data(
new DelegatedFrameData);
- root_delegated_frame_data->render_pass_list.push_back(root_pass.Pass());
+ root_delegated_frame_data->render_pass_list.swap(*render_pass_list);
scoped_ptr<CompositorFrame> root_frame(new CompositorFrame);
root_frame->delegated_frame_data = root_delegated_frame_data.Pass();
+ return root_frame.Pass();
+}
+
+scoped_ptr<CompositorFrame> CreateCompositorFrame(
+ const gfx::Rect& root_rect,
+ RenderPass** render_pass) {
+ RenderPassList render_pass_list;
+ RenderPassId root_id(1, 1);
+ CreateRenderPass(root_id, root_rect, gfx::Transform(), &render_pass_list);
+
+ scoped_ptr<CompositorFrame> root_frame =
+ CreateCompositorFrameWithRenderPassList(&render_pass_list);
*render_pass = root_frame->delegated_frame_data->render_pass_list.back();
return root_frame.Pass();
@@ -135,10 +152,10 @@ TEST(SurfaceHittestTest, Hittest_BadCompositorFrameDoesNotCrash) {
{
SurfaceHittest hittest(&manager);
// It is expected this test will complete without crashes.
- gfx::Point transformed_point;
+ gfx::Transform transform;
EXPECT_EQ(root_surface_id,
hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(100, 100), &transformed_point));
+ root_surface_id, gfx::Point(100, 100), &transform));
}
factory.Destroy(root_surface_id);
@@ -164,11 +181,12 @@ TEST(SurfaceHittestTest, Hittest_SingleSurface) {
{
SurfaceHittest hittest(&manager);
- gfx::Point transformed_point;
- EXPECT_EQ(root_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(100, 100), &transformed_point));
- EXPECT_EQ(gfx::Point(100, 100), transformed_point);
+ gfx::Point point(100, 100);
+ gfx::Transform transform;
+ EXPECT_EQ(root_surface_id, hittest.GetTargetSurfaceAtPoint(
+ root_surface_id, point, &transform));
+ transform.TransformPoint(&point);
+ EXPECT_EQ(gfx::Point(100, 100), point);
}
factory.Destroy(root_surface_id);
@@ -212,46 +230,44 @@ TEST(SurfaceHittestTest, Hittest_ChildSurface) {
// Add a solid quad in the child surface.
gfx::Rect child_solid_quad_rect(100, 100);
- CreateSolidColorDrawQuad(child_pass,
- gfx::Transform(1.0f, 0.0f, 0.0f, 50.0f,
- 0.0f, 1.0f, 0.0f, 50.0f,
- 0.0f, 0.0f, 1.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f),
- root_rect,
- child_solid_quad_rect);
+ CreateSolidColorDrawQuad(
+ child_pass,
+ gfx::Transform(1.0f, 0.0f, 0.0f, 50.0f, 0.0f, 1.0f, 0.0f, 50.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f),
+ root_rect, child_solid_quad_rect);
// Submit the frame.
factory.Create(child_surface_id);
factory.SubmitCompositorFrame(child_surface_id, child_frame.Pass(),
SurfaceFactory::DrawCallback());
- {
- SurfaceHittest hittest(&manager);
- gfx::Point transformed_point;
- EXPECT_EQ(root_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(10, 10), &transformed_point));
- EXPECT_EQ(gfx::Point(10, 10), transformed_point);
- EXPECT_EQ(root_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(99, 99), &transformed_point));
- EXPECT_EQ(gfx::Point(99, 99), transformed_point);
- EXPECT_EQ(child_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(100, 100), &transformed_point));
- EXPECT_EQ(gfx::Point(50, 50), transformed_point);
- EXPECT_EQ(child_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(199, 199), &transformed_point));
- EXPECT_EQ(gfx::Point(149, 149), transformed_point);
- EXPECT_EQ(root_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(200, 200), &transformed_point));
- EXPECT_EQ(gfx::Point(200, 200), transformed_point);
- EXPECT_EQ(root_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(290, 290), &transformed_point));
- EXPECT_EQ(gfx::Point(290, 290), transformed_point);
+ struct Test {
+ SurfaceId input_surface_id;
+ gfx::Point input_point;
+ SurfaceId expected_output_surface_id;
+ gfx::Point expected_output_point;
+ } tests[] = {{root_surface_id, gfx::Point(10, 10), root_surface_id,
+ gfx::Point(10, 10)},
+ {root_surface_id, gfx::Point(99, 99), root_surface_id,
+ gfx::Point(99, 99)},
+ {root_surface_id, gfx::Point(100, 100), child_surface_id,
+ gfx::Point(50, 50)},
+ {root_surface_id, gfx::Point(199, 199), child_surface_id,
+ gfx::Point(149, 149)},
+ {root_surface_id, gfx::Point(200, 200), root_surface_id,
+ gfx::Point(200, 200)},
+ {root_surface_id, gfx::Point(290, 290), root_surface_id,
+ gfx::Point(290, 290)}};
+
+ SurfaceHittest hittest(&manager);
+ for (const auto& test : tests) {
+ gfx::Point point(test.input_point);
+ gfx::Transform transform;
+ EXPECT_EQ(test.expected_output_surface_id,
+ hittest.GetTargetSurfaceAtPoint(test.input_surface_id, point,
+ &transform));
+ transform.TransformPoint(&point);
+ EXPECT_EQ(test.expected_output_point, point);
}
factory.Destroy(root_surface_id);
@@ -318,37 +334,154 @@ TEST(SurfaceHittestTest, Hittest_InvalidRenderPassDrawQuad) {
factory.SubmitCompositorFrame(child_surface_id, child_frame.Pass(),
SurfaceFactory::DrawCallback());
- {
- SurfaceHittest hittest(&manager);
- gfx::Point transformed_point;
- EXPECT_EQ(root_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(10, 10), &transformed_point));
- EXPECT_EQ(gfx::Point(10, 10), transformed_point);
- EXPECT_EQ(root_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(99, 99), &transformed_point));
- EXPECT_EQ(gfx::Point(99, 99), transformed_point);
- EXPECT_EQ(child_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(100, 100), &transformed_point));
- EXPECT_EQ(gfx::Point(50, 50), transformed_point);
- EXPECT_EQ(child_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(199, 199), &transformed_point));
- EXPECT_EQ(gfx::Point(149, 149), transformed_point);
- EXPECT_EQ(root_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(200, 200), &transformed_point));
- EXPECT_EQ(gfx::Point(200, 200), transformed_point);
- EXPECT_EQ(root_surface_id,
- hittest.GetTargetSurfaceAtPoint(
- root_surface_id, gfx::Point(290, 290), &transformed_point));
- EXPECT_EQ(gfx::Point(290, 290), transformed_point);
+ struct Test {
+ SurfaceId input_surface_id;
+ gfx::Point input_point;
+ SurfaceId expected_output_surface_id;
+ gfx::Point expected_output_point;
+ } tests[] = {{root_surface_id, gfx::Point(10, 10), root_surface_id,
+ gfx::Point(10, 10)},
+ {root_surface_id, gfx::Point(99, 99), root_surface_id,
+ gfx::Point(99, 99)},
+ {root_surface_id, gfx::Point(100, 100), child_surface_id,
+ gfx::Point(50, 50)},
+ {root_surface_id, gfx::Point(199, 199), child_surface_id,
+ gfx::Point(149, 149)},
+ {root_surface_id, gfx::Point(200, 200), root_surface_id,
+ gfx::Point(200, 200)},
+ {root_surface_id, gfx::Point(290, 290), root_surface_id,
+ gfx::Point(290, 290)}};
+
+ SurfaceHittest hittest(&manager);
+ for (const auto& test : tests) {
+ gfx::Point point(test.input_point);
+ gfx::Transform transform;
+ EXPECT_EQ(test.expected_output_surface_id,
+ hittest.GetTargetSurfaceAtPoint(test.input_surface_id, point,
+ &transform));
+ transform.TransformPoint(&point);
+ EXPECT_EQ(test.expected_output_point, point);
}
factory.Destroy(root_surface_id);
factory.Destroy(child_surface_id);
}
+TEST(SurfaceHittestTest, Hittest_RenderPassDrawQuad) {
+ SurfaceManager manager;
+ EmptySurfaceFactoryClient client;
+ SurfaceFactory factory(&manager, &client);
+
+ // Create a CompostiorFrame with two RenderPasses.
+ gfx::Rect root_rect(300, 300);
+ RenderPassList render_pass_list;
+
+ // Create a child RenderPass.
+ RenderPassId child_render_pass_id(1, 3);
+ gfx::Transform transform_to_root_target(1.0f, 0.0f, 0.0f, 50.0f,
+ 0.0f, 1.0f, 0.0f, 50.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f);
+ CreateRenderPass(child_render_pass_id,
+ gfx::Rect(100, 100),
+ transform_to_root_target,
+ &render_pass_list);
+
+ // Create the root RenderPass.
+ RenderPassId root_render_pass_id(1, 2);
+ CreateRenderPass(root_render_pass_id, root_rect, gfx::Transform(),
+ &render_pass_list);
+
+ RenderPass* root_pass = nullptr;
+ scoped_ptr<CompositorFrame> root_frame =
+ CreateCompositorFrameWithRenderPassList(&render_pass_list);
+ root_pass = root_frame->delegated_frame_data->render_pass_list.back();
+
+ // Create a RenderPassDrawQuad.
+ gfx::Rect render_pass_quad_rect(100, 100);
+ CreateRenderPassDrawQuad(root_pass,
+ transform_to_root_target,
+ root_rect,
+ render_pass_quad_rect,
+ child_render_pass_id);
+
+ // Add a solid quad in the child render pass.
+ RenderPass* child_render_pass =
+ root_frame->delegated_frame_data->render_pass_list.front();
+ gfx::Rect child_solid_quad_rect(100, 100);
+ CreateSolidColorDrawQuad(child_render_pass,
+ gfx::Transform(),
+ gfx::Rect(100, 100),
+ child_solid_quad_rect);
+
+ // Submit the root frame.
+ SurfaceIdAllocator root_allocator(1);
+ SurfaceId root_surface_id = root_allocator.GenerateId();
+ factory.Create(root_surface_id);
+ factory.SubmitCompositorFrame(root_surface_id, root_frame.Pass(),
+ SurfaceFactory::DrawCallback());
+
+ struct Test {
+ SurfaceId input_surface_id;
+ gfx::Point input_point;
+ SurfaceId expected_output_surface_id;
+ gfx::Point expected_output_point;
+ } tests[] = {
+ // These tests just miss the RenderPassDrawQuad.
+ {
+ root_surface_id,
+ gfx::Point(49, 49),
+ root_surface_id,
+ gfx::Point(49, 49)
+ },
+ {
+ root_surface_id,
+ gfx::Point(150, 150),
+ root_surface_id,
+ gfx::Point(150, 150)
+ },
+ // These tests just hit the boundaries of the
+ // RenderPassDrawQuad.
+ {
+ root_surface_id,
+ gfx::Point(50, 50),
+ root_surface_id,
+ gfx::Point(50, 50)
+ },
+ {
+ root_surface_id,
+ gfx::Point(149, 149),
+ root_surface_id,
+ gfx::Point(149, 149)
+ },
+ // These tests fall somewhere in the center of the
+ // RenderPassDrawQuad.
+ {
+ root_surface_id,
+ gfx::Point(99, 99),
+ root_surface_id,
+ gfx::Point(99, 99)
+ },
+ {
+ root_surface_id,
+ gfx::Point(100, 100),
+ root_surface_id,
+ gfx::Point(100, 100)
+ }
+ };
+
+ SurfaceHittest hittest(&manager);
+ for (const auto& test : tests) {
+ gfx::Point point(test.input_point);
+ gfx::Transform transform;
+ EXPECT_EQ(test.expected_output_surface_id,
+ hittest.GetTargetSurfaceAtPoint(test.input_surface_id, point,
+ &transform));
+ transform.TransformPoint(&point);
+ EXPECT_EQ(test.expected_output_point, point);
+ }
+
+ factory.Destroy(root_surface_id);
+}
+
} // namespace cc
diff --git a/components/mus/display_manager.cc b/components/mus/display_manager.cc
index ea7d434..52c5cd8 100644
--- a/components/mus/display_manager.cc
+++ b/components/mus/display_manager.cc
@@ -290,12 +290,13 @@ void DefaultDisplayManager::DispatchEvent(ui::Event* event) {
ViewId id;
if (event->IsLocatedEvent() && !!top_level_display_client_) {
ui::LocatedEvent* located_event = static_cast<ui::LocatedEvent*>(event);
- gfx::Point transformed_point;
+ gfx::Point transformed_point(located_event->location());
+ gfx::Transform transform_to_target_surface;
cc::SurfaceId target_surface =
surfaces_state_->hit_tester()->GetTargetSurfaceAtPoint(
- top_level_display_client_->surface_id(),
- located_event->location(),
- &transformed_point);
+ top_level_display_client_->surface_id(), located_event->location(),
+ &transform_to_target_surface);
+ transform_to_target_surface.TransformPoint(&transformed_point);
id = ViewIdFromTransportId(
cc::SurfaceIdAllocator::NamespaceForId(target_surface));
diff --git a/content/browser/compositor/delegated_frame_host.cc b/content/browser/compositor/delegated_frame_host.cc
index 315c0f0..c348cc5 100644
--- a/content/browser/compositor/delegated_frame_host.cc
+++ b/content/browser/compositor/delegated_frame_host.cc
@@ -207,7 +207,12 @@ cc::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint(
if (surface_id_.is_null())
return surface_id_;
cc::SurfaceHittest hittest(GetSurfaceManager());
- return hittest.GetTargetSurfaceAtPoint(surface_id_, point, transformed_point);
+ gfx::Transform target_transform;
+ cc::SurfaceId target_surface_id =
+ hittest.GetTargetSurfaceAtPoint(surface_id_, point, &target_transform);
+ if (!target_surface_id.is_null())
+ target_transform.TransformPoint(transformed_point);
+ return target_surface_id;
}
bool DelegatedFrameHost::ShouldSkipFrame(gfx::Size size_in_dip) const {