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

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

Issue 2098953003: Make cc::CompositorFrames movable [Part 2 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed exo unittests Created 4 years, 5 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 | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_hittest_unittest.cc » ('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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_hittest_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698