| 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/quads/draw_quad.h" | 8 #include "cc/quads/draw_quad.h" |
| 9 #include "cc/quads/render_pass_draw_quad.h" | 9 #include "cc/quads/render_pass_draw_quad.h" |
| 10 #include "cc/quads/surface_draw_quad.h" | 10 #include "cc/quads/surface_draw_quad.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // The target surface was not found. | 249 // The target surface was not found. |
| 250 return false; | 250 return false; |
| 251 } | 251 } |
| 252 | 252 |
| 253 const RenderPass* SurfaceHittest::GetRenderPassForSurfaceById( | 253 const RenderPass* SurfaceHittest::GetRenderPassForSurfaceById( |
| 254 const SurfaceId& surface_id, | 254 const SurfaceId& surface_id, |
| 255 int render_pass_id) { | 255 int render_pass_id) { |
| 256 Surface* surface = manager_->GetSurfaceForId(surface_id); | 256 Surface* surface = manager_->GetSurfaceForId(surface_id); |
| 257 if (!surface) | 257 if (!surface) |
| 258 return nullptr; | 258 return nullptr; |
| 259 if (!surface->HasFrame()) | 259 if (!surface->HasActiveFrame()) |
| 260 return nullptr; | 260 return nullptr; |
| 261 const CompositorFrame& surface_frame = surface->GetEligibleFrame(); | 261 const CompositorFrame& surface_frame = surface->GetActiveFrame(); |
| 262 | 262 |
| 263 if (surface_frame.render_pass_list.empty()) | 263 if (surface_frame.render_pass_list.empty()) |
| 264 return nullptr; | 264 return nullptr; |
| 265 | 265 |
| 266 if (!render_pass_id) | 266 if (!render_pass_id) |
| 267 return surface_frame.render_pass_list.back().get(); | 267 return surface_frame.render_pass_list.back().get(); |
| 268 | 268 |
| 269 for (const auto& render_pass : surface_frame.render_pass_list) { | 269 for (const auto& render_pass : surface_frame.render_pass_list) { |
| 270 if (render_pass->id == render_pass_id) | 270 if (render_pass->id == render_pass_id) |
| 271 return render_pass.get(); | 271 return render_pass.get(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 293 return false; | 293 return false; |
| 294 } | 294 } |
| 295 | 295 |
| 296 *point_in_quad_space = point_in_render_pass_space; | 296 *point_in_quad_space = point_in_render_pass_space; |
| 297 target_to_quad_transform->TransformPoint(point_in_quad_space); | 297 target_to_quad_transform->TransformPoint(point_in_quad_space); |
| 298 | 298 |
| 299 return quad->rect.Contains(*point_in_quad_space); | 299 return quad->rect.Contains(*point_in_quad_space); |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace cc | 302 } // namespace cc |
| OLD | NEW |