2017-10-28 02:10:06 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2012-07-13 23:38:09 +04:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_GFX_IMAGEBRIDGECHILD_H
|
|
|
|
#define MOZILLA_GFX_IMAGEBRIDGECHILD_H
|
|
|
|
|
2013-08-12 03:17:23 +04:00
|
|
|
#include <stddef.h> // for size_t
|
|
|
|
#include <stdint.h> // for uint32_t, uint64_t
|
2018-07-12 06:12:50 +03:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
#include "mozilla/Attributes.h" // for override
|
2015-12-30 07:13:19 +03:00
|
|
|
#include "mozilla/Atomics.h"
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h" // for already_AddRefed
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc
|
2015-10-12 06:21:02 +03:00
|
|
|
#include "mozilla/layers/CanvasClient.h"
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
#include "mozilla/layers/CompositableForwarder.h"
|
2015-02-24 02:22:06 +03:00
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/layers/PImageBridgeChild.h"
|
2016-06-15 14:28:10 +03:00
|
|
|
#include "mozilla/Mutex.h"
|
2017-04-19 12:59:53 +03:00
|
|
|
#include "mozilla/webrender/WebRenderTypes.h"
|
2016-09-14 02:30:57 +03:00
|
|
|
#include "nsIObserver.h"
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "nsRegion.h" // for nsIntRegion
|
2015-04-21 18:04:57 +03:00
|
|
|
#include "mozilla/gfx/Rect.h"
|
2016-11-04 03:28:28 +03:00
|
|
|
#include "mozilla/ReentrantMonitor.h" // for ReentrantMonitor, etc
|
2014-07-04 22:04:12 +04:00
|
|
|
|
2013-08-12 03:17:23 +04:00
|
|
|
class MessageLoop;
|
2012-07-13 23:38:09 +04:00
|
|
|
|
|
|
|
namespace base {
|
|
|
|
class Thread;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace base
|
2012-07-13 23:38:09 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
2013-08-12 03:17:23 +04:00
|
|
|
namespace ipc {
|
|
|
|
class Shmem;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace ipc
|
2013-08-12 03:17:23 +04:00
|
|
|
|
2012-07-13 23:38:09 +04:00
|
|
|
namespace layers {
|
|
|
|
|
2015-10-12 06:21:02 +03:00
|
|
|
class AsyncCanvasRenderer;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
class ImageClient;
|
|
|
|
class ImageContainer;
|
2017-09-26 03:58:37 +03:00
|
|
|
class ImageContainerListener;
|
2012-07-13 23:38:09 +04:00
|
|
|
class ImageBridgeParent;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
class CompositableClient;
|
2014-06-19 04:57:51 +04:00
|
|
|
struct CompositableTransaction;
|
2012-07-13 23:38:09 +04:00
|
|
|
class Image;
|
2013-07-30 13:59:51 +04:00
|
|
|
class TextureClient;
|
2016-09-14 02:30:56 +03:00
|
|
|
class SynchronousTask;
|
|
|
|
struct AllocShmemParams;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
2012-07-13 23:38:09 +04:00
|
|
|
/**
|
|
|
|
* Returns true if the current thread is the ImageBrdigeChild's thread.
|
|
|
|
*
|
|
|
|
* Can be called from any thread.
|
|
|
|
*/
|
|
|
|
bool InImageBridgeChildThread();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The ImageBridge protocol is meant to allow ImageContainers to forward images
|
|
|
|
* directly to the compositor thread/process without using the main thread.
|
|
|
|
*
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
* ImageBridgeChild is a CompositableForwarder just like ShadowLayerForwarder.
|
|
|
|
* This means it also does transactions with the compositor thread/process,
|
|
|
|
* except that the transactions are restricted to operations on the
|
|
|
|
* Compositables and cannot contain messages affecting layers directly.
|
|
|
|
*
|
|
|
|
* ImageBridgeChild is also a ISurfaceAllocator. It can be used to allocate or
|
|
|
|
* deallocate data that is shared with the compositor. The main differerence
|
|
|
|
* with other ISurfaceAllocators is that some of its overriden methods can be
|
|
|
|
* invoked from any thread.
|
|
|
|
*
|
2012-07-13 23:38:09 +04:00
|
|
|
* There are three important phases in the ImageBridge protocol. These three
|
|
|
|
* steps can do different things depending if (A) the ImageContainer uses
|
|
|
|
* ImageBridge or (B) it does not use ImageBridge:
|
|
|
|
*
|
|
|
|
* - When an ImageContainer calls its method SetCurrentImage:
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
* - (A) The image is sent directly to the compositor process through the
|
2012-07-13 23:38:09 +04:00
|
|
|
* ImageBridge IPDL protocol.
|
2018-11-28 12:16:55 +03:00
|
|
|
* On the compositor side the image is stored in a global table that
|
|
|
|
* associates the image with an ID corresponding to the ImageContainer, and a
|
|
|
|
* composition is triggered.
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
* - (B) Since it does not have an ImageBridge, the image is not sent yet.
|
2018-11-28 12:16:55 +03:00
|
|
|
* instead the will be sent to the compositor during the next layer
|
|
|
|
* transaction (on the main thread).
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
*
|
2012-07-13 23:38:09 +04:00
|
|
|
* - During a Layer transaction:
|
2018-11-28 12:16:55 +03:00
|
|
|
* - (A) The ImageContainer uses ImageBridge. The image is already available
|
|
|
|
* to the compositor process because it has been sent with SetCurrentImage.
|
|
|
|
* Yet, the CompositableHost on the compositor side will needs the ID
|
|
|
|
* referring to the ImageContainer to access the Image. So during the Swap
|
|
|
|
* operation that happens in the transaction, we swap the container ID rather
|
|
|
|
* than the image data.
|
|
|
|
* - (B) Since the ImageContainer does not use ImageBridge, the image data is
|
|
|
|
* swaped.
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
*
|
2012-07-13 23:38:09 +04:00
|
|
|
* - During composition:
|
2018-07-17 00:19:09 +03:00
|
|
|
* - (A) The CompositableHost has an AsyncID, it looks up the ID in the
|
2018-11-28 12:16:55 +03:00
|
|
|
* global table to see if there is an image. If there is no image, nothing is
|
|
|
|
* rendered.
|
|
|
|
* - (B) The CompositableHost has image data rather than an ID (meaning it is
|
|
|
|
* not using ImageBridge), then it just composites the image data normally.
|
2012-07-13 23:38:09 +04:00
|
|
|
*
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
* This means that there might be a possibility for the ImageBridge to send the
|
|
|
|
* first frame before the first layer transaction that will pass the container
|
|
|
|
* ID to the CompositableHost happens. In this (unlikely) case the layer is not
|
2012-07-13 23:38:09 +04:00
|
|
|
* composited until the layer transaction happens. This means this scenario is
|
|
|
|
* not harmful.
|
|
|
|
*
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
* Since sending an image through imageBridge triggers compositing, the main
|
|
|
|
* thread is not used at all (except for the very first transaction that
|
|
|
|
* provides the CompositableHost with an AsyncID).
|
2012-07-13 23:38:09 +04:00
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
class ImageBridgeChild final : public PImageBridgeChild,
|
2015-03-27 21:52:19 +03:00
|
|
|
public CompositableForwarder,
|
2016-09-27 06:22:20 +03:00
|
|
|
public TextureForwarder {
|
2012-07-13 23:38:09 +04:00
|
|
|
friend class ImageContainer;
|
2016-09-14 02:30:57 +03:00
|
|
|
|
2014-05-15 02:40:15 +04:00
|
|
|
typedef InfallibleTArray<AsyncParentMessageData> AsyncParentMessageArray;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2012-07-13 23:38:09 +04:00
|
|
|
public:
|
2016-09-27 06:22:20 +03:00
|
|
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageBridgeChild, override);
|
2012-07-13 23:38:09 +04:00
|
|
|
|
2016-09-27 06:22:20 +03:00
|
|
|
TextureForwarder* GetTextureForwarder() override { return this; }
|
|
|
|
LayersIPCActor* GetLayersIPCActor() override { return this; }
|
2016-03-17 16:58:58 +03:00
|
|
|
|
2012-07-13 23:38:09 +04:00
|
|
|
/**
|
|
|
|
* Creates the image bridge with a dedicated thread for ImageBridgeChild.
|
|
|
|
*
|
|
|
|
* We may want to use a specifi thread in the future. In this case, use
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
* CreateWithThread instead.
|
2012-07-13 23:38:09 +04:00
|
|
|
*/
|
2017-04-14 11:06:09 +03:00
|
|
|
static void InitSameProcess(uint32_t aNamespace);
|
2012-07-13 23:38:09 +04:00
|
|
|
|
2017-04-14 11:06:09 +03:00
|
|
|
static void InitWithGPUProcess(Endpoint<PImageBridgeChild>&& aEndpoint,
|
|
|
|
uint32_t aNamespace);
|
|
|
|
static bool InitForContent(Endpoint<PImageBridgeChild>&& aEndpoint,
|
|
|
|
uint32_t aNamespace);
|
|
|
|
static bool ReinitForContent(Endpoint<PImageBridgeChild>&& aEndpoint,
|
|
|
|
uint32_t aNamespace);
|
2012-08-29 16:24:48 +04:00
|
|
|
|
2012-07-13 23:38:09 +04:00
|
|
|
/**
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
* Destroys the image bridge by calling DestroyBridge, and destroys the
|
2012-07-13 23:38:09 +04:00
|
|
|
* ImageBridge's thread.
|
|
|
|
*
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
* If you don't want to destroy the thread, call DestroyBridge directly
|
2012-07-13 23:38:09 +04:00
|
|
|
* instead.
|
|
|
|
*/
|
|
|
|
static void ShutDown();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* returns the singleton instance.
|
|
|
|
*
|
|
|
|
* can be called from any thread.
|
|
|
|
*/
|
2016-09-14 02:30:57 +03:00
|
|
|
static RefPtr<ImageBridgeChild> GetSingleton();
|
2012-07-13 23:38:09 +04:00
|
|
|
|
2013-06-24 09:28:22 +04:00
|
|
|
static void IdentifyCompositorTextureHost(
|
|
|
|
const TextureFactoryIdentifier& aIdentifier);
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
void BeginTransaction();
|
|
|
|
void EndTransaction();
|
|
|
|
|
2012-07-13 23:38:09 +04:00
|
|
|
/**
|
|
|
|
* Returns the ImageBridgeChild's thread.
|
|
|
|
*
|
|
|
|
* Can be called from any thread.
|
|
|
|
*/
|
|
|
|
base::Thread* GetThread() const;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
2012-07-13 23:38:09 +04:00
|
|
|
/**
|
|
|
|
* Returns the ImageBridgeChild's message loop.
|
|
|
|
*
|
|
|
|
* Can be called from any thread.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual MessageLoop* GetMessageLoop() const override;
|
2012-07-13 23:38:09 +04:00
|
|
|
|
2016-06-29 12:18:35 +03:00
|
|
|
virtual base::ProcessId GetParentPid() const override { return OtherPid(); }
|
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
PTextureChild* AllocPTextureChild(
|
2017-04-20 04:24:13 +03:00
|
|
|
const SurfaceDescriptor& aSharedData, const ReadLockDescriptor& aReadLock,
|
|
|
|
const LayersBackend& aLayersBackend, const TextureFlags& aFlags,
|
|
|
|
const uint64_t& aSerial,
|
2019-02-06 18:58:07 +03:00
|
|
|
const wr::MaybeExternalImageId& aExternalImageId);
|
2013-12-12 05:44:44 +04:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
bool DeallocPTextureChild(PTextureChild* actor);
|
2013-12-12 05:44:44 +04:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
PMediaSystemResourceManagerChild* AllocPMediaSystemResourceManagerChild();
|
2015-07-05 21:56:04 +03:00
|
|
|
bool DeallocPMediaSystemResourceManagerChild(
|
2019-02-06 18:58:07 +03:00
|
|
|
PMediaSystemResourceManagerChild* aActor);
|
2015-07-05 21:56:04 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvParentAsyncMessages(
|
|
|
|
InfallibleTArray<AsyncParentMessageData>&& aMessages);
|
2014-05-06 05:56:40 +04:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDidComposite(
|
|
|
|
InfallibleTArray<ImageCompositeNotification>&& aNotifications);
|
2015-07-06 06:02:26 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvReportFramesDropped(
|
|
|
|
const CompositableHandle& aHandle, const uint32_t& aFrames);
|
2018-07-17 00:19:09 +03:00
|
|
|
|
2016-09-07 01:20:41 +03:00
|
|
|
// Create an ImageClient from any thread.
|
|
|
|
RefPtr<ImageClient> CreateImageClient(CompositableType aType,
|
2017-01-04 18:19:30 +03:00
|
|
|
ImageContainer* aImageContainer);
|
2016-09-07 01:20:41 +03:00
|
|
|
|
|
|
|
// Create an ImageClient from the ImageBridge thread.
|
|
|
|
RefPtr<ImageClient> CreateImageClientNow(CompositableType aType,
|
2017-01-04 18:19:30 +03:00
|
|
|
ImageContainer* aImageContainer);
|
2016-09-07 01:20:41 +03:00
|
|
|
|
2015-10-12 06:21:02 +03:00
|
|
|
already_AddRefed<CanvasClient> CreateCanvasClient(
|
|
|
|
CanvasClient::CanvasClientType aType, TextureFlags aFlag);
|
2016-09-14 02:30:56 +03:00
|
|
|
void UpdateAsyncCanvasRenderer(AsyncCanvasRenderer* aClient);
|
2017-07-15 14:52:02 +03:00
|
|
|
void UpdateImageClient(RefPtr<ImageContainer> aContainer);
|
2015-10-12 06:21:02 +03:00
|
|
|
|
2013-09-12 18:50:28 +04:00
|
|
|
/**
|
|
|
|
* Flush all Images sent to CompositableHost.
|
|
|
|
*/
|
2016-09-14 02:30:56 +03:00
|
|
|
void FlushAllImages(ImageClient* aClient, ImageContainer* aContainer);
|
|
|
|
|
2016-10-03 11:20:27 +03:00
|
|
|
virtual bool IPCOpen() const override { return mCanSend; }
|
|
|
|
|
2016-09-14 02:30:56 +03:00
|
|
|
private:
|
2016-09-27 06:22:20 +03:00
|
|
|
/**
|
|
|
|
* This must be called by the static function DeleteImageBridgeSync defined
|
|
|
|
* in ImageBridgeChild.cpp ONLY.
|
|
|
|
*/
|
|
|
|
~ImageBridgeChild();
|
|
|
|
|
2016-09-14 02:30:56 +03:00
|
|
|
// Helpers for dispatching.
|
|
|
|
already_AddRefed<CanvasClient> CreateCanvasClientNow(
|
|
|
|
CanvasClient::CanvasClientType aType, TextureFlags aFlags);
|
|
|
|
void CreateCanvasClientSync(SynchronousTask* aTask,
|
|
|
|
CanvasClient::CanvasClientType aType,
|
|
|
|
TextureFlags aFlags,
|
|
|
|
RefPtr<CanvasClient>* const outResult);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-09-14 02:30:56 +03:00
|
|
|
void CreateImageClientSync(SynchronousTask* aTask,
|
|
|
|
RefPtr<ImageClient>* result,
|
|
|
|
CompositableType aType,
|
2017-01-04 18:19:30 +03:00
|
|
|
ImageContainer* aImageContainer);
|
2013-09-12 18:50:28 +04:00
|
|
|
|
2016-09-14 02:30:56 +03:00
|
|
|
void UpdateAsyncCanvasRendererNow(AsyncCanvasRenderer* aClient);
|
|
|
|
void UpdateAsyncCanvasRendererSync(SynchronousTask* aTask,
|
|
|
|
AsyncCanvasRenderer* aWrapper);
|
|
|
|
|
|
|
|
void FlushAllImagesSync(SynchronousTask* aTask, ImageClient* aClient,
|
2016-10-27 10:59:23 +03:00
|
|
|
ImageContainer* aContainer);
|
2016-09-14 02:30:56 +03:00
|
|
|
|
|
|
|
void ProxyAllocShmemNow(SynchronousTask* aTask, AllocShmemParams* aParams);
|
2016-11-04 03:28:28 +03:00
|
|
|
void ProxyDeallocShmemNow(SynchronousTask* aTask, Shmem* aShmem,
|
|
|
|
bool* aResult);
|
2016-09-14 02:30:56 +03:00
|
|
|
|
2017-09-22 02:21:09 +03:00
|
|
|
void UpdateTextureFactoryIdentifier(
|
|
|
|
const TextureFactoryIdentifier& aIdentifier);
|
|
|
|
|
2016-09-14 02:30:56 +03:00
|
|
|
public:
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
// CompositableForwarder
|
|
|
|
|
2015-07-06 06:02:26 +03:00
|
|
|
virtual void Connect(CompositableClient* aCompositable,
|
|
|
|
ImageContainer* aImageContainer) override;
|
2012-07-13 23:38:09 +04:00
|
|
|
|
2016-03-17 16:58:58 +03:00
|
|
|
virtual bool UsesImageBridge() const override { return true; }
|
2014-05-12 18:39:25 +04:00
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
/**
|
2015-07-03 13:37:03 +03:00
|
|
|
* See CompositableForwarder::UseTextures
|
2013-07-30 13:59:51 +04:00
|
|
|
*/
|
2019-03-22 21:28:42 +03:00
|
|
|
virtual void UseTextures(CompositableClient* aCompositable,
|
|
|
|
const nsTArray<TimedTextureClient>& aTextures,
|
|
|
|
const Maybe<wr::RenderRoot>& aRenderRoot) override;
|
2014-02-06 15:28:29 +04:00
|
|
|
virtual void UseComponentAlphaTextures(
|
|
|
|
CompositableClient* aCompositable, TextureClient* aClientOnBlack,
|
2015-03-21 19:28:04 +03:00
|
|
|
TextureClient* aClientOnWhite) override;
|
2013-07-30 13:59:51 +04:00
|
|
|
|
2017-01-18 05:47:06 +03:00
|
|
|
void ReleaseCompositable(const CompositableHandle& aHandle) override;
|
2016-09-03 02:08:49 +03:00
|
|
|
|
2017-01-18 05:47:05 +03:00
|
|
|
void ForgetImageContainer(const CompositableHandle& aHandle);
|
2017-01-04 18:19:31 +03:00
|
|
|
|
2016-06-15 14:28:10 +03:00
|
|
|
/**
|
|
|
|
* Hold TextureClient ref until end of usage on host side if
|
|
|
|
* TextureFlags::RECYCLE is set. Host side's usage is checked via
|
|
|
|
* CompositableRef.
|
|
|
|
*/
|
|
|
|
void HoldUntilCompositableRefReleasedIfNecessary(TextureClient* aClient);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify id of Texture When host side end its use. Transaction id is used to
|
|
|
|
* make sure if there is no newer usage.
|
|
|
|
*/
|
|
|
|
void NotifyNotUsed(uint64_t aTextureId, uint64_t aFwdTransactionId);
|
|
|
|
|
|
|
|
virtual void CancelWaitForRecycle(uint64_t aTextureId) override;
|
|
|
|
|
2017-02-16 01:28:24 +03:00
|
|
|
virtual bool DestroyInTransaction(PTextureChild* aTexture) override;
|
2017-01-18 05:47:06 +03:00
|
|
|
bool DestroyInTransaction(const CompositableHandle& aHandle);
|
2016-01-07 13:17:40 +03:00
|
|
|
|
2019-03-22 21:28:42 +03:00
|
|
|
virtual void RemoveTextureFromCompositable(
|
|
|
|
CompositableClient* aCompositable, TextureClient* aTexture,
|
|
|
|
const Maybe<wr::RenderRoot>& aRenderRoot) override;
|
2014-02-11 00:52:35 +04:00
|
|
|
|
2014-03-08 01:34:04 +04:00
|
|
|
virtual void UseTiledLayerBuffer(
|
|
|
|
CompositableClient* aCompositable,
|
2015-03-21 19:28:04 +03:00
|
|
|
const SurfaceDescriptorTiles& aTileLayerDescriptor) override {
|
2016-12-03 00:46:53 +03:00
|
|
|
MOZ_CRASH("should not be called");
|
2013-04-17 01:36:06 +04:00
|
|
|
}
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
virtual void UpdateTextureRegion(CompositableClient* aCompositable,
|
|
|
|
const ThebesBufferData& aThebesBufferData,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsIntRegion& aUpdatedRegion) override {
|
2016-12-03 00:46:53 +03:00
|
|
|
MOZ_CRASH("should not be called");
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// ISurfaceAllocator
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See ISurfaceAllocator.h
|
|
|
|
* Can be used from any thread.
|
|
|
|
* If used outside the ImageBridgeChild thread, it will proxy a synchronous
|
|
|
|
* call on the ImageBridgeChild thread.
|
|
|
|
*/
|
|
|
|
virtual bool AllocUnsafeShmem(
|
2016-03-17 16:58:58 +03:00
|
|
|
size_t aSize, mozilla::ipc::SharedMemory::SharedMemoryType aShmType,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::ipc::Shmem* aShmem) override;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
virtual bool AllocShmem(size_t aSize,
|
2016-03-17 16:58:58 +03:00
|
|
|
mozilla::ipc::SharedMemory::SharedMemoryType aShmType,
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::ipc::Shmem* aShmem) override;
|
2016-03-17 16:58:58 +03:00
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
/**
|
|
|
|
* See ISurfaceAllocator.h
|
|
|
|
* Can be used from any thread.
|
|
|
|
* If used outside the ImageBridgeChild thread, it will proxy a synchronous
|
|
|
|
* call on the ImageBridgeChild thread.
|
|
|
|
*/
|
2016-11-04 03:28:28 +03:00
|
|
|
virtual bool DeallocShmem(mozilla::ipc::Shmem& aShmem) override;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
2017-03-21 06:57:56 +03:00
|
|
|
virtual PTextureChild* CreateTexture(
|
|
|
|
const SurfaceDescriptor& aSharedData, const ReadLockDescriptor& aReadLock,
|
|
|
|
LayersBackend aLayersBackend, TextureFlags aFlags, uint64_t aSerial,
|
|
|
|
wr::MaybeExternalImageId& aExternalImageId,
|
|
|
|
nsIEventTarget* aTarget = nullptr) override;
|
2013-12-12 05:44:44 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsSameProcess() const override;
|
2014-02-25 17:12:49 +04:00
|
|
|
|
2016-06-15 14:28:10 +03:00
|
|
|
virtual void UpdateFwdTransactionId() override { ++mFwdTransactionId; }
|
|
|
|
virtual uint64_t GetFwdTransactionId() override { return mFwdTransactionId; }
|
2014-05-06 05:56:40 +04:00
|
|
|
|
2016-09-03 02:08:49 +03:00
|
|
|
bool InForwarderThread() override { return InImageBridgeChildThread(); }
|
|
|
|
|
2018-04-23 21:13:36 +03:00
|
|
|
virtual void HandleFatalError(const char* aMsg) const override;
|
2016-10-04 11:31:27 +03:00
|
|
|
|
2017-04-20 04:24:13 +03:00
|
|
|
virtual wr::MaybeExternalImageId GetNextExternalImageId() override;
|
2017-04-14 11:06:09 +03:00
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
protected:
|
2017-04-14 11:06:09 +03:00
|
|
|
explicit ImageBridgeChild(uint32_t aNamespace);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
bool DispatchAllocShmemInternal(size_t aSize,
|
|
|
|
SharedMemory::SharedMemoryType aType,
|
|
|
|
Shmem* aShmem, bool aUnsafe);
|
|
|
|
|
2016-07-20 10:18:30 +03:00
|
|
|
void Bind(Endpoint<PImageBridgeChild>&& aEndpoint);
|
2016-09-14 02:30:56 +03:00
|
|
|
void BindSameProcess(RefPtr<ImageBridgeParent> aParent);
|
|
|
|
|
|
|
|
void SendImageBridgeThreadId();
|
2016-07-20 10:18:30 +03:00
|
|
|
|
2016-09-14 02:30:57 +03:00
|
|
|
void WillShutdown();
|
2016-09-14 02:30:56 +03:00
|
|
|
void ShutdownStep1(SynchronousTask* aTask);
|
|
|
|
void ShutdownStep2(SynchronousTask* aTask);
|
2016-09-14 02:30:57 +03:00
|
|
|
void MarkShutDown();
|
|
|
|
|
2016-09-14 02:30:57 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
2016-09-14 02:30:57 +03:00
|
|
|
void DeallocPImageBridgeChild() override;
|
2016-09-14 02:30:57 +03:00
|
|
|
|
|
|
|
bool CanSend() const;
|
2017-01-18 05:47:07 +03:00
|
|
|
bool CanPostTask() const;
|
2016-09-14 02:30:57 +03:00
|
|
|
|
2016-09-20 11:18:50 +03:00
|
|
|
static void ShutdownSingleton();
|
|
|
|
|
2016-07-20 10:18:30 +03:00
|
|
|
private:
|
2017-04-14 11:06:09 +03:00
|
|
|
uint32_t mNamespace;
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
CompositableTransaction* mTxn;
|
2016-09-14 02:30:57 +03:00
|
|
|
|
|
|
|
bool mCanSend;
|
2017-01-18 05:47:07 +03:00
|
|
|
mozilla::Atomic<bool> mDestroyed;
|
2016-06-15 14:28:10 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Transaction id of CompositableForwarder.
|
|
|
|
* It is incrementaed by UpdateFwdTransactionId() in each BeginTransaction()
|
|
|
|
* call.
|
|
|
|
*/
|
|
|
|
uint64_t mFwdTransactionId;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hold TextureClients refs until end of their usages on host side.
|
|
|
|
* It defer calling of TextureClient recycle callback.
|
|
|
|
*/
|
2018-07-12 06:12:50 +03:00
|
|
|
std::unordered_map<uint64_t, RefPtr<TextureClient>> mTexturesWaitingRecycled;
|
2017-01-04 18:19:30 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Mapping from async compositable IDs to image containers.
|
|
|
|
*/
|
2017-01-04 18:19:31 +03:00
|
|
|
Mutex mContainerMapLock;
|
2018-07-12 06:12:50 +03:00
|
|
|
std::unordered_map<uint64_t, RefPtr<ImageContainerListener>>
|
|
|
|
mImageContainerListeners;
|
2018-07-17 00:19:09 +03:00
|
|
|
RefPtr<ImageContainerListener> FindListener(
|
|
|
|
const CompositableHandle& aHandle);
|
2018-06-13 15:28:44 +03:00
|
|
|
|
|
|
|
#if defined(XP_WIN)
|
|
|
|
/**
|
|
|
|
* Used for checking if D3D11Device is updated.
|
|
|
|
*/
|
|
|
|
RefPtr<ID3D11Device> mImageDevice;
|
|
|
|
#endif
|
2012-07-13 23:38:09 +04:00
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
2012-07-13 23:38:09 +04:00
|
|
|
|
|
|
|
#endif
|