blob: a911d405f6dc34618bd19d38a27a606225631469 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[DartPackage="mojo_services"]
module mojo.gfx.composition;
import "mojo/services/geometry/interfaces/geometry.mojom";
import "mojo/services/gfx/composition/interfaces/hit_tests.mojom";
import "mojo/services/gfx/composition/interfaces/scene_token.mojom";
// The renderer is a service which renders a scene graph to a display.
//
// Use |Compositor.CreateRenderer()| to create a renderer.
interface Renderer {
// Sets the scene to be displayed by the renderer.
//
// The |size| specifies the size of the output.
//
// The |scene_token| specifies the scene which will be drawn as the
// root of the scene graph.
//
// The |scene_version| specifies the version of the scene to render,
// Use |kSceneVersionNone| to request the most recently published
// version of the scene if synchronization is unimportant.
//
// The |viewport| specifies the portion of the scene to render in pixels.
//
// It is an error to create a renderer with an invalid |scene_token|
// or |size|; the connection will be closed.
// TODO: make this an event instead
SetRootScene(SceneToken scene_token,
uint32 scene_version,
mojo.Rect viewport);
// Dissociates the root scene from the renderer.
ClearRootScene();
// Provides an interface which can be used to perform hit tests on the
// contents of the renderer's scene graph.
GetHitTester(HitTester& hit_tester);
};