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

Unified Diff: mojo/services/view_manager/display_manager.cc

Issue 555953007: Fixes for surfaces bindings exposed by wm_flow app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: mojo/services/view_manager/display_manager.cc
diff --git a/mojo/services/view_manager/display_manager.cc b/mojo/services/view_manager/display_manager.cc
index d42e2823a8d37cd05f6d408cb24120c4be3d36a1..c00da2a60dfe0e0060e7e3bd3fd6c9078934cee8 100644
--- a/mojo/services/view_manager/display_manager.cc
+++ b/mojo/services/view_manager/display_manager.cc
@@ -29,7 +29,7 @@ gfx::Rect ConvertRectToRoot(const ServerView* view, const gfx::Rect& bounds) {
return gfx::Rect(origin, bounds.size());
}
-void DrawViewTree(Pass* pass, const ServerView* view) {
+void DrawViewTree(Pass* pass, const ServerView* view, gfx::Vector2d offset) {
if (!view->visible())
return;
@@ -38,7 +38,7 @@ void DrawViewTree(Pass* pass, const ServerView* view) {
SurfaceQuadStatePtr surface_quad_state = SurfaceQuadState::New();
surface_quad_state->surface = SurfaceId::From(node_id);
- const gfx::Rect& node_bounds = view->bounds();
+ gfx::Rect node_bounds = view->bounds() + offset;
gfx::Transform node_transform;
node_transform.Translate(node_bounds.x(), node_bounds.y());
@@ -58,11 +58,12 @@ void DrawViewTree(Pass* pass, const ServerView* view) {
pass->quads.push_back(surface_quad.Pass());
pass->shared_quad_states.push_back(sqs.Pass());
+ offset += view->bounds().OffsetFromOrigin();
std::vector<const ServerView*> children(view->GetChildren());
for (std::vector<const ServerView*>::reverse_iterator it = children.rbegin();
it != children.rend();
++it) {
- DrawViewTree(pass, *it);
+ DrawViewTree(pass, *it, offset);
}
}
@@ -126,7 +127,7 @@ void DisplayManager::Draw() {
PassPtr pass = CreateDefaultPass(1, gfx::Rect(bounds_));
pass->damage_rect = Rect::From(dirty_rect_);
- DrawViewTree(pass.get(), connection_manager_->root());
+ DrawViewTree(pass.get(), connection_manager_->root(), gfx::Vector2d());
FramePtr frame = Frame::New();
frame->passes.push_back(pass.Pass());

Powered by Google App Engine
This is Rietveld 408576698