summaryrefslogtreecommitdiffstats
path: root/gfx/layers/ipc/PWebRenderBridge.ipdl
blob: e3e29112e10a1445764b559a5fac5363b7879bbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=8 et :
 */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

include LayersSurfaces;
include LayersMessages;
include "mozilla/GfxMessageUtils.h";
include "mozilla/layers/WebRenderMessageUtils.h";

include WebRenderMessages;
include protocol PCompositorBridge;
include protocol PTexture;

using mozilla::layers::APZTestData from "mozilla/layers/APZTestData.h";
using mozilla::layers::FrameUniformityData from "mozilla/layers/FrameUniformityData.h";
using mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h";
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
using mozilla::layers::CompositionPayload from "mozilla/layers/LayersTypes.h";
using mozilla::layers::CompositableHandle from "mozilla/layers/LayersTypes.h";
using mozilla::wr::BuiltDisplayListDescriptor from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::RenderReasons from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::IdNamespace from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::MaybeIdNamespace from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::ExternalImageKeyPair from "mozilla/webrender/WebRenderTypes.h";
[MoveOnly] using mozilla::layers::DisplayListData from "mozilla/layers/RenderRootTypes.h";
[MoveOnly] using mozilla::layers::MaybeTransactionData from "mozilla/layers/RenderRootTypes.h";
using mozilla::layers::FocusTarget from "mozilla/layers/FocusTarget.h";
using mozilla::layers::LayersObserverEpoch from "mozilla/layers/LayersTypes.h";
using mozilla::layers::TransactionId from "mozilla/layers/LayersTypes.h";
using mozilla::VsyncId from "mozilla/VsyncDispatcher.h";

namespace mozilla {
namespace layers {

[ManualDealloc, ParentImpl=virtual]
sync protocol PWebRenderBridge
{
  manager PCompositorBridge;

parent:
  sync EnsureConnected()
    returns (TextureFactoryIdentifier textureFactoryIdentifier, MaybeIdNamespace maybeIdNamespace, nsCString error);

  async NewCompositable(CompositableHandle handle, TextureInfo info);
  async ReleaseCompositable(CompositableHandle compositable);

  async DeleteCompositorAnimations(uint64_t[] aIds);
  async SetDisplayList(DisplayListData displayList,
                       OpDestroy[] toDestroy, uint64_t fwdTransactionId, TransactionId transactionId,
                       bool containsSVGGroup,
                       VsyncId vsyncId, TimeStamp vsyncStartTime,
                       TimeStamp refreshStartTime, TimeStamp txnStartTime, nsCString txnURL, TimeStamp fwdTime,
                       CompositionPayload[] payloads);
  async EmptyTransaction(FocusTarget focusTarget,
                         MaybeTransactionData transationData,
                         OpDestroy[] toDestroy, uint64_t fwdTransactionId, TransactionId transactionId,
                         VsyncId vsyncId, TimeStamp vsyncStartTime,
                         TimeStamp refreshStartTime, TimeStamp txnStartTime,
                         nsCString txnURL, TimeStamp fwdTime,
                         CompositionPayload[] payloads);
  async SetFocusTarget(FocusTarget focusTarget);
  async UpdateResources(IdNamespace aIdNamespace, OpUpdateResource[] aResourceUpdates,
                        RefCountedShmem[] aSmallShmems, Shmem[] aLargeShmems);
  async ParentCommands(IdNamespace aIdNamespace, WebRenderParentCommand[] commands);
  sync GetSnapshot(PTexture texture) returns (bool aNeedsYFlip);
  async SetLayersObserverEpoch(LayersObserverEpoch childEpoch);
  async ClearCachedResources();
  async ClearAnimationResources();
  async SetDefaultClearColor(uint32_t aColor);
  // Invalidate rendered frame
  async InvalidateRenderedFrame();
  // Schedule a composite if one isn't already scheduled.
  async ScheduleComposite(RenderReasons aReasons);
  // Save the frame capture to disk
  async Capture();

  // Start capturing each frame to disk. See
  // nsIDOMWindowUtils::wrStartCaptureSequence for documentation.
  async StartCaptureSequence(nsCString aPath, uint32_t aFlags);

  // Stop the captures started by StartCaptureSequence. See
  // nsIDOMWindowUtils::wrStopCaptureSequence for documentation.
  async StopCaptureSequence();

  // Replacement for PCompositorBridge::SyncWithCompositor, but for WR. We need
  // it on PWebRenderBridge because it associated with a particular top-level
  // window, and PCompositorBridge doesn't allow doing that in a secure manner.
  sync SyncWithCompositor();

  // Tell the compositor to notify APZ that a target scroll frame has been
  // confirmed for an input event.
  async SetConfirmedTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);

  // Testing APIs

  // Enter test mode, set the sample time to sampleTime, and resample
  // animations. sampleTime must not be null.
  sync SetTestSampleTime(TimeStamp sampleTime);
  // Leave test mode and resume normal compositing
  sync LeaveTestMode();

  // Returns the |OMTAValue| for the compositor animation with the given id.
  sync GetAnimationValue(uint64_t aCompositorAnimationsId) returns (OMTAValue value);

  // The next time the display list tree is composited, add this async scroll offset
  // in CSS pixels for the given ViewID.
  // Useful for testing rendering of async scrolling.
  sync SetAsyncScrollOffset(ViewID scrollId, float x, float y);

  // The next time the display list is composited, include this async zoom in
  // for the given ViewID.
  // Useful for testing rendering of async zooming.
  sync SetAsyncZoom(ViewID scrollId, float zoom);

  // Flush any pending APZ repaints to the main thread.
  async FlushApzRepaints();

  // Get a copy of the compositor-side APZ test data instance for this
  // layers id.
  sync GetAPZTestData() returns (APZTestData data);

  // Child requests frame uniformity measurements
  sync GetFrameUniformity() returns (FrameUniformityData data);


  async Shutdown();
  sync ShutdownSync();
child:
  async WrUpdated(IdNamespace aNewIdNamespace, TextureFactoryIdentifier textureFactoryIdentifier);
  async WrReleasedImages(ExternalImageKeyPair[] pairs);
  async __delete__();
};

} // layers
} // mozilla