OLD | NEW |
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 "services/ui/view_manager/view_registry.h" | 5 #include "services/ui/view_manager/view_registry.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 | 756 |
757 if (!tree_state->renderer()) | 757 if (!tree_state->renderer()) |
758 return; | 758 return; |
759 | 759 |
760 if (tree_state->root()) { | 760 if (tree_state->root()) { |
761 ViewState* root_state = tree_state->root()->state(); | 761 ViewState* root_state = tree_state->root()->state(); |
762 if (root_state && root_state->scene_token() && | 762 if (root_state && root_state->scene_token() && |
763 root_state->layout_result()) { | 763 root_state->layout_result()) { |
764 // TODO(jeffbrown): Take the scene version from the layout parameters | 764 // TODO(jeffbrown): Take the scene version from the layout parameters |
765 // once we've figured out that part of the layout protocol. | 765 // once we've figured out that part of the layout protocol. |
766 mojo::Rect viewport; | 766 auto viewport = mojo::Rect::New(); |
767 viewport.width = root_state->layout_result()->size->width; | 767 viewport->width = root_state->layout_result()->size->width; |
768 viewport.height = root_state->layout_result()->size->height; | 768 viewport->height = root_state->layout_result()->size->height; |
769 tree_state->renderer()->SetRootScene( | 769 tree_state->renderer()->SetRootScene( |
770 tree_state->root()->state()->scene_token()->Clone(), | 770 tree_state->root()->state()->scene_token()->Clone(), |
771 mojo::gfx::composition::kSceneVersionNone, viewport.Clone()); | 771 mojo::gfx::composition::kSceneVersionNone, viewport.Pass()); |
772 return; | 772 return; |
773 } | 773 } |
774 } | 774 } |
775 | 775 |
776 tree_state->renderer()->ClearRootScene(); | 776 tree_state->renderer()->ClearRootScene(); |
777 } | 777 } |
778 | 778 |
779 void ViewRegistry::OnRendererDied(ViewTreeState* tree_state) { | 779 void ViewRegistry::OnRendererDied(ViewTreeState* tree_state) { |
780 DCHECK(IsViewTreeStateRegisteredDebug(tree_state)); | 780 DCHECK(IsViewTreeStateRegisteredDebug(tree_state)); |
781 DVLOG(1) << "UpdateViewTreeRootScene: tree_state=" << tree_state; | 781 DVLOG(1) << "UpdateViewTreeRootScene: tree_state=" << tree_state; |
(...skipping 27 matching lines...) Expand all Loading... |
809 void ViewRegistry::SendRendererDied(ViewTreeState* tree_state) { | 809 void ViewRegistry::SendRendererDied(ViewTreeState* tree_state) { |
810 DCHECK(IsViewTreeStateRegisteredDebug(tree_state)); | 810 DCHECK(IsViewTreeStateRegisteredDebug(tree_state)); |
811 | 811 |
812 // TODO: Detect ANRs | 812 // TODO: Detect ANRs |
813 DVLOG(1) << "SendRendererDied: tree_state=" << tree_state; | 813 DVLOG(1) << "SendRendererDied: tree_state=" << tree_state; |
814 tree_state->view_tree_listener()->OnRendererDied( | 814 tree_state->view_tree_listener()->OnRendererDied( |
815 base::Bind(&base::DoNothing)); | 815 base::Bind(&base::DoNothing)); |
816 } | 816 } |
817 | 817 |
818 } // namespace view_manager | 818 } // namespace view_manager |
OLD | NEW |