gfx/layers/ipc/PImageBridge.ipdl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/layers/ipc/PImageBridge.ipdl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,63 @@
     1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +include LayersSurfaces;
    1.10 +include LayersMessages;
    1.11 +include protocol PGrallocBuffer;
    1.12 +include protocol PCompositable;
    1.13 +include protocol PTexture;
    1.14 +include ProtocolTypes;
    1.15 +
    1.16 +include "mozilla/GfxMessageUtils.h";
    1.17 +
    1.18 +using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h";
    1.19 +
    1.20 +namespace mozilla {
    1.21 +namespace layers {
    1.22 +
    1.23 +/**
    1.24 + * The PImageBridge protocol is used to allow isolated threads or processes to push
    1.25 + * frames directly to the compositor thread/process without relying on the main thread
    1.26 + * which might be too busy dealing with content script.
    1.27 + */
    1.28 +intr protocol PImageBridge
    1.29 +{
    1.30 +  manages PCompositable;
    1.31 +  manages PGrallocBuffer;
    1.32 +  manages PTexture;
    1.33 +
    1.34 +parent:
    1.35 +
    1.36 +  sync Update(CompositableOperation[] ops) returns (EditReply[] reply);
    1.37 +  async UpdateNoSwap(CompositableOperation[] ops);
    1.38 +
    1.39 +  // Allocates a gralloc buffer that may not suitable to use with
    1.40 +  // gfxImageSurface but allows hardware decoder to write to the
    1.41 +  // buffer directly. The format is a enum defined in
    1.42 +  // system/graphics.h and the usage is the GraphicBuffer usage
    1.43 +  // flag. See GraphicBuffer.h and gralloc.h.
    1.44 +  sync PGrallocBuffer(IntSize size, uint32_t format, uint32_t usage)
    1.45 +    returns (MaybeMagicGrallocBufferHandle handle);
    1.46 +
    1.47 +  // First step of the destruction sequence. This puts ImageBridge
    1.48 +  // in a state in which it can't send asynchronous messages
    1.49 +  // so as to not race with the upcomming Stop message and destruction.
    1.50 +  // In the child side, the Stop message is not sent right after WillStop,
    1.51 +  // it is scheduled in the ImageBridgeChild's message queue in order to ensure
    1.52 +  // that all of the messages from the parent side have been received and processed
    1.53 +  // before sending Stop, and that after Stop returns, there is no message in
    1.54 +  // flight on any side and we can safely destroy the channel and threads.
    1.55 +  sync WillStop();
    1.56 +  // Second step
    1.57 +  sync Stop();
    1.58 +
    1.59 +  sync PCompositable(TextureInfo aInfo) returns (uint64_t id);
    1.60 +  async PTexture(SurfaceDescriptor aSharedData, uint32_t aTextureFlags);
    1.61 +};
    1.62 +
    1.63 +
    1.64 +} // namespace
    1.65 +} // namespace
    1.66 +

mercurial