2012-07-13 23:38:09 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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
|
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"
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "nsDebug.h" // for NS_RUNTIMEABORT
|
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;
|
2016-09-07 01:20:41 +03:00
|
|
|
class ImageContainerChild;
|
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.
|
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
|
|
|
* 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
|
2012-07-13 23:38:09 +04:00
|
|
|
* 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.
|
|
|
|
* instead the will be sent to the compositor during the next layer transaction
|
2012-07-13 23:38:09 +04:00
|
|
|
* (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:
|
|
|
|
* - (A) The ImageContainer uses ImageBridge. The image is already available to the
|
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
|
|
|
* compositor process because it has been sent with SetCurrentImage. Yet, the
|
|
|
|
* CompositableHost on the compositor side will needs the ID referring to the
|
2012-07-13 23:38:09 +04:00
|
|
|
* 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:
|
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 CompositableHost has an AsyncID, it looks up the ID in the
|
2012-07-13 23:38:09 +04:00
|
|
|
* global table to see if there is an image. If there is no image, nothing is rendered.
|
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) The CompositableHost has image data rather than an ID (meaning it is not
|
2012-07-13 23:38:09 +04:00
|
|
|
* using ImageBridge), then it just composites the image data normally.
|
|
|
|
*
|
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 composited
|
2012-07-13 23:38:09 +04:00
|
|
|
* 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;
|
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
|
|
|
*/
|
2016-07-20 10:17:28 +03:00
|
|
|
static void InitSameProcess();
|
2012-07-13 23:38:09 +04:00
|
|
|
|
2016-07-20 10:19:27 +03:00
|
|
|
static void InitWithGPUProcess(Endpoint<PImageBridgeChild>&& aEndpoint);
|
2016-07-20 10:18:30 +03:00
|
|
|
static bool InitForContent(Endpoint<PImageBridgeChild>&& aEndpoint);
|
2016-09-20 11:18:50 +03:00
|
|
|
static bool ReinitForContent(Endpoint<PImageBridgeChild>&& aEndpoint);
|
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(); }
|
|
|
|
|
2015-07-06 06:02:26 +03:00
|
|
|
PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo,
|
2017-01-04 18:19:30 +03:00
|
|
|
const uint64_t& aID) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
bool DeallocPCompositableChild(PCompositableChild* aActor) override;
|
2012-07-13 23:38:09 +04:00
|
|
|
|
2013-12-12 05:44:44 +04:00
|
|
|
virtual PTextureChild*
|
2016-06-15 14:28:10 +03:00
|
|
|
AllocPTextureChild(const SurfaceDescriptor& aSharedData, const LayersBackend& aLayersBackend, const TextureFlags& aFlags, const uint64_t& aSerial) override;
|
2013-12-12 05:44:44 +04:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
DeallocPTextureChild(PTextureChild* actor) override;
|
2013-12-12 05:44:44 +04:00
|
|
|
|
2015-07-05 21:56:04 +03:00
|
|
|
PMediaSystemResourceManagerChild*
|
|
|
|
AllocPMediaSystemResourceManagerChild() override;
|
|
|
|
bool
|
|
|
|
DeallocPMediaSystemResourceManagerChild(PMediaSystemResourceManagerChild* aActor) override;
|
|
|
|
|
2015-07-06 06:02:26 +03:00
|
|
|
virtual PImageContainerChild*
|
|
|
|
AllocPImageContainerChild() override;
|
|
|
|
virtual bool
|
|
|
|
DeallocPImageContainerChild(PImageContainerChild* actor) override;
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2015-03-21 19:28:04 +03:00
|
|
|
RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessageData>&& aMessages) override;
|
2014-05-06 05:56:40 +04:00
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
virtual mozilla::ipc::IPCResult
|
2015-07-06 06:02:26 +03:00
|
|
|
RecvDidComposite(InfallibleTArray<ImageCompositeNotification>&& aNotifications) override;
|
|
|
|
|
2016-09-07 01:20:41 +03:00
|
|
|
// Create an ImageClient from any thread.
|
|
|
|
RefPtr<ImageClient> CreateImageClient(
|
|
|
|
CompositableType aType,
|
|
|
|
ImageContainer* aImageContainer,
|
|
|
|
ImageContainerChild* aContainerChild);
|
|
|
|
|
|
|
|
// Create an ImageClient from the ImageBridge thread.
|
|
|
|
RefPtr<ImageClient> CreateImageClientNow(
|
|
|
|
CompositableType aType,
|
|
|
|
ImageContainer* aImageContainer,
|
|
|
|
ImageContainerChild* aContainerChild);
|
|
|
|
|
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 ReleaseImageContainer(RefPtr<ImageContainerChild> aChild);
|
|
|
|
void UpdateAsyncCanvasRenderer(AsyncCanvasRenderer* aClient);
|
|
|
|
void UpdateImageClient(RefPtr<ImageClient> aClient, RefPtr<ImageContainer> aContainer);
|
2013-10-02 07:05:35 +04:00
|
|
|
static void DispatchReleaseTextureClient(TextureClient* aClient);
|
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);
|
|
|
|
|
|
|
|
void CreateImageClientSync(
|
|
|
|
SynchronousTask* aTask,
|
|
|
|
RefPtr<ImageClient>* result,
|
|
|
|
CompositableType aType,
|
|
|
|
ImageContainer* aImageContainer,
|
|
|
|
ImageContainerChild* aContainerChild);
|
2013-09-12 18:50:28 +04:00
|
|
|
|
2016-09-14 02:30:56 +03:00
|
|
|
void ReleaseTextureClientNow(TextureClient* aClient);
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
*/
|
2015-07-03 13:37:03 +03:00
|
|
|
virtual void UseTextures(CompositableClient* aCompositable,
|
|
|
|
const nsTArray<TimedTextureClient>& aTextures) 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
|
|
|
|
2016-09-03 02:08:49 +03:00
|
|
|
void Destroy(CompositableChild* aCompositable) override;
|
|
|
|
|
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;
|
|
|
|
|
2016-01-07 13:17:40 +03:00
|
|
|
virtual bool DestroyInTransaction(PTextureChild* aTexture, bool synchronously) override;
|
|
|
|
virtual bool DestroyInTransaction(PCompositableChild* aCompositable, bool synchronously) override;
|
|
|
|
|
2014-02-11 00:52:35 +04:00
|
|
|
virtual void RemoveTextureFromCompositable(CompositableClient* aCompositable,
|
2015-03-21 19:28:04 +03:00
|
|
|
TextureClient* aTexture) 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
|
2013-04-17 01:36:06 +04:00
|
|
|
{
|
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(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;
|
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
|
|
|
|
2014-01-22 02:06:18 +04:00
|
|
|
virtual PTextureChild* CreateTexture(const SurfaceDescriptor& aSharedData,
|
2015-10-06 09:39:00 +03:00
|
|
|
LayersBackend aLayersBackend,
|
2016-06-15 14:28:10 +03:00
|
|
|
TextureFlags aFlags,
|
|
|
|
uint64_t aSerial) 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();
|
|
|
|
}
|
|
|
|
|
2016-11-01 19:10:42 +03:00
|
|
|
virtual void HandleFatalError(const char* aName, const char* aMsg) const override;
|
2016-10-04 11:31:27 +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:
|
|
|
|
ImageBridgeChild();
|
|
|
|
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;
|
|
|
|
|
2016-09-20 11:18:50 +03:00
|
|
|
static void ShutdownSingleton();
|
|
|
|
|
2016-07-20 10:18:30 +03:00
|
|
|
private:
|
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;
|
|
|
|
bool mCalledClose;
|
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.
|
|
|
|
*/
|
|
|
|
nsDataHashtable<nsUint64HashKey, RefPtr<TextureClient> > mTexturesWaitingRecycled;
|
2017-01-04 18:19:30 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Mapping from async compositable IDs to image containers.
|
|
|
|
*/
|
|
|
|
nsDataHashtable<nsUint64HashKey, RefPtr<ImageContainer>> mImageContainers;
|
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
|