Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | include LayersSurfaces; |
michael@0 | 7 | include LayersMessages; |
michael@0 | 8 | include protocol PGrallocBuffer; |
michael@0 | 9 | include protocol PCompositable; |
michael@0 | 10 | include protocol PTexture; |
michael@0 | 11 | include ProtocolTypes; |
michael@0 | 12 | |
michael@0 | 13 | include "mozilla/GfxMessageUtils.h"; |
michael@0 | 14 | |
michael@0 | 15 | using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h"; |
michael@0 | 16 | |
michael@0 | 17 | namespace mozilla { |
michael@0 | 18 | namespace layers { |
michael@0 | 19 | |
michael@0 | 20 | /** |
michael@0 | 21 | * The PImageBridge protocol is used to allow isolated threads or processes to push |
michael@0 | 22 | * frames directly to the compositor thread/process without relying on the main thread |
michael@0 | 23 | * which might be too busy dealing with content script. |
michael@0 | 24 | */ |
michael@0 | 25 | intr protocol PImageBridge |
michael@0 | 26 | { |
michael@0 | 27 | manages PCompositable; |
michael@0 | 28 | manages PGrallocBuffer; |
michael@0 | 29 | manages PTexture; |
michael@0 | 30 | |
michael@0 | 31 | parent: |
michael@0 | 32 | |
michael@0 | 33 | sync Update(CompositableOperation[] ops) returns (EditReply[] reply); |
michael@0 | 34 | async UpdateNoSwap(CompositableOperation[] ops); |
michael@0 | 35 | |
michael@0 | 36 | // Allocates a gralloc buffer that may not suitable to use with |
michael@0 | 37 | // gfxImageSurface but allows hardware decoder to write to the |
michael@0 | 38 | // buffer directly. The format is a enum defined in |
michael@0 | 39 | // system/graphics.h and the usage is the GraphicBuffer usage |
michael@0 | 40 | // flag. See GraphicBuffer.h and gralloc.h. |
michael@0 | 41 | sync PGrallocBuffer(IntSize size, uint32_t format, uint32_t usage) |
michael@0 | 42 | returns (MaybeMagicGrallocBufferHandle handle); |
michael@0 | 43 | |
michael@0 | 44 | // First step of the destruction sequence. This puts ImageBridge |
michael@0 | 45 | // in a state in which it can't send asynchronous messages |
michael@0 | 46 | // so as to not race with the upcomming Stop message and destruction. |
michael@0 | 47 | // In the child side, the Stop message is not sent right after WillStop, |
michael@0 | 48 | // it is scheduled in the ImageBridgeChild's message queue in order to ensure |
michael@0 | 49 | // that all of the messages from the parent side have been received and processed |
michael@0 | 50 | // before sending Stop, and that after Stop returns, there is no message in |
michael@0 | 51 | // flight on any side and we can safely destroy the channel and threads. |
michael@0 | 52 | sync WillStop(); |
michael@0 | 53 | // Second step |
michael@0 | 54 | sync Stop(); |
michael@0 | 55 | |
michael@0 | 56 | sync PCompositable(TextureInfo aInfo) returns (uint64_t id); |
michael@0 | 57 | async PTexture(SurfaceDescriptor aSharedData, uint32_t aTextureFlags); |
michael@0 | 58 | }; |
michael@0 | 59 | |
michael@0 | 60 | |
michael@0 | 61 | } // namespace |
michael@0 | 62 | } // namespace |
michael@0 | 63 |