tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PWebRenderBridge.ipdl (6402B)


      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 
      8 include LayersSurfaces;
      9 include LayersMessages;
     10 include "mozilla/GfxMessageUtils.h";
     11 include "mozilla/layers/WebRenderMessageUtils.h";
     12 
     13 include WebRenderMessages;
     14 include protocol PCompositorBridge;
     15 include protocol PTexture;
     16 
     17 using mozilla::layers::APZTestData from "mozilla/layers/APZTestData.h";
     18 using mozilla::layers::FrameUniformityData from "mozilla/layers/FrameUniformityData.h";
     19 using mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h";
     20 using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
     21 using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
     22 using mozilla::layers::CompositionPayload from "mozilla/layers/LayersTypes.h";
     23 using mozilla::layers::CompositableHandle from "mozilla/layers/LayersTypes.h";
     24 using mozilla::wr::BuiltDisplayListDescriptor from "mozilla/webrender/webrender_ffi.h";
     25 using mozilla::wr::RenderReasons from "mozilla/webrender/webrender_ffi.h";
     26 using mozilla::wr::IdNamespace from "mozilla/webrender/WebRenderTypes.h";
     27 using mozilla::wr::MaybeIdNamespace from "mozilla/webrender/WebRenderTypes.h";
     28 using mozilla::wr::ExternalImageKeyPair from "mozilla/webrender/WebRenderTypes.h";
     29 [MoveOnly] using mozilla::layers::DisplayListData from "mozilla/layers/RenderRootTypes.h";
     30 [MoveOnly] using mozilla::layers::MaybeTransactionData from "mozilla/layers/RenderRootTypes.h";
     31 using mozilla::layers::FocusTarget from "mozilla/layers/FocusTarget.h";
     32 using mozilla::layers::TransactionId from "mozilla/layers/LayersTypes.h";
     33 using mozilla::VsyncId from "mozilla/VsyncDispatcher.h";
     34 
     35 namespace mozilla {
     36 namespace layers {
     37 
     38 [ManualDealloc, ParentImpl=virtual]
     39 sync protocol PWebRenderBridge
     40 {
     41   manager PCompositorBridge;
     42 
     43 parent:
     44   sync EnsureConnected()
     45     returns (TextureFactoryIdentifier textureFactoryIdentifier, MaybeIdNamespace maybeIdNamespace, nsCString error);
     46 
     47   async NewCompositable(CompositableHandle handle, TextureInfo info);
     48   async ReleaseCompositable(CompositableHandle compositable);
     49 
     50   async DeleteCompositorAnimations(uint64_t[] aIds);
     51   async SetDisplayList(DisplayListData displayList,
     52                        OpDestroy[] toDestroy, uint64_t fwdTransactionId, TransactionId transactionId,
     53                        bool containsSVGGroup,
     54                        VsyncId vsyncId, TimeStamp vsyncStartTime,
     55                        TimeStamp refreshStartTime, TimeStamp txnStartTime, nsCString txnURL, TimeStamp fwdTime,
     56                        CompositionPayload[] payloads,
     57                        bool renderOffscreen);
     58   async EmptyTransaction(FocusTarget focusTarget,
     59                          MaybeTransactionData transationData,
     60                          OpDestroy[] toDestroy, uint64_t fwdTransactionId, TransactionId transactionId,
     61                          VsyncId vsyncId, TimeStamp vsyncStartTime,
     62                          TimeStamp refreshStartTime, TimeStamp txnStartTime,
     63                          nsCString txnURL, TimeStamp fwdTime,
     64                          CompositionPayload[] payloads);
     65   async SetFocusTarget(FocusTarget focusTarget);
     66   async UpdateResources(IdNamespace aIdNamespace, OpUpdateResource[] aResourceUpdates,
     67                         RefCountedShmem[] aSmallShmems, Shmem[] aLargeShmems);
     68   async ParentCommands(IdNamespace aIdNamespace, WebRenderParentCommand[] commands);
     69   sync GetSnapshot(PTexture texture) returns (bool aNeedsYFlip);
     70   async ClearCachedResources();
     71   async SetDefaultClearColor(uint32_t aColor);
     72   // Invalidate rendered frame
     73   async InvalidateRenderedFrame();
     74   // Schedule a composite if one isn't already scheduled.
     75   async ScheduleComposite(RenderReasons aReasons);
     76   // Save the frame capture to disk
     77   async Capture();
     78 
     79   // Start capturing each frame to disk. See
     80   // nsIDOMWindowUtils::wrStartCaptureSequence for documentation.
     81   async StartCaptureSequence(nsCString aPath, uint32_t aFlags);
     82 
     83   // Stop the captures started by StartCaptureSequence. See
     84   // nsIDOMWindowUtils::wrStopCaptureSequence for documentation.
     85   async StopCaptureSequence();
     86 
     87   // Replacement for PCompositorBridge::SyncWithCompositor, but for WR. We need
     88   // it on PWebRenderBridge because it associated with a particular top-level
     89   // window, and PCompositorBridge doesn't allow doing that in a secure manner.
     90   sync SyncWithCompositor();
     91 
     92   // Tell the compositor to notify APZ that a target scroll frame has been
     93   // confirmed for an input event.
     94   async SetConfirmedTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);
     95 
     96   // Testing APIs
     97 
     98   // Enter test mode, set the sample time to sampleTime, and resample
     99   // animations. sampleTime must not be null.
    100   sync SetTestSampleTime(TimeStamp sampleTime);
    101   // Leave test mode and resume normal compositing
    102   sync LeaveTestMode();
    103 
    104   // Returns the |OMTAValue| for the compositor animation with the given id.
    105   sync GetAnimationValue(uint64_t aCompositorAnimationsId) returns (OMTAValue value);
    106 
    107   // The next time the display list tree is composited, add this async scroll offset
    108   // in CSS pixels for the given ViewID.
    109   // Useful for testing rendering of async scrolling.
    110   sync SetAsyncScrollOffset(ViewID scrollId, float x, float y);
    111 
    112   // The next time the display list is composited, include this async zoom in
    113   // for the given ViewID.
    114   // Useful for testing rendering of async zooming.
    115   sync SetAsyncZoom(ViewID scrollId, float zoom);
    116 
    117   // Flush any pending APZ repaints to the main thread.
    118   async FlushApzRepaints();
    119 
    120   // Get a copy of the compositor-side APZ test data instance for this
    121   // layers id.
    122   sync GetAPZTestData() returns (APZTestData data);
    123 
    124   // Child requests frame uniformity measurements
    125   sync GetFrameUniformity() returns (FrameUniformityData data);
    126 
    127   // Focibly end the current wheel transaction in APZ.
    128   async EndWheelTransaction() returns (bool unused);
    129 
    130   async Shutdown();
    131   sync ShutdownSync();
    132 child:
    133   async WrUpdated(IdNamespace aNewIdNamespace, TextureFactoryIdentifier textureFactoryIdentifier);
    134   async WrReleasedImages(ExternalImageKeyPair[] pairs);
    135   async __delete__();
    136 };
    137 
    138 } // layers
    139 } // mozilla