gfx/layers/ipc/PCompositor.ipdl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/layers/ipc/PCompositor.ipdl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,100 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * vim: sw=2 ts=8 et :
     1.6 + */
     1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +include LayersSurfaces;
    1.12 +include protocol PGrallocBuffer;
    1.13 +include protocol PLayerTransaction;
    1.14 +include "mozilla/GfxMessageUtils.h";
    1.15 +include "nsRegion.h";
    1.16 +
    1.17 +using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
    1.18 +using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
    1.19 +using struct mozilla::layers::FrameMetrics from "FrameMetrics.h";
    1.20 +using mozilla::layers::FrameMetrics::ViewID from "FrameMetrics.h";
    1.21 +using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h";
    1.22 +using mozilla::CrossProcessMutexHandle from "mozilla/ipc/CrossProcessMutex.h";
    1.23 +using mozilla::ipc::SharedMemoryBasic::Handle from "mozilla/ipc/SharedMemoryBasic.h";
    1.24 +using class mozilla::TimeStamp from "mozilla/TimeStamp.h";
    1.25 +
    1.26 +namespace mozilla {
    1.27 +namespace layers {
    1.28 +
    1.29 +
    1.30 +/**
    1.31 + * The PCompositor protocol is used to manage communication between
    1.32 + * the main thread and the compositor thread context. It's primary
    1.33 + * purpose is to manage the PLayerTransaction sub protocol.
    1.34 + */
    1.35 +// This should really be 'sync', but we're using 'rpc' as a workaround
    1.36 +// for Bug 716631.
    1.37 +intr protocol PCompositor
    1.38 +{
    1.39 +  // A Compositor manages a single Layer Manager (PLayerTransaction)
    1.40 +  manages PLayerTransaction;
    1.41 +
    1.42 +child:
    1.43 +  // The child should invalidate everything so that the whole window is redrawn.
    1.44 +  async InvalidateAll();
    1.45 +
    1.46 +  // The compositor completed a layers transaction. id is the layers id
    1.47 +  // of the child layer tree that was composited (or 0 when notifying
    1.48 +  // the root layer tree).
    1.49 +  async DidComposite(uint64_t id);
    1.50 +
    1.51 +parent:
    1.52 +
    1.53 +  // The child is about to be destroyed, so perform any necessary cleanup.
    1.54 +  sync WillStop();
    1.55 +
    1.56 +  // Clean up in preparation for own destruction.
    1.57 +  sync Stop();
    1.58 +
    1.59 +  // Pause/resume the compositor. These are intended to be used on mobile, when
    1.60 +  // the compositor needs to pause/resume in lockstep with the application.
    1.61 +  sync Pause();
    1.62 +  sync Resume();
    1.63 +
    1.64 +  async NotifyChildCreated(uint64_t id);
    1.65 +
    1.66 +  // Make a snapshot of the content that would have been drawn to our
    1.67 +  // render target at the time this message is received.  If the size
    1.68 +  // or format of |inSnapshot| doesn't match our render target,
    1.69 +  // results are undefined.
    1.70 +  //
    1.71 +  // NB: this message will result in animations, transforms, effects,
    1.72 +  // and so forth being interpolated.  That's what we want to happen.
    1.73 +  sync MakeSnapshot(SurfaceDescriptor inSnapshot)
    1.74 +    returns (SurfaceDescriptor outSnapshot);
    1.75 +
    1.76 +  // Make sure any pending composites are started immediately and
    1.77 +  // block until they are completed.
    1.78 +  sync FlushRendering();
    1.79 +
    1.80 +  sync StartFrameTimeRecording(int32_t bufferSize)
    1.81 +    returns (uint32_t startIndex);
    1.82 +
    1.83 +  sync StopFrameTimeRecording(uint32_t startIndex)
    1.84 +    returns (float[] intervals);
    1.85 +
    1.86 +  // layersBackendHints is an ordered list of preffered backends where
    1.87 +  // layersBackendHints[0] is the best backend. If any hints are LayersBackend::LAYERS_NONE
    1.88 +  // that hint is ignored.
    1.89 +  sync PLayerTransaction(LayersBackend[] layersBackendHints, uint64_t id)
    1.90 +    returns (TextureFactoryIdentifier textureFactoryIdentifier, bool success);
    1.91 +
    1.92 +  // Notify the compositor that a region of the screen has been invalidated.
    1.93 +  async NotifyRegionInvalidated(nsIntRegion region);
    1.94 +
    1.95 +child:
    1.96 +  // Send back Compositor Frame Metrics from APZCs so tiled layers can
    1.97 +  // update progressively.
    1.98 +  async SharedCompositorFrameMetrics(Handle metrics, CrossProcessMutexHandle mutex, uint32_t aAPZCId);
    1.99 +  async ReleaseSharedCompositorFrameMetrics(ViewID aId, uint32_t aAPZCId);
   1.100 +};
   1.101 +
   1.102 +} // layers
   1.103 +} // mozilla

mercurial