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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 return false; | 227 return false; |
228 } | 228 } |
229 | 229 |
230 const RenderPass* SurfaceHittest::GetRenderPassForSurfaceById( | 230 const RenderPass* SurfaceHittest::GetRenderPassForSurfaceById( |
231 SurfaceId surface_id, | 231 SurfaceId surface_id, |
232 const RenderPassId& render_pass_id) { | 232 const RenderPassId& render_pass_id) { |
233 Surface* surface = manager_->GetSurfaceForId(surface_id); | 233 Surface* surface = manager_->GetSurfaceForId(surface_id); |
234 if (!surface) | 234 if (!surface) |
235 return nullptr; | 235 return nullptr; |
236 | 236 |
237 const CompositorFrame* surface_frame = surface->GetEligibleFrame(); | 237 const CompositorFrame& surface_frame = surface->GetEligibleFrame(); |
238 if (!surface_frame) | 238 if (!surface_frame.delegated_frame_data) |
239 return nullptr; | 239 return nullptr; |
240 | 240 |
241 const DelegatedFrameData* frame_data = | 241 const DelegatedFrameData* frame_data = |
242 surface_frame->delegated_frame_data.get(); | 242 surface_frame.delegated_frame_data.get(); |
243 if (frame_data->render_pass_list.empty()) | 243 if (frame_data->render_pass_list.empty()) |
244 return nullptr; | 244 return nullptr; |
245 | 245 |
246 if (!render_pass_id.IsValid()) | 246 if (!render_pass_id.IsValid()) |
247 return frame_data->render_pass_list.back().get(); | 247 return frame_data->render_pass_list.back().get(); |
248 | 248 |
249 for (const auto& render_pass : frame_data->render_pass_list) { | 249 for (const auto& render_pass : frame_data->render_pass_list) { |
250 if (render_pass->id == render_pass_id) | 250 if (render_pass->id == render_pass_id) |
251 return render_pass.get(); | 251 return render_pass.get(); |
252 } | 252 } |
(...skipping 20 matching lines...) Expand all Loading... |
273 return false; | 273 return false; |
274 } | 274 } |
275 | 275 |
276 *point_in_quad_space = point_in_render_pass_space; | 276 *point_in_quad_space = point_in_render_pass_space; |
277 target_to_quad_transform->TransformPoint(point_in_quad_space); | 277 target_to_quad_transform->TransformPoint(point_in_quad_space); |
278 | 278 |
279 return quad->rect.Contains(*point_in_quad_space); | 279 return quad->rect.Contains(*point_in_quad_space); |
280 } | 280 } |
281 | 281 |
282 } // namespace cc | 282 } // namespace cc |
OLD | NEW |