PNativeLayerRemote.ipdl (2405B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 include "mozilla/GfxMessageUtils.h"; 7 8 using struct mozilla::gfx::DeviceColor from "mozilla/gfx/2D.h"; 9 using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h"; 10 using mozilla::gfx::IntRect from "mozilla/gfx/Point.h"; 11 using mozilla::gfx::RoundedRect from "mozilla/gfx/Point.h"; 12 using mozilla::gfx::IntSize from "mozilla/gfx/Point.h"; 13 using mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h"; 14 [MoveOnly] using mozilla::layers::IOSurfacePort from "mozilla/layers/IOSurfacePort.h"; 15 16 namespace mozilla { 17 namespace layers { 18 19 union NativeLayerCommand { 20 CommandCreateLayer; 21 CommandCreateLayerForExternalTexture; 22 CommandCreateLayerForColor; 23 CommandLayerDestroyed; 24 CommandSetLayers; 25 CommandLayerInfo; 26 CommandChangedSurface; 27 }; 28 29 struct CommandCreateLayer { 30 uint64_t ID; 31 IntSize Size; 32 bool Opaque; 33 }; 34 35 struct CommandCreateLayerForExternalTexture { 36 uint64_t ID; 37 bool Opaque; 38 }; 39 40 struct CommandCreateLayerForColor { 41 uint64_t ID; 42 DeviceColor Color; 43 }; 44 45 struct CommandLayerDestroyed { 46 uint64_t ID; 47 }; 48 49 struct CommandSetLayers { 50 uint64_t[] IDs; 51 }; 52 53 struct CommandLayerInfo { 54 uint64_t ID; 55 IntPoint Position; 56 IntRect DisplayRect; 57 IntRect? ClipRect; 58 RoundedRect? RoundedClipRect; 59 Matrix4x4 Transform; 60 int8_t SamplingFilter; 61 bool SurfaceIsFlipped; 62 }; 63 64 struct CommandChangedSurface { 65 uint64_t ID; 66 IOSurfacePort Surface; 67 bool IsDRM; 68 bool IsHDR; 69 IntSize Size; 70 }; 71 72 // This protocol allows a NativeLayerRoot implementation on the GPU 73 // to send layer commands to the parent process. It also allows the 74 // GPU to request readback, which the parent will send as a Shmem. 75 [NeedsOtherPid, ParentProc=Parent, ChildProc=GPU] 76 sync protocol PNativeLayerRemote 77 { 78 parent: 79 async CommitNativeLayerCommands(NativeLayerCommand[] commands); 80 sync RequestReadback(IntSize size) returns (Shmem pixels); 81 82 // A synchronous no-op message, to make sure that any preceding 83 // CommitNativeLayerCommands messages have been processed. 84 // Used for synchronous widget-initiated paints, most importantly 85 // during window resize or when a new window is opened. 86 sync Flush(); 87 }; 88 89 } // layers 90 } // mozilla