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

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: Rebase works! 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
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 unsigned int id = static_cast<unsigned int>( 439 unsigned int id = static_cast<unsigned int>(
439 input->surface_quad_state->surface.To<cc::SurfaceId>().id); 440 input->surface_quad_state->surface.To<cc::SurfaceId>().id);
440 // TODO(fsamuel): Security checks: 441 // TODO(fsamuel): Security checks:
441 // 1. We need to make sure the embedder can only position views it's allowed 442 // 1. We need to make sure the embedder can only position views it's allowed
442 // to access. 443 // to access.
443 // 2. We need to make sure that the embedder cannot place views in areas 444 // 2. We need to make sure that the embedder cannot place views in areas
444 // outside of its own bounds. 445 // outside of its own bounds.
445 ServerView* view = GetView(ViewIdFromTransportId(id)); 446 ServerView* view = GetView(ViewIdFromTransportId(id));
446 // If a CompositorFrame message arrives late, say during a navigation, then 447 // If a CompositorFrame message arrives late, say during a navigation, then
447 // it may contain view IDs that no longer exist. 448 // it may contain view IDs that no longer exist.
448 if (!view) 449 if (!view || view->surface_id().is_null())
449 return false; 450 return false;
450 gfx::Rect bounds(input->visible_rect.To<gfx::Rect>()); 451
451 gfx::Point p; 452 cc::SurfaceDrawQuad* surface_quad =
452 sqs->quad_to_target_transform.TransformPoint(&p); 453 render_pass->CreateAndAppendDrawQuad<cc::SurfaceDrawQuad>();
rjkroege 2015/09/16 21:31:37 where do we validate the contents of the provided
Fady Samuel 2015/09/17 18:31:42 There's a TODO above. Added a todo and filed a bu
453 bounds.set_origin(p); 454 surface_quad->SetAll(
454 // TODO(fsamuel): This seems like a crude way to set the size that probably 455 sqs,
455 // doesn't work correctly in the general case. We need to get transforms 456 input->rect.To<gfx::Rect>(),
456 // working correctly in the general case. 457 input->opaque_rect.To<gfx::Rect>(),
457 bounds.set_size(gfx::ToRoundedSize( 458 input->visible_rect.To<gfx::Rect>(),
458 gfx::ScaleSize(bounds.size(), metadata->device_scale_factor))); 459 input->needs_blending,
459 view->SetBounds(bounds); 460 view->surface_id());
460 return true; 461 return true;
461 } 462 }
462 463
463 } // namespace view_manager 464 } // namespace view_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698