| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/surfaces/surface_hittest.h" | 5 #include "cc/surfaces/surface_hittest.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/output/delegated_frame_data.h" | 8 #include "cc/output/delegated_frame_data.h" |
| 9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" |
| 10 #include "cc/quads/render_pass_draw_quad.h" | 10 #include "cc/quads/render_pass_draw_quad.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 const SurfaceDrawQuad* surface_quad = SurfaceDrawQuad::MaterialCast(quad); | 97 const SurfaceDrawQuad* surface_quad = SurfaceDrawQuad::MaterialCast(quad); |
| 98 | 98 |
| 99 if (delegate_ && | 99 if (delegate_ && |
| 100 delegate_->RejectHitTarget(surface_quad, point_in_quad_space)) { | 100 delegate_->RejectHitTarget(surface_quad, point_in_quad_space)) { |
| 101 continue; | 101 continue; |
| 102 } | 102 } |
| 103 | 103 |
| 104 gfx::Transform transform_to_child_space; | 104 gfx::Transform transform_to_child_space; |
| 105 if (GetTargetSurfaceAtPointInternal( | 105 if (GetTargetSurfaceAtPointInternal( |
| 106 surface_quad->surface_id, RenderPassId(), point_in_quad_space, | 106 surface_quad->surface_id, RenderPassId(), point_in_quad_space, |
| 107 referenced_passes, out_surface_id, &transform_to_child_space)) { | 107 referenced_passes, out_surface_id, &transform_to_child_space) || |
| 108 (delegate_ && |
| 109 delegate_->AcceptHitTarget(surface_quad, point_in_quad_space))) { |
| 110 *out_surface_id = surface_quad->surface_id; |
| 108 *out_transform = transform_to_child_space * target_to_quad_transform * | 111 *out_transform = transform_to_child_space * target_to_quad_transform * |
| 109 transform_from_root_target; | 112 transform_from_root_target; |
| 110 return true; | 113 return true; |
| 111 } | 114 } |
| 112 | 115 |
| 113 continue; | 116 continue; |
| 114 } | 117 } |
| 115 | 118 |
| 116 if (quad->material == DrawQuad::RENDER_PASS) { | 119 if (quad->material == DrawQuad::RENDER_PASS) { |
| 117 // We've hit a RenderPassDrawQuad, we need to recurse into this | 120 // We've hit a RenderPassDrawQuad, we need to recurse into this |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 return false; | 269 return false; |
| 267 } | 270 } |
| 268 | 271 |
| 269 *point_in_quad_space = point_in_render_pass_space; | 272 *point_in_quad_space = point_in_render_pass_space; |
| 270 target_to_quad_transform->TransformPoint(point_in_quad_space); | 273 target_to_quad_transform->TransformPoint(point_in_quad_space); |
| 271 | 274 |
| 272 return quad->rect.Contains(*point_in_quad_space); | 275 return quad->rect.Contains(*point_in_quad_space); |
| 273 } | 276 } |
| 274 | 277 |
| 275 } // namespace cc | 278 } // namespace cc |
| OLD | NEW |