1/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=8 et :
3 */
4/* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7
8include LayersSurfaces;
9include LayersMessages;
10include "mozilla/GfxMessageUtils.h";
11include "mozilla/layers/WebRenderMessageUtils.h";
12
13include WebRenderMessages;
14include protocol PCompositorBridge;
15include protocol PTexture;
16
17using mozilla::layers::APZTestData from "mozilla/layers/APZTestData.h";
18using mozilla::layers::FrameUniformityData from "mozilla/layers/FrameUniformityData.h";
19using mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h";
20using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
21using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
22using mozilla::layers::CompositionPayload from "mozilla/layers/LayersTypes.h";
23using mozilla::layers::CompositableHandle from "mozilla/layers/LayersTypes.h";
24using mozilla::wr::BuiltDisplayListDescriptor from "mozilla/webrender/webrender_ffi.h";
25using mozilla::wr::IdNamespace from "mozilla/webrender/WebRenderTypes.h";
26using mozilla::wr::MaybeIdNamespace from "mozilla/webrender/WebRenderTypes.h";
27using mozilla::wr::ExternalImageKeyPair from "mozilla/webrender/WebRenderTypes.h";
28[MoveOnly] using mozilla::layers::DisplayListData from "mozilla/layers/RenderRootTypes.h";
29[MoveOnly] using mozilla::layers::MaybeTransactionData from "mozilla/layers/RenderRootTypes.h";
30using mozilla::layers::FocusTarget from "mozilla/layers/FocusTarget.h";
31using mozilla::layers::LayersObserverEpoch from "mozilla/layers/LayersTypes.h";
32using mozilla::layers::TransactionId from "mozilla/layers/LayersTypes.h";
33using mozilla::VsyncId from "mozilla/VsyncDispatcher.h";
34
35namespace mozilla {
36namespace layers {
37
38sync protocol PWebRenderBridge
39{
40  manager PCompositorBridge;
41
42parent:
43  sync EnsureConnected()
44    returns (TextureFactoryIdentifier textureFactoryIdentifier, MaybeIdNamespace maybeIdNamespace, nsCString error);
45
46  async NewCompositable(CompositableHandle handle, TextureInfo info);
47  async ReleaseCompositable(CompositableHandle compositable);
48
49  async DeleteCompositorAnimations(uint64_t[] aIds);
50  async SetDisplayList(DisplayListData displayList,
51                       OpDestroy[] toDestroy, uint64_t fwdTransactionId, TransactionId transactionId,
52                       bool containsSVGGroup,
53                       VsyncId vsyncId, TimeStamp vsyncStartTime,
54                       TimeStamp refreshStartTime, TimeStamp txnStartTime, nsCString txnURL, TimeStamp fwdTime,
55                       CompositionPayload[] payloads);
56  async EmptyTransaction(FocusTarget focusTarget,
57                         MaybeTransactionData transationData,
58                         OpDestroy[] toDestroy, uint64_t fwdTransactionId, TransactionId transactionId,
59                         VsyncId vsyncId, TimeStamp vsyncStartTime,
60                         TimeStamp refreshStartTime, TimeStamp txnStartTime,
61                         nsCString txnURL, TimeStamp fwdTime,
62                         CompositionPayload[] payloads);
63  async SetFocusTarget(FocusTarget focusTarget);
64  async UpdateResources(IdNamespace aIdNamespace, OpUpdateResource[] aResourceUpdates,
65                        RefCountedShmem[] aSmallShmems, Shmem[] aLargeShmems);
66  async ParentCommands(WebRenderParentCommand[] commands);
67  sync GetSnapshot(PTexture texture) returns (bool aNeedsYFlip);
68  async SetLayersObserverEpoch(LayersObserverEpoch childEpoch);
69  async ClearCachedResources();
70  // Invalidate rendered frame
71  async InvalidateRenderedFrame();
72  // Schedule a composite if one isn't already scheduled.
73  async ScheduleComposite();
74  // Save the frame capture to disk
75  async Capture();
76
77  // Start capturing each frame to disk. See
78  // nsIDOMWindowUtils::wrStartCaptureSequence for documentation.
79  async StartCaptureSequence(nsCString aPath, uint32_t aFlags);
80
81  // Stop the captures started by StartCaptureSequence. See
82  // nsIDOMWindowUtils::wrStopCaptureSequence for documentation.
83  async StopCaptureSequence();
84
85  // Replacement for PCompositorBridge::SyncWithCompositor, but for WR. We need
86  // it on PWebRenderBridge because it associated with a particular top-level
87  // window, and PCompositorBridge doesn't allow doing that in a secure manner.
88  sync SyncWithCompositor();
89
90  // These correspond exactly to the equivalent APIs in PLayerTransaction -
91  // see those for documentation.
92  async SetConfirmedTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);
93  // More copied from PLayerTransaction, but these are only used for testing.
94  sync SetTestSampleTime(TimeStamp sampleTime);
95  sync LeaveTestMode();
96  sync GetAnimationValue(uint64_t aCompositorAnimationsId) returns (OMTAValue value);
97  sync SetAsyncScrollOffset(ViewID scrollId, float x, float y);
98  sync SetAsyncZoom(ViewID scrollId, float zoom);
99  async FlushApzRepaints();
100  sync GetAPZTestData() returns (APZTestData data);
101  sync GetFrameUniformity() returns (FrameUniformityData data);
102
103  async Shutdown();
104  sync ShutdownSync();
105child:
106  async WrUpdated(IdNamespace aNewIdNamespace, TextureFactoryIdentifier textureFactoryIdentifier);
107  async WrReleasedImages(ExternalImageKeyPair[] pairs);
108  async __delete__();
109};
110
111} // layers
112} // mozilla
113