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

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

Issue 2855723002: Don't submit frames with no render passes in cc tests (Closed)
Patch Set: c Created 3 years, 7 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_manager.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/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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
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->HasActiveFrame()) 259 if (!surface->HasActiveFrame())
260 return nullptr; 260 return nullptr;
261 const CompositorFrame& surface_frame = surface->GetActiveFrame(); 261 const CompositorFrame& surface_frame = surface->GetActiveFrame();
262 262
263 if (surface_frame.render_pass_list.empty())
264 return nullptr;
265
266 if (!render_pass_id) 263 if (!render_pass_id)
267 return surface_frame.render_pass_list.back().get(); 264 return surface_frame.render_pass_list.back().get();
268 265
269 for (const auto& render_pass : surface_frame.render_pass_list) { 266 for (const auto& render_pass : surface_frame.render_pass_list) {
270 if (render_pass->id == render_pass_id) 267 if (render_pass->id == render_pass_id)
271 return render_pass.get(); 268 return render_pass.get();
272 } 269 }
273 270
274 return nullptr; 271 return nullptr;
275 } 272 }
(...skipping 17 matching lines...) Expand all
293 return false; 290 return false;
294 } 291 }
295 292
296 *point_in_quad_space = point_in_render_pass_space; 293 *point_in_quad_space = point_in_render_pass_space;
297 target_to_quad_transform->TransformPoint(point_in_quad_space); 294 target_to_quad_transform->TransformPoint(point_in_quad_space);
298 295
299 return quad->rect.Contains(*point_in_quad_space); 296 return quad->rect.Contains(*point_in_quad_space);
300 } 297 }
301 298
302 } // namespace cc 299 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698