Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: cc/surfaces/surface_hittest.cc

Issue 1663433002: Adds an interface to SurfaceHittestDelegate in order to override (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/surfaces/surface_hittest_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/surface_hittest_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698