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

Side by Side Diff: services/gfx/compositor/compositor_engine.cc

Issue 1949233002: Create a RegisterViewAssociate method in ViewManager (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add tests to mojo tests Created 4 years, 7 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 | « services/BUILD.gn ('k') | services/ui/launcher/launch_instance.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/gfx/compositor/compositor_engine.h" 5 #include "services/gfx/compositor/compositor_engine.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <sstream> 8 #include <sstream>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 for (auto& pair : scenes_by_token_) { 76 for (auto& pair : scenes_by_token_) {
77 SceneState* other_scene_state = pair.second; 77 SceneState* other_scene_state = pair.second;
78 other_scene_state->scene_def()->NotifySceneUnavailable( 78 other_scene_state->scene_def()->NotifySceneUnavailable(
79 scene_state->scene_token(), 79 scene_state->scene_token(),
80 base::Bind(&CompositorEngine::SendResourceUnavailable, 80 base::Bind(&CompositorEngine::SendResourceUnavailable,
81 base::Unretained(this), 81 base::Unretained(this),
82 base::Unretained(other_scene_state))); 82 base::Unretained(other_scene_state)));
83 } 83 }
84 84
85 // Destroy any renderers using this scene. 85 // Destroy any renderers using this scene.
86 std::vector<RendererState*> renderers_to_destroy;
86 for (auto& renderer : renderers_) { 87 for (auto& renderer : renderers_) {
87 if (renderer->root_scene() == scene_state) { 88 if (renderer->root_scene() == scene_state) {
88 LOG(ERROR) << "Destroying renderer whose root scene has become " 89 renderers_to_destroy.emplace_back(renderer);
89 "unavailable: renderer="
90 << renderer;
91 DestroyRenderer(renderer);
92 } 90 }
93 } 91 }
92 for (auto& renderer : renderers_to_destroy) {
93 LOG(ERROR) << "Destroying renderer whose root scene has become "
94 "unavailable: renderer="
95 << renderer;
96 DestroyRenderer(renderer);
97 }
94 98
95 // Consider all dependent rendering to be invalidated. 99 // Consider all dependent rendering to be invalidated.
96 universe_.RemoveScene(scene_state->scene_token()); 100 universe_.RemoveScene(scene_state->scene_token());
97 InvalidateScene(scene_state); 101 InvalidateScene(scene_state);
98 102
99 // Remove from registry. 103 // Remove from registry.
100 scenes_by_token_.erase(scene_state->scene_token().value); 104 scenes_by_token_.erase(scene_state->scene_token().value);
101 delete scene_state; 105 delete scene_state;
102 } 106 }
103 107
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 477
474 SceneDef::Disposition disposition = 478 SceneDef::Disposition disposition =
475 PresentScene(scene_state, presentation_time); 479 PresentScene(scene_state, presentation_time);
476 if (disposition == SceneDef::Disposition::kFailed) 480 if (disposition == SceneDef::Disposition::kFailed)
477 DestroyScene(scene_state); 481 DestroyScene(scene_state);
478 else if (disposition == SceneDef::Disposition::kSucceeded) 482 else if (disposition == SceneDef::Disposition::kSucceeded)
479 InvalidateScene(scene_state); 483 InvalidateScene(scene_state);
480 } 484 }
481 485
482 } // namespace compositor 486 } // namespace compositor
OLDNEW
« no previous file with comments | « services/BUILD.gn ('k') | services/ui/launcher/launch_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698