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: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * vim: sw=2 ts=8 et : |
michael@0 | 3 | */ |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | include LayersSurfaces; |
michael@0 | 9 | include protocol PGrallocBuffer; |
michael@0 | 10 | include protocol PLayerTransaction; |
michael@0 | 11 | include "mozilla/GfxMessageUtils.h"; |
michael@0 | 12 | include "nsRegion.h"; |
michael@0 | 13 | |
michael@0 | 14 | using struct mozilla::null_t from "ipc/IPCMessageUtils.h"; |
michael@0 | 15 | using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h"; |
michael@0 | 16 | using struct mozilla::layers::FrameMetrics from "FrameMetrics.h"; |
michael@0 | 17 | using mozilla::layers::FrameMetrics::ViewID from "FrameMetrics.h"; |
michael@0 | 18 | using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h"; |
michael@0 | 19 | using mozilla::CrossProcessMutexHandle from "mozilla/ipc/CrossProcessMutex.h"; |
michael@0 | 20 | using mozilla::ipc::SharedMemoryBasic::Handle from "mozilla/ipc/SharedMemoryBasic.h"; |
michael@0 | 21 | using class mozilla::TimeStamp from "mozilla/TimeStamp.h"; |
michael@0 | 22 | |
michael@0 | 23 | namespace mozilla { |
michael@0 | 24 | namespace layers { |
michael@0 | 25 | |
michael@0 | 26 | |
michael@0 | 27 | /** |
michael@0 | 28 | * The PCompositor protocol is used to manage communication between |
michael@0 | 29 | * the main thread and the compositor thread context. It's primary |
michael@0 | 30 | * purpose is to manage the PLayerTransaction sub protocol. |
michael@0 | 31 | */ |
michael@0 | 32 | // This should really be 'sync', but we're using 'rpc' as a workaround |
michael@0 | 33 | // for Bug 716631. |
michael@0 | 34 | intr protocol PCompositor |
michael@0 | 35 | { |
michael@0 | 36 | // A Compositor manages a single Layer Manager (PLayerTransaction) |
michael@0 | 37 | manages PLayerTransaction; |
michael@0 | 38 | |
michael@0 | 39 | child: |
michael@0 | 40 | // The child should invalidate everything so that the whole window is redrawn. |
michael@0 | 41 | async InvalidateAll(); |
michael@0 | 42 | |
michael@0 | 43 | // The compositor completed a layers transaction. id is the layers id |
michael@0 | 44 | // of the child layer tree that was composited (or 0 when notifying |
michael@0 | 45 | // the root layer tree). |
michael@0 | 46 | async DidComposite(uint64_t id); |
michael@0 | 47 | |
michael@0 | 48 | parent: |
michael@0 | 49 | |
michael@0 | 50 | // The child is about to be destroyed, so perform any necessary cleanup. |
michael@0 | 51 | sync WillStop(); |
michael@0 | 52 | |
michael@0 | 53 | // Clean up in preparation for own destruction. |
michael@0 | 54 | sync Stop(); |
michael@0 | 55 | |
michael@0 | 56 | // Pause/resume the compositor. These are intended to be used on mobile, when |
michael@0 | 57 | // the compositor needs to pause/resume in lockstep with the application. |
michael@0 | 58 | sync Pause(); |
michael@0 | 59 | sync Resume(); |
michael@0 | 60 | |
michael@0 | 61 | async NotifyChildCreated(uint64_t id); |
michael@0 | 62 | |
michael@0 | 63 | // Make a snapshot of the content that would have been drawn to our |
michael@0 | 64 | // render target at the time this message is received. If the size |
michael@0 | 65 | // or format of |inSnapshot| doesn't match our render target, |
michael@0 | 66 | // results are undefined. |
michael@0 | 67 | // |
michael@0 | 68 | // NB: this message will result in animations, transforms, effects, |
michael@0 | 69 | // and so forth being interpolated. That's what we want to happen. |
michael@0 | 70 | sync MakeSnapshot(SurfaceDescriptor inSnapshot) |
michael@0 | 71 | returns (SurfaceDescriptor outSnapshot); |
michael@0 | 72 | |
michael@0 | 73 | // Make sure any pending composites are started immediately and |
michael@0 | 74 | // block until they are completed. |
michael@0 | 75 | sync FlushRendering(); |
michael@0 | 76 | |
michael@0 | 77 | sync StartFrameTimeRecording(int32_t bufferSize) |
michael@0 | 78 | returns (uint32_t startIndex); |
michael@0 | 79 | |
michael@0 | 80 | sync StopFrameTimeRecording(uint32_t startIndex) |
michael@0 | 81 | returns (float[] intervals); |
michael@0 | 82 | |
michael@0 | 83 | // layersBackendHints is an ordered list of preffered backends where |
michael@0 | 84 | // layersBackendHints[0] is the best backend. If any hints are LayersBackend::LAYERS_NONE |
michael@0 | 85 | // that hint is ignored. |
michael@0 | 86 | sync PLayerTransaction(LayersBackend[] layersBackendHints, uint64_t id) |
michael@0 | 87 | returns (TextureFactoryIdentifier textureFactoryIdentifier, bool success); |
michael@0 | 88 | |
michael@0 | 89 | // Notify the compositor that a region of the screen has been invalidated. |
michael@0 | 90 | async NotifyRegionInvalidated(nsIntRegion region); |
michael@0 | 91 | |
michael@0 | 92 | child: |
michael@0 | 93 | // Send back Compositor Frame Metrics from APZCs so tiled layers can |
michael@0 | 94 | // update progressively. |
michael@0 | 95 | async SharedCompositorFrameMetrics(Handle metrics, CrossProcessMutexHandle mutex, uint32_t aAPZCId); |
michael@0 | 96 | async ReleaseSharedCompositorFrameMetrics(ViewID aId, uint32_t aAPZCId); |
michael@0 | 97 | }; |
michael@0 | 98 | |
michael@0 | 99 | } // layers |
michael@0 | 100 | } // mozilla |