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

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

Issue 1775143004: Mozart: Directly associate the renderer with the view tree. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-1
Patch Set: Created 4 years, 9 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 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 return; 249 return;
250 } 250 }
251 251
252 // Update the root. 252 // Update the root.
253 if (renderer_state->SetRootScene(scene_state, scene_version, *viewport)) { 253 if (renderer_state->SetRootScene(scene_state, scene_version, *viewport)) {
254 ScheduleFrameForRenderer(renderer_state, 254 ScheduleFrameForRenderer(renderer_state,
255 Scheduler::SchedulingMode::kSnapshot); 255 Scheduler::SchedulingMode::kSnapshot);
256 } 256 }
257 } 257 }
258 258
259 void CompositorEngine::ResetRootScene(RendererState* renderer_state) {
260 DCHECK(IsRendererStateRegisteredDebug(renderer_state));
261 DVLOG(1) << "ResetRootScene: renderer=" << renderer_state;
262
263 // Update the root.
264 if (renderer_state->ResetRootScene()) {
265 ScheduleFrameForRenderer(renderer_state,
266 Scheduler::SchedulingMode::kSnapshot);
267 }
268 }
269
259 void CompositorEngine::HitTest( 270 void CompositorEngine::HitTest(
260 RendererState* renderer_state, 271 RendererState* renderer_state,
261 mojo::PointPtr point, 272 mojo::PointPtr point,
262 const mojo::gfx::composition::HitTester::HitTestCallback& callback) { 273 const mojo::gfx::composition::HitTester::HitTestCallback& callback) {
263 DCHECK(IsRendererStateRegisteredDebug(renderer_state)); 274 DCHECK(IsRendererStateRegisteredDebug(renderer_state));
264 DCHECK(point); 275 DCHECK(point);
265 DVLOG(1) << "HitTest: renderer=" << renderer_state << ", point=" << point; 276 DVLOG(1) << "HitTest: renderer=" << renderer_state << ", point=" << point;
266 277
267 // TODO(jeffbrown): hit tests on scenes 278 // TODO(jeffbrown): hit tests on scenes
268 auto result = mojo::gfx::composition::HitTestResult::New(); 279 auto result = mojo::gfx::composition::HitTestResult::New();
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 454
444 SceneDef::Disposition disposition = 455 SceneDef::Disposition disposition =
445 PresentScene(scene_state, presentation_time); 456 PresentScene(scene_state, presentation_time);
446 if (disposition == SceneDef::Disposition::kFailed) 457 if (disposition == SceneDef::Disposition::kFailed)
447 DestroyScene(scene_state); 458 DestroyScene(scene_state);
448 else if (disposition == SceneDef::Disposition::kSucceeded) 459 else if (disposition == SceneDef::Disposition::kSucceeded)
449 InvalidateScene(scene_state); 460 InvalidateScene(scene_state);
450 } 461 }
451 462
452 } // namespace compositor 463 } // namespace compositor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698