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

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

Issue 1743303002: Make browser hit testing return correct SurfaceId with nested Surfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Attempt to fix broken unit test Created 4 years, 9 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
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_ && 108 *out_transform = transform_to_child_space * target_to_quad_transform *
109 delegate_->AcceptHitTarget(surface_quad, point_in_quad_space))) { 109 transform_from_root_target;
110 return true;
111 } else if (delegate_ &&
112 delegate_->AcceptHitTarget(surface_quad,
113 point_in_quad_space)) {
110 *out_surface_id = surface_quad->surface_id; 114 *out_surface_id = surface_quad->surface_id;
111 *out_transform = transform_to_child_space * target_to_quad_transform * 115 *out_transform = transform_to_child_space * target_to_quad_transform *
112 transform_from_root_target; 116 transform_from_root_target;
113 return true; 117 return true;
114 } 118 }
115 119
116 continue; 120 continue;
117 } 121 }
118 122
119 if (quad->material == DrawQuad::RENDER_PASS) { 123 if (quad->material == DrawQuad::RENDER_PASS) {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 return false; 273 return false;
270 } 274 }
271 275
272 *point_in_quad_space = point_in_render_pass_space; 276 *point_in_quad_space = point_in_render_pass_space;
273 target_to_quad_transform->TransformPoint(point_in_quad_space); 277 target_to_quad_transform->TransformPoint(point_in_quad_space);
274 278
275 return quad->rect.Contains(*point_in_quad_space); 279 return quad->rect.Contains(*point_in_quad_space);
276 } 280 }
277 281
278 } // namespace cc 282 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | content/browser/site_per_process_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698