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

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

Issue 1437413002: cc: Remove ScopedPtrVector and cc::remove_if. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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_aggregator_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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 const CompositorFrame* surface_frame = surface->GetEligibleFrame(); 224 const CompositorFrame* surface_frame = surface->GetEligibleFrame();
225 if (!surface_frame) 225 if (!surface_frame)
226 return nullptr; 226 return nullptr;
227 227
228 const DelegatedFrameData* frame_data = 228 const DelegatedFrameData* frame_data =
229 surface_frame->delegated_frame_data.get(); 229 surface_frame->delegated_frame_data.get();
230 if (frame_data->render_pass_list.empty()) 230 if (frame_data->render_pass_list.empty())
231 return nullptr; 231 return nullptr;
232 232
233 if (!render_pass_id.IsValid()) 233 if (!render_pass_id.IsValid())
234 return frame_data->render_pass_list.back(); 234 return frame_data->render_pass_list.back().get();
235 235
236 for (const auto* render_pass : frame_data->render_pass_list) { 236 for (const auto& render_pass : frame_data->render_pass_list) {
237 if (render_pass->id == render_pass_id) 237 if (render_pass->id == render_pass_id)
238 return render_pass; 238 return render_pass.get();
239 } 239 }
240 240
241 return nullptr; 241 return nullptr;
242 } 242 }
243 243
244 bool SurfaceHittest::PointInQuad(const DrawQuad* quad, 244 bool SurfaceHittest::PointInQuad(const DrawQuad* quad,
245 const gfx::Point& point_in_render_pass_space, 245 const gfx::Point& point_in_render_pass_space,
246 gfx::Transform* target_to_quad_transform, 246 gfx::Transform* target_to_quad_transform,
247 gfx::Point* point_in_quad_space) { 247 gfx::Point* point_in_quad_space) {
248 // First we test against the clip_rect. The clip_rect is in target space, so 248 // First we test against the clip_rect. The clip_rect is in target space, so
(...skipping 11 matching lines...) Expand all
260 return false; 260 return false;
261 } 261 }
262 262
263 *point_in_quad_space = point_in_render_pass_space; 263 *point_in_quad_space = point_in_render_pass_space;
264 target_to_quad_transform->TransformPoint(point_in_quad_space); 264 target_to_quad_transform->TransformPoint(point_in_quad_space);
265 265
266 return quad->rect.Contains(*point_in_quad_space); 266 return quad->rect.Contains(*point_in_quad_space);
267 } 267 }
268 268
269 } // namespace cc 269 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_aggregator_unittest.cc ('k') | cc/surfaces/surface_hittest_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698