| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 [DartPackage="mojo_services"] | |
| 6 module mojo; | |
| 7 | |
| 8 import "geometry/public/interfaces/geometry.mojom"; | |
| 9 import "gpu/public/interfaces/context_provider.mojom"; | |
| 10 import "input_events/public/interfaces/input_events.mojom"; | |
| 11 | |
| 12 struct ViewportMetrics { | |
| 13 Size size; | |
| 14 float device_pixel_ratio = 1.0; | |
| 15 }; | |
| 16 | |
| 17 struct SurfaceConfiguration { | |
| 18 uint8 red_bits = 8; | |
| 19 uint8 green_bits = 8; | |
| 20 uint8 blue_bits = 8; | |
| 21 uint8 alpha_bits = 8; | |
| 22 uint8 depth_bits; | |
| 23 uint8 stencil_bits; | |
| 24 }; | |
| 25 | |
| 26 interface NativeViewport { | |
| 27 // TODO(sky): having a create function is awkward. Should there be a factory | |
| 28 // to create the NativeViewport that takes the size? | |
| 29 // When the viewport is created it is initially shown. | |
| 30 Create(Size size, SurfaceConfiguration? requested_configuration) => (ViewportM
etrics metrics); | |
| 31 | |
| 32 Show(); | |
| 33 Hide(); | |
| 34 Close(); | |
| 35 SetSize(Size size); | |
| 36 SetEventDispatcher(NativeViewportEventDispatcher dispatcher); | |
| 37 | |
| 38 // Requests a ContextProvider capable of producing contexts that draw to | |
| 39 // this native viewport. | |
| 40 GetContextProvider(ContextProvider& provider); | |
| 41 | |
| 42 // The initial viewport metrics will be sent in the reply to the Create | |
| 43 // method. Call RequestMetrics() to receive updates when the viewport metrics | |
| 44 // change. The reply will be sent when the viewport metrics are different from | |
| 45 // the values last sent, so to receive continuous updates call this method | |
| 46 // again after receiving the callback. | |
| 47 RequestMetrics() => (ViewportMetrics metrics); | |
| 48 }; | |
| 49 | |
| 50 interface NativeViewportEventDispatcher { | |
| 51 OnEvent(Event event) => (); | |
| 52 }; | |
| OLD | NEW |