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

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
« no previous file with comments | « mojo/services/public/cpp/view_manager/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4e5c11dc2fafd229b92858c18f4540a3cdfb4f7f 100644
--- a/mojo/services/view_manager/display_manager.cc
+++ b/mojo/services/view_manager/display_manager.cc
@@ -29,16 +29,23 @@ 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;
+ gfx::Rect node_bounds = view->bounds() + offset;
+ std::vector<const ServerView*> children(view->GetChildren());
+ for (std::vector<const ServerView*>::reverse_iterator it = children.rbegin();
+ it != children.rend();
+ ++it) {
+ DrawViewTree(pass, *it, offset + view->bounds().OffsetFromOrigin());
+ }
+
cc::SurfaceId node_id = view->surface_id();
SurfaceQuadStatePtr surface_quad_state = SurfaceQuadState::New();
surface_quad_state->surface = SurfaceId::From(node_id);
- const gfx::Rect& node_bounds = view->bounds();
gfx::Transform node_transform;
node_transform.Translate(node_bounds.x(), node_bounds.y());
@@ -57,13 +64,6 @@ void DrawViewTree(Pass* pass, const ServerView* view) {
pass->quads.push_back(surface_quad.Pass());
pass->shared_quad_states.push_back(sqs.Pass());
-
- std::vector<const ServerView*> children(view->GetChildren());
- for (std::vector<const ServerView*>::reverse_iterator it = children.rbegin();
- it != children.rend();
- ++it) {
- DrawViewTree(pass, *it);
- }
}
} // namespace
@@ -126,7 +126,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());
« no previous file with comments | « mojo/services/public/cpp/view_manager/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698