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

Side by Side Diff: components/mus/connection_manager.cc

Issue 1328953003: Mandoline: Support transforms and clipping of OOPIFs and events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Rob's comments Created 5 years, 3 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 | « no previous file | components/mus/display_manager.h » ('j') | components/mus/display_manager.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/mus/connection_manager.h" 5 #include "components/mus/connection_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/quads/shared_quad_state.h" 10 #include "cc/quads/shared_quad_state.h"
11 #include "cc/quads/surface_draw_quad.h"
11 #include "components/mus/client_connection.h" 12 #include "components/mus/client_connection.h"
12 #include "components/mus/connection_manager_delegate.h" 13 #include "components/mus/connection_manager_delegate.h"
13 #include "components/mus/server_view.h" 14 #include "components/mus/server_view.h"
14 #include "components/mus/view_coordinate_conversions.h" 15 #include "components/mus/view_coordinate_conversions.h"
15 #include "components/mus/view_tree_host_connection.h" 16 #include "components/mus/view_tree_host_connection.h"
16 #include "components/mus/view_tree_impl.h" 17 #include "components/mus/view_tree_impl.h"
17 #include "mojo/application/public/cpp/application_connection.h" 18 #include "mojo/application/public/cpp/application_connection.h"
18 #include "mojo/converters/geometry/geometry_type_converters.h" 19 #include "mojo/converters/geometry/geometry_type_converters.h"
19 #include "mojo/converters/input_events/input_events_type_converters.h" 20 #include "mojo/converters/input_events/input_events_type_converters.h"
20 #include "mojo/converters/surfaces/surfaces_type_converters.h" 21 #include "mojo/converters/surfaces/surfaces_type_converters.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 unsigned int id = static_cast<unsigned int>( 440 unsigned int id = static_cast<unsigned int>(
440 input->surface_quad_state->surface.To<cc::SurfaceId>().id); 441 input->surface_quad_state->surface.To<cc::SurfaceId>().id);
441 // TODO(fsamuel): Security checks: 442 // TODO(fsamuel): Security checks:
442 // 1. We need to make sure the embedder can only position views it's allowed 443 // 1. We need to make sure the embedder can only position views it's allowed
443 // to access. 444 // to access.
444 // 2. We need to make sure that the embedder cannot place views in areas 445 // 2. We need to make sure that the embedder cannot place views in areas
445 // outside of its own bounds. 446 // outside of its own bounds.
446 ServerView* view = GetView(ViewIdFromTransportId(id)); 447 ServerView* view = GetView(ViewIdFromTransportId(id));
447 // If a CompositorFrame message arrives late, say during a navigation, then 448 // If a CompositorFrame message arrives late, say during a navigation, then
448 // it may contain view IDs that no longer exist. 449 // it may contain view IDs that no longer exist.
449 if (!view) 450 if (!view || view->surface_id().is_null())
450 return false; 451 return false;
451 gfx::Rect bounds(input->visible_rect.To<gfx::Rect>()); 452
452 gfx::Point p; 453 // TODO(fsamuel): This shouldn't be in the ConnectionManager. Let's fine a
rjkroege 2015/09/17 19:03:56 fine -> find
Fady Samuel 2015/09/17 20:00:21 Done.
453 sqs->quad_to_target_transform.TransformPoint(&p); 454 // better home for it. http://crbug.com/533029.
454 bounds.set_origin(p); 455 cc::SurfaceDrawQuad* surface_quad =
455 // TODO(fsamuel): This seems like a crude way to set the size that probably 456 render_pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>();
456 // doesn't work correctly in the general case. We need to get transforms 457 surface_quad->SetAll(
457 // working correctly in the general case. 458 sqs,
458 bounds.set_size(gfx::ToRoundedSize( 459 input->rect.To<gfx::Rect>(),
459 gfx::ScaleSize(bounds.size(), metadata->device_scale_factor))); 460 input->opaque_rect.To<gfx::Rect>(),
460 view->SetBounds(bounds); 461 input->visible_rect.To<gfx::Rect>(),
462 input->needs_blending,
463 view->surface_id());
461 return true; 464 return true;
462 } 465 }
463 466
464 } // namespace mus 467 } // namespace mus
OLDNEW
« no previous file with comments | « no previous file | components/mus/display_manager.h » ('j') | components/mus/display_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698