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
|
|
|
/* -*- 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_COMPOSITOR_H
|
|
|
|
#define MOZILLA_GFX_COMPOSITOR_H
|
|
|
|
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "Units.h" // for ScreenPoint
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h" // for already_AddRefed, RefCounted
|
2016-03-14 18:39:12 +03:00
|
|
|
#include "mozilla/gfx/2D.h" // for DrawTarget
|
2015-12-03 02:52:00 +03:00
|
|
|
#include "mozilla/gfx/MatrixFwd.h" // for Matrix4x4
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize, Point
|
|
|
|
#include "mozilla/gfx/Rect.h" // for Rect, IntRect
|
|
|
|
#include "mozilla/gfx/Types.h" // for Float
|
|
|
|
#include "mozilla/layers/CompositorTypes.h" // for DiagnosticTypes, etc
|
2014-10-07 02:45:03 +04:00
|
|
|
#include "mozilla/layers/FenceUtils.h" // for FenceHandle
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/layers/LayersTypes.h" // for LayersBackend
|
2014-02-27 01:36:35 +04:00
|
|
|
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
|
2013-11-21 23:25:16 +04:00
|
|
|
#include "nsRegion.h"
|
2013-12-02 00:54:46 +04:00
|
|
|
#include <vector>
|
2014-03-12 02:19:01 +04:00
|
|
|
#include "mozilla/WidgetUtils.h"
|
2016-04-30 02:23:17 +03:00
|
|
|
#include "CompositorWidgetProxy.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
|
|
|
|
|
|
|
/**
|
|
|
|
* Different elements of a web pages are rendered into separate "layers" before
|
|
|
|
* they are flattened into the final image that is brought to the screen.
|
|
|
|
* See Layers.h for more informations about layers and why we use retained
|
|
|
|
* structures.
|
|
|
|
* Most of the documentation for layers is directly in the source code in the
|
|
|
|
* form of doc comments. An overview can also be found in the the wiki:
|
|
|
|
* https://wiki.mozilla.org/Gecko:Overview#Graphics
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* # Main interfaces and abstractions
|
|
|
|
*
|
2013-04-26 02:25:33 +04:00
|
|
|
* - Layer, ShadowableLayer and LayerComposite
|
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 Layers.h and ipc/ShadowLayers.h)
|
|
|
|
* - CompositableClient and CompositableHost
|
|
|
|
* (client/CompositableClient.h composite/CompositableHost.h)
|
|
|
|
* - TextureClient and TextureHost
|
|
|
|
* (client/TextureClient.h composite/TextureHost.h)
|
|
|
|
* - TextureSource
|
|
|
|
* (composite/TextureHost.h)
|
|
|
|
* - Forwarders
|
|
|
|
* (ipc/CompositableForwarder.h ipc/ShadowLayers.h)
|
|
|
|
* - Compositor
|
|
|
|
* (this file)
|
|
|
|
* - IPDL protocols
|
|
|
|
* (.ipdl files under the gfx/layers/ipc directory)
|
|
|
|
*
|
|
|
|
* The *Client and Shadowable* classes are always used on the content thread.
|
|
|
|
* Forwarders are always used on the content thread.
|
|
|
|
* The *Host and Shadow* classes are always used on the compositor thread.
|
|
|
|
* Compositors, TextureSource, and Effects are always used on the compositor
|
|
|
|
* thread.
|
|
|
|
* Most enums and constants are declared in LayersTypes.h and CompositorTypes.h.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* # Texture transfer
|
|
|
|
*
|
|
|
|
* Most layer classes own a Compositable plus some extra information like
|
|
|
|
* transforms and clip rects. They are platform independent.
|
|
|
|
* Compositable classes manipulate Texture objects and are reponsible for
|
|
|
|
* things like tiling, buffer rotation or double buffering. Compositables
|
|
|
|
* are also platform-independent. Examples of compositable classes are:
|
|
|
|
* - ImageClient
|
|
|
|
* - CanvasClient
|
|
|
|
* - ContentHost
|
|
|
|
* - etc.
|
|
|
|
* Texture classes (TextureClient and TextureHost) are thin abstractions over
|
|
|
|
* platform-dependent texture memory. They are maniplulated by compositables
|
|
|
|
* and don't know about buffer rotations and such. The purposes of TextureClient
|
|
|
|
* and TextureHost are to synchronize, serialize and deserialize texture data.
|
|
|
|
* TextureHosts provide access to TextureSources that are views on the
|
|
|
|
* Texture data providing the necessary api for Compositor backend to composite
|
|
|
|
* them.
|
|
|
|
*
|
|
|
|
* Compositable and Texture clients and hosts are created using factory methods.
|
|
|
|
* They should only be created by using their constructor in exceptional
|
|
|
|
* circumstances. The factory methods are located:
|
|
|
|
* TextureClient - CompositableClient::CreateTextureClient
|
|
|
|
* TextureHost - TextureHost::CreateTextureHost, which calls a
|
|
|
|
* platform-specific function, e.g., CreateTextureHostOGL
|
|
|
|
* CompositableClient - in the appropriate subclass, e.g.,
|
|
|
|
* CanvasClient::CreateCanvasClient
|
|
|
|
* CompositableHost - CompositableHost::Create
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* # IPDL
|
|
|
|
*
|
|
|
|
* If off-main-thread compositing (OMTC) is enabled, compositing is performed
|
|
|
|
* in a dedicated thread. In some setups compositing happens in a dedicated
|
|
|
|
* process. Documentation may refer to either the compositor thread or the
|
|
|
|
* compositor process.
|
|
|
|
* See explanations in ShadowLayers.h.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* # Backend implementations
|
|
|
|
*
|
|
|
|
* Compositor backends like OpenGL or flavours of D3D live in their own directory
|
|
|
|
* under gfx/layers/. To add a new backend, implement at least the following
|
|
|
|
* interfaces:
|
|
|
|
* - Compositor (ex. CompositorOGL)
|
2014-09-17 17:13:29 +04:00
|
|
|
* - TextureHost (ex. SurfaceTextureHost)
|
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
|
|
|
* Depending on the type of data that needs to be serialized, you may need to
|
|
|
|
* add specific TextureClient implementations.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class nsIWidget;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
2014-01-16 11:22:19 +04:00
|
|
|
class Matrix;
|
2013-09-27 04:37:19 +04:00
|
|
|
class DrawTarget;
|
2016-02-25 16:15:52 +03:00
|
|
|
class DataSourceSurface;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gfx
|
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
|
|
|
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
struct Effect;
|
|
|
|
struct EffectChain;
|
|
|
|
class Image;
|
2016-01-19 07:52:32 +03:00
|
|
|
class ImageHostOverlay;
|
2014-03-18 05:36:56 +04:00
|
|
|
class Layer;
|
2014-10-07 17:58:59 +04:00
|
|
|
class TextureSource;
|
2013-07-30 13:59:51 +04:00
|
|
|
class DataTextureSource;
|
|
|
|
class CompositingRenderTarget;
|
2016-03-22 21:08:38 +03:00
|
|
|
class CompositorBridgeParent;
|
2013-11-22 02:07:56 +04:00
|
|
|
class LayerManagerComposite;
|
2016-04-14 13:38:38 +03:00
|
|
|
class CompositorOGL;
|
|
|
|
class CompositorD3D9;
|
|
|
|
class CompositorD3D11;
|
|
|
|
class BasicCompositor;
|
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
|
|
|
|
|
|
|
enum SurfaceInitMode
|
|
|
|
{
|
|
|
|
INIT_MODE_NONE,
|
2013-11-07 13:53:07 +04:00
|
|
|
INIT_MODE_CLEAR
|
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
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Common interface for compositor backends.
|
|
|
|
*
|
|
|
|
* Compositor provides a cross-platform interface to a set of operations for
|
|
|
|
* compositing quads. Compositor knows nothing about the layer tree. It must be
|
|
|
|
* told everything about each composited quad - contents, location, transform,
|
|
|
|
* opacity, etc.
|
|
|
|
*
|
|
|
|
* In theory it should be possible for different widgets to use the same
|
|
|
|
* compositor. In practice, we use one compositor per window.
|
|
|
|
*
|
|
|
|
* # Usage
|
|
|
|
*
|
|
|
|
* For an example of a user of Compositor, see LayerManagerComposite.
|
|
|
|
*
|
|
|
|
* Initialization: create a Compositor object, call Initialize().
|
|
|
|
*
|
|
|
|
* Destruction: destroy any resources associated with the compositor, call
|
|
|
|
* Destroy(), delete the Compositor object.
|
|
|
|
*
|
|
|
|
* Composition:
|
|
|
|
* call BeginFrame,
|
|
|
|
* for each quad to be composited:
|
|
|
|
* call MakeCurrent if necessary (not necessary if no other context has been
|
|
|
|
* made current),
|
|
|
|
* take care of any texture upload required to composite the quad, this step
|
|
|
|
* is backend-dependent,
|
|
|
|
* construct an EffectChain for the quad,
|
|
|
|
* call DrawQuad,
|
|
|
|
* call EndFrame.
|
|
|
|
* If the compositor is usually used for compositing but compositing is
|
|
|
|
* temporarily done without the compositor, call EndFrameForExternalComposition
|
|
|
|
* after compositing each frame so the compositor can remain internally
|
|
|
|
* consistent.
|
|
|
|
*
|
|
|
|
* By default, the compositor will render to the screen, to render to a target,
|
|
|
|
* call SetTargetContext or SetRenderTarget, the latter with a target created
|
|
|
|
* by CreateRenderTarget or CreateRenderTargetFromSource.
|
|
|
|
*
|
|
|
|
* The target and viewport methods can be called before any DrawQuad call and
|
|
|
|
* affect any subsequent DrawQuad calls.
|
|
|
|
*/
|
2014-04-14 23:04:24 +04:00
|
|
|
class Compositor
|
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-04-14 23:04:24 +04:00
|
|
|
protected:
|
2014-11-14 10:14:22 +03:00
|
|
|
virtual ~Compositor() {}
|
2014-04-14 23:04:24 +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
|
|
|
public:
|
2014-04-14 23:04:24 +04:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(Compositor)
|
|
|
|
|
2016-04-30 02:20:41 +03:00
|
|
|
explicit Compositor(widget::CompositorWidgetProxy* aWidget,
|
|
|
|
CompositorBridgeParent* aParent = nullptr)
|
2014-11-14 10:14:22 +03:00
|
|
|
: mCompositorID(0)
|
|
|
|
, mDiagnosticTypes(DiagnosticTypes::NO_DIAGNOSTIC)
|
|
|
|
, mParent(aParent)
|
|
|
|
, mScreenRotation(ROTATION_0)
|
2016-04-30 02:20:40 +03:00
|
|
|
, mWidget(aWidget)
|
2014-11-14 10:14:22 +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
|
|
|
|
2015-06-17 17:00:52 +03:00
|
|
|
virtual already_AddRefed<DataTextureSource> CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) = 0;
|
2016-02-25 16:15:52 +03:00
|
|
|
|
|
|
|
virtual already_AddRefed<DataTextureSource>
|
|
|
|
CreateDataTextureSourceAround(gfx::DataSourceSurface* aSurface) { return nullptr; }
|
|
|
|
|
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 Initialize() = 0;
|
|
|
|
virtual void Destroy() = 0;
|
2016-04-30 02:20:40 +03:00
|
|
|
|
|
|
|
virtual void DetachWidget() { mWidget = nullptr; }
|
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
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
/**
|
|
|
|
* Return true if the effect type is supported.
|
|
|
|
*
|
|
|
|
* By default Compositor implementations should support all effects but in
|
|
|
|
* some rare cases it is not possible to support an effect efficiently.
|
|
|
|
* This is the case for BasicCompositor with EffectYCbCr.
|
|
|
|
*/
|
|
|
|
virtual bool SupportsEffect(EffectTypes aEffect) { return true; }
|
|
|
|
|
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
|
|
|
/**
|
|
|
|
* Request a texture host identifier that may be used for creating textures
|
|
|
|
* across process or thread boundaries that are compatible with this
|
|
|
|
* compositor.
|
|
|
|
*/
|
|
|
|
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Properties of the compositor.
|
|
|
|
*/
|
2013-09-27 04:37:19 +04:00
|
|
|
virtual bool CanUseCanvasLayerForSize(const gfx::IntSize& aSize) = 0;
|
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 int32_t GetMaxTextureSize() const = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the target for rendering. Results will have been written to aTarget by
|
|
|
|
* the time that EndFrame returns.
|
|
|
|
*
|
|
|
|
* If this method is not used, or we pass in nullptr, we target the compositor's
|
|
|
|
* usual swap chain and render to the screen.
|
|
|
|
*/
|
2015-05-07 12:07:53 +03:00
|
|
|
void SetTargetContext(gfx::DrawTarget* aTarget, const gfx::IntRect& aRect)
|
2014-05-28 05:21:32 +04:00
|
|
|
{
|
|
|
|
mTarget = aTarget;
|
|
|
|
mTargetBounds = aRect;
|
|
|
|
}
|
2015-07-07 15:12:24 +03:00
|
|
|
gfx::DrawTarget* GetTargetContext() const
|
|
|
|
{
|
|
|
|
return mTarget;
|
|
|
|
}
|
2014-05-28 05:21:32 +04:00
|
|
|
void ClearTargetContext()
|
|
|
|
{
|
|
|
|
mTarget = nullptr;
|
|
|
|
}
|
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
|
|
|
|
|
|
|
typedef uint32_t MakeCurrentFlags;
|
|
|
|
static const MakeCurrentFlags ForceMakeCurrent = 0x1;
|
|
|
|
/**
|
|
|
|
* Make this compositor's rendering context the current context for the
|
|
|
|
* underlying graphics API. This may be a global operation, depending on the
|
|
|
|
* API. Our context will remain the current one until someone else changes it.
|
|
|
|
*
|
|
|
|
* Clients of the compositor should call this at the start of the compositing
|
|
|
|
* process, it might be required by texture uploads etc.
|
|
|
|
*
|
2013-07-09 08:21:06 +04:00
|
|
|
* If aFlags == ForceMakeCurrent then we will (re-)set our context on 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
|
|
|
* underlying API even if it is already the current context.
|
|
|
|
*/
|
|
|
|
virtual void MakeCurrent(MakeCurrentFlags aFlags = 0) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a Surface that can be used as a rendering target by this
|
|
|
|
* compositor.
|
|
|
|
*/
|
2015-06-17 17:00:52 +03:00
|
|
|
virtual already_AddRefed<CompositingRenderTarget>
|
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
|
|
|
CreateRenderTarget(const gfx::IntRect& aRect, SurfaceInitMode aInit) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a Surface that can be used as a rendering target by this
|
|
|
|
* compositor, and initializes the surface by copying from aSource.
|
|
|
|
* If aSource is null, then the current screen buffer is used as source.
|
2013-11-07 13:53:07 +04:00
|
|
|
*
|
|
|
|
* aSourcePoint specifies the point in aSource to copy data from.
|
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
|
|
|
*/
|
2015-06-17 17:00:52 +03:00
|
|
|
virtual already_AddRefed<CompositingRenderTarget>
|
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
|
|
|
CreateRenderTargetFromSource(const gfx::IntRect& aRect,
|
2013-11-07 13:53:07 +04:00
|
|
|
const CompositingRenderTarget* aSource,
|
|
|
|
const gfx::IntPoint& aSourcePoint) = 0;
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the given surface as the target for subsequent calls to DrawQuad.
|
|
|
|
* Passing null as aSurface sets the screen as the target.
|
|
|
|
*/
|
|
|
|
virtual void SetRenderTarget(CompositingRenderTarget* aSurface) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the current target for rendering. Will return null if we are
|
|
|
|
* rendering to the screen.
|
|
|
|
*/
|
2014-04-02 11:27:42 +04:00
|
|
|
virtual CompositingRenderTarget* GetCurrentRenderTarget() const = 0;
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* Mostly the compositor will pull the size from a widget and this method will
|
|
|
|
* be ignored, but compositor implementations are free to use it if they like.
|
|
|
|
*/
|
|
|
|
virtual void SetDestinationSurfaceSize(const gfx::IntSize& aSize) = 0;
|
|
|
|
|
2013-04-25 21:47:08 +04:00
|
|
|
/**
|
|
|
|
* Declare an offset to use when rendering layers. This will be ignored when
|
|
|
|
* rendering to a target instead of the screen.
|
|
|
|
*/
|
2013-06-03 18:00:02 +04:00
|
|
|
virtual void SetScreenRenderOffset(const ScreenPoint& aOffset) = 0;
|
2013-04-25 21:47:08 +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
|
|
|
/**
|
2013-12-02 00:54:46 +04:00
|
|
|
* Tell the compositor to draw a quad. What to do draw and how it is
|
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
|
|
|
* drawn is specified by aEffectChain. aRect is the quad to draw, in user space.
|
2013-11-07 13:53:08 +04:00
|
|
|
* aTransform transforms from user space to screen space. If texture coords are
|
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
|
|
|
* required, these will be in the primary effect in the effect chain.
|
2014-12-18 03:28:45 +03:00
|
|
|
* aVisibleRect is used to determine which edges should be antialiased,
|
|
|
|
* without applying the effect to the inner edges of a tiled layer.
|
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 DrawQuad(const gfx::Rect& aRect, const gfx::Rect& aClipRect,
|
|
|
|
const EffectChain& aEffectChain,
|
2014-12-18 03:28:45 +03:00
|
|
|
gfx::Float aOpacity, const gfx::Matrix4x4& aTransform,
|
|
|
|
const gfx::Rect& aVisibleRect) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Overload of DrawQuad, with aVisibleRect defaulted to the value of aRect.
|
|
|
|
* Use this when you are drawing a single quad that is not part of a tiled
|
|
|
|
* layer.
|
|
|
|
*/
|
|
|
|
void DrawQuad(const gfx::Rect& aRect, const gfx::Rect& aClipRect,
|
|
|
|
const EffectChain& aEffectChain,
|
|
|
|
gfx::Float aOpacity, const gfx::Matrix4x4& aTransform) {
|
|
|
|
DrawQuad(aRect, aClipRect, aEffectChain, aOpacity, aTransform, aRect);
|
|
|
|
}
|
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
|
|
|
|
2015-07-23 18:29:22 +03:00
|
|
|
/**
|
|
|
|
* Draw an unfilled solid color rect. Typically used for debugging overlays.
|
|
|
|
*/
|
|
|
|
void SlowDrawRect(const gfx::Rect& aRect, const gfx::Color& color,
|
|
|
|
const gfx::Rect& aClipRect = gfx::Rect(),
|
|
|
|
const gfx::Matrix4x4& aTransform = gfx::Matrix4x4(),
|
|
|
|
int aStrokeWidth = 1);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draw a solid color filled rect. This is a simple DrawQuad helper.
|
|
|
|
*/
|
|
|
|
void FillRect(const gfx::Rect& aRect, const gfx::Color& color,
|
|
|
|
const gfx::Rect& aClipRect = gfx::Rect(),
|
|
|
|
const gfx::Matrix4x4& aTransform = gfx::Matrix4x4());
|
|
|
|
|
2014-01-18 06:55:30 +04:00
|
|
|
/*
|
2014-03-28 07:38:32 +04:00
|
|
|
* Clear aRect on current render target.
|
2014-01-18 06:55:30 +04:00
|
|
|
*/
|
2014-05-22 06:36:26 +04:00
|
|
|
virtual void ClearRect(const gfx::Rect& aRect) = 0;
|
2014-01-18 06:55:30 +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
|
|
|
/**
|
|
|
|
* Start a new frame.
|
2013-11-21 23:25:16 +04:00
|
|
|
*
|
|
|
|
* aInvalidRect is the invalid region of the screen; it can be ignored for
|
|
|
|
* compositors where the performance for compositing the entire window is
|
|
|
|
* sufficient.
|
|
|
|
*
|
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
|
|
|
* aClipRectIn is the clip rect for the window in window space (optional).
|
|
|
|
* aTransform is the transform from user space to window space.
|
|
|
|
* aRenderBounds bounding rect for rendering, in user space.
|
2013-11-21 23:25:16 +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
|
|
|
* If aClipRectIn is null, this method sets *aClipRectOut to the clip rect
|
|
|
|
* actually used for rendering (if aClipRectIn is non-null, we will use that
|
|
|
|
* for the clip rect).
|
2013-11-21 23:25:16 +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
|
|
|
* If aRenderBoundsOut is non-null, it will be set to the render bounds
|
2013-11-22 02:07:56 +04:00
|
|
|
* actually used by the compositor in window space. If aRenderBoundsOut
|
|
|
|
* is returned empty, composition should be aborted.
|
2016-02-25 22:38:05 +03:00
|
|
|
*
|
|
|
|
* If aOpaque is true, then all of aInvalidRegion will be drawn to with
|
|
|
|
* opaque content.
|
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
|
|
|
*/
|
2013-11-21 23:25:16 +04:00
|
|
|
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
|
|
|
|
const gfx::Rect* aClipRectIn,
|
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
|
|
|
const gfx::Rect& aRenderBounds,
|
2016-04-05 04:25:04 +03:00
|
|
|
const nsIntRegion& aOpaqueRegion,
|
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
|
|
|
gfx::Rect* aClipRectOut = nullptr,
|
|
|
|
gfx::Rect* aRenderBoundsOut = nullptr) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Flush the current frame to the screen and tidy up.
|
|
|
|
*/
|
|
|
|
virtual void EndFrame() = 0;
|
|
|
|
|
2015-10-27 08:43:07 +03:00
|
|
|
virtual void SetDispAcquireFence(Layer* aLayer, nsIWidget* aWidget);
|
2014-03-18 05:36:56 +04:00
|
|
|
|
2015-10-27 08:43:07 +03:00
|
|
|
virtual FenceHandle GetReleaseFence();
|
2014-10-07 02:45:03 +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
|
|
|
/**
|
|
|
|
* Post-rendering stuff if the rendering is done outside of this Compositor
|
|
|
|
* e.g., by Composer2D.
|
|
|
|
* aTransform is the transform from user space to window space.
|
|
|
|
*/
|
2014-01-16 11:22:19 +04:00
|
|
|
virtual void EndFrameForExternalComposition(const gfx::Matrix& aTransform) = 0;
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether textures created by this compositor can receive partial updates.
|
|
|
|
*/
|
|
|
|
virtual bool SupportsPartialTextureUpdate() = 0;
|
|
|
|
|
2013-08-03 02:50:17 +04:00
|
|
|
void SetDiagnosticTypes(DiagnosticTypes aDiagnostics)
|
2013-03-21 21:08:01 +04:00
|
|
|
{
|
2013-08-03 02:50:17 +04:00
|
|
|
mDiagnosticTypes = aDiagnostics;
|
2013-03-21 21:08:01 +04:00
|
|
|
}
|
|
|
|
|
2014-03-25 20:54:39 +04:00
|
|
|
DiagnosticTypes GetDiagnosticTypes() const
|
|
|
|
{
|
|
|
|
return mDiagnosticTypes;
|
|
|
|
}
|
|
|
|
|
2013-08-03 02:50:17 +04:00
|
|
|
void DrawDiagnostics(DiagnosticFlags aFlags,
|
2013-03-21 21:08:01 +04:00
|
|
|
const gfx::Rect& visibleRect,
|
|
|
|
const gfx::Rect& aClipRect,
|
2014-03-25 20:54:39 +04:00
|
|
|
const gfx::Matrix4x4& transform,
|
|
|
|
uint32_t aFlashCounter = DIAGNOSTIC_FLASH_COUNTER_MAX);
|
2013-03-21 21:08:01 +04:00
|
|
|
|
2013-10-24 18:35:29 +04:00
|
|
|
void DrawDiagnostics(DiagnosticFlags aFlags,
|
|
|
|
const nsIntRegion& visibleRegion,
|
|
|
|
const gfx::Rect& aClipRect,
|
2014-03-25 20:54:39 +04:00
|
|
|
const gfx::Matrix4x4& transform,
|
|
|
|
uint32_t aFlashCounter = DIAGNOSTIC_FLASH_COUNTER_MAX);
|
2013-03-21 21:08:01 +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
|
|
|
#ifdef MOZ_DUMP_PAINTING
|
|
|
|
virtual const char* Name() const = 0;
|
|
|
|
#endif // MOZ_DUMP_PAINTING
|
|
|
|
|
2014-02-18 04:30:05 +04:00
|
|
|
virtual LayersBackend GetBackendType() const = 0;
|
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
|
|
|
|
2016-04-14 13:38:38 +03:00
|
|
|
virtual CompositorOGL* AsCompositorOGL() { return nullptr; }
|
|
|
|
virtual CompositorD3D9* AsCompositorD3D9() { return nullptr; }
|
|
|
|
virtual CompositorD3D11* AsCompositorD3D11() { return nullptr; }
|
|
|
|
virtual BasicCompositor* AsBasicCompositor() { return nullptr; }
|
|
|
|
|
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
|
|
|
/**
|
|
|
|
* Each Compositor has a unique ID.
|
|
|
|
* This ID is used to keep references to each Compositor in a map accessed
|
|
|
|
* from the compositor thread only, so that async compositables can find
|
|
|
|
* the right compositor parent and schedule compositing even if the compositor
|
|
|
|
* changed.
|
|
|
|
*/
|
|
|
|
uint32_t GetCompositorID() const
|
|
|
|
{
|
|
|
|
return mCompositorID;
|
|
|
|
}
|
|
|
|
void SetCompositorID(uint32_t aID)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(mCompositorID == 0, "The compositor ID must be set only once.");
|
|
|
|
mCompositorID = aID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify the compositor that composition is being paused. This allows the
|
|
|
|
* compositor to temporarily release any resources.
|
|
|
|
* Between calling Pause and Resume, compositing may fail.
|
|
|
|
*/
|
|
|
|
virtual void Pause() {}
|
|
|
|
/**
|
|
|
|
* Notify the compositor that composition is being resumed. The compositor
|
|
|
|
* regain any resources it requires for compositing.
|
|
|
|
* Returns true if succeeded.
|
|
|
|
*/
|
|
|
|
virtual bool Resume() { return true; }
|
|
|
|
|
2013-11-22 02:07:57 +04:00
|
|
|
/**
|
|
|
|
* Call before rendering begins to ensure the compositor is ready to
|
|
|
|
* composite. Returns false if rendering should be aborted.
|
|
|
|
*/
|
|
|
|
virtual bool Ready() { return true; }
|
|
|
|
|
2016-02-24 06:50:09 +03:00
|
|
|
virtual void ForcePresent() { }
|
|
|
|
|
2016-04-30 02:20:41 +03:00
|
|
|
widget::CompositorWidgetProxy* GetWidget() const { return mWidget; }
|
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
|
|
|
|
2016-01-19 07:52:32 +03:00
|
|
|
virtual bool HasImageHostOverlays() { return false; }
|
|
|
|
|
|
|
|
virtual void AddImageHostOverlay(ImageHostOverlay* aOverlay) {}
|
|
|
|
|
|
|
|
virtual void RemoveImageHostOverlay(ImageHostOverlay* aOverlay) {}
|
|
|
|
|
2013-07-30 22:03:40 +04:00
|
|
|
/**
|
|
|
|
* Debug-build assertion that can be called to ensure code is running on the
|
|
|
|
* compositor thread.
|
|
|
|
*/
|
|
|
|
static void AssertOnCompositorThread();
|
|
|
|
|
2014-02-11 02:14:11 +04:00
|
|
|
size_t GetFillRatio() {
|
|
|
|
float fillRatio = 0;
|
|
|
|
if (mPixelsFilled > 0 && mPixelsPerFrame > 0) {
|
|
|
|
fillRatio = 100.0f * float(mPixelsFilled) / float(mPixelsPerFrame);
|
|
|
|
if (fillRatio > 999.0f) {
|
|
|
|
fillRatio = 999.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return fillRatio;
|
|
|
|
}
|
|
|
|
|
2014-03-12 02:19:01 +04:00
|
|
|
ScreenRotation GetScreenRotation() const {
|
|
|
|
return mScreenRotation;
|
|
|
|
}
|
|
|
|
void SetScreenRotation(ScreenRotation aRotation) {
|
|
|
|
mScreenRotation = aRotation;
|
|
|
|
}
|
|
|
|
|
2015-07-07 06:38:38 +03:00
|
|
|
TimeStamp GetCompositionTime() const {
|
|
|
|
return mCompositionTime;
|
|
|
|
}
|
|
|
|
void SetCompositionTime(TimeStamp aTimeStamp) {
|
|
|
|
mCompositionTime = aTimeStamp;
|
2015-08-01 05:02:51 +03:00
|
|
|
if (!mCompositionTime.IsNull() && !mCompositeUntilTime.IsNull() &&
|
|
|
|
mCompositionTime >= mCompositeUntilTime) {
|
|
|
|
mCompositeUntilTime = TimeStamp();
|
|
|
|
}
|
2015-03-19 09:58:16 +03:00
|
|
|
}
|
|
|
|
|
2015-08-01 05:02:51 +03:00
|
|
|
void CompositeUntil(TimeStamp aTimeStamp) {
|
|
|
|
if (mCompositeUntilTime.IsNull() ||
|
|
|
|
mCompositeUntilTime < aTimeStamp) {
|
|
|
|
mCompositeUntilTime = aTimeStamp;
|
2015-03-19 09:58:16 +03:00
|
|
|
}
|
|
|
|
}
|
2015-08-01 05:02:51 +03:00
|
|
|
TimeStamp GetCompositeUntilTime() const {
|
|
|
|
return mCompositeUntilTime;
|
2015-07-07 06:38:38 +03:00
|
|
|
}
|
|
|
|
|
2016-03-25 11:38:55 +03:00
|
|
|
// A stale Compositor has no CompositorBridgeParent; it will not process
|
|
|
|
// frames and should not be used.
|
|
|
|
void SetInvalid();
|
|
|
|
bool IsValid() const;
|
2016-05-04 03:37:34 +03:00
|
|
|
CompositorBridgeParent* GetCompositorBridgeParent() const {
|
|
|
|
return mParent;
|
|
|
|
}
|
2016-03-25 11:38:55 +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:
|
2013-10-24 18:35:29 +04:00
|
|
|
void DrawDiagnosticsInternal(DiagnosticFlags aFlags,
|
|
|
|
const gfx::Rect& aVisibleRect,
|
|
|
|
const gfx::Rect& aClipRect,
|
2014-03-25 20:54:39 +04:00
|
|
|
const gfx::Matrix4x4& transform,
|
|
|
|
uint32_t aFlashCounter);
|
2013-10-24 18:35:29 +04:00
|
|
|
|
|
|
|
bool ShouldDrawDiagnostics(DiagnosticFlags);
|
|
|
|
|
2016-01-19 09:28:08 +03:00
|
|
|
/**
|
|
|
|
* Given a layer rect, clip, and transform, compute the area of the backdrop that
|
|
|
|
* needs to be copied for mix-blending. The output transform translates from 0..1
|
|
|
|
* space into the backdrop rect space.
|
2016-02-02 03:28:00 +03:00
|
|
|
*
|
|
|
|
* The transformed layer quad is also optionally returned - this is the same as
|
|
|
|
* the result rect, before rounding.
|
2016-01-19 09:28:08 +03:00
|
|
|
*/
|
|
|
|
gfx::IntRect ComputeBackdropCopyRect(
|
|
|
|
const gfx::Rect& aRect,
|
|
|
|
const gfx::Rect& aClipRect,
|
2016-02-02 03:28:00 +03:00
|
|
|
const gfx::Matrix4x4& aTransform,
|
|
|
|
gfx::Matrix4x4* aOutTransform,
|
|
|
|
gfx::Rect* aOutLayerQuad = nullptr);
|
2016-01-19 09:28:08 +03:00
|
|
|
|
2015-07-07 06:38:38 +03:00
|
|
|
/**
|
|
|
|
* Render time for the current composition.
|
|
|
|
*/
|
|
|
|
TimeStamp mCompositionTime;
|
2015-03-19 09:58:16 +03:00
|
|
|
/**
|
|
|
|
* When nonnull, during rendering, some compositable indicated that it will
|
2015-08-01 05:02:51 +03:00
|
|
|
* change its rendering at this time. In order not to miss it, we composite
|
|
|
|
* on every vsync until this time occurs (this is the latest such time).
|
2015-03-19 09:58:16 +03:00
|
|
|
*/
|
2015-08-01 05:02:51 +03:00
|
|
|
TimeStamp mCompositeUntilTime;
|
2015-07-07 06:38:38 +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
|
|
|
uint32_t mCompositorID;
|
2013-08-03 02:50:17 +04:00
|
|
|
DiagnosticTypes mDiagnosticTypes;
|
2016-03-22 21:08:38 +03:00
|
|
|
CompositorBridgeParent* mParent;
|
2013-09-12 01:57:23 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* We keep track of the total number of pixels filled as we composite the
|
|
|
|
* current frame. This value is an approximation and is not accurate,
|
|
|
|
* especially in the presence of transforms.
|
|
|
|
*/
|
|
|
|
size_t mPixelsPerFrame;
|
|
|
|
size_t mPixelsFilled;
|
2014-02-13 20:53:50 +04:00
|
|
|
|
2014-03-12 02:19:01 +04:00
|
|
|
ScreenRotation mScreenRotation;
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<gfx::DrawTarget> mTarget;
|
2015-05-07 12:07:53 +03:00
|
|
|
gfx::IntRect mTargetBounds;
|
2014-05-28 05:21:32 +04:00
|
|
|
|
2016-04-30 02:20:41 +03:00
|
|
|
widget::CompositorWidgetProxy* mWidget;
|
2016-04-30 02:20:40 +03:00
|
|
|
|
2015-10-27 08:43:07 +03:00
|
|
|
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
|
|
|
|
FenceHandle mReleaseFenceHandle;
|
|
|
|
#endif
|
|
|
|
|
2014-02-13 20:53:50 +04:00
|
|
|
private:
|
|
|
|
static LayersBackend sBackend;
|
|
|
|
|
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-10-24 04:08:06 +04:00
|
|
|
// Returns the number of rects. (Up to 4)
|
|
|
|
typedef gfx::Rect decomposedRectArrayT[4];
|
|
|
|
size_t DecomposeIntoNoRepeatRects(const gfx::Rect& aRect,
|
|
|
|
const gfx::Rect& aTexCoordRect,
|
|
|
|
decomposedRectArrayT* aLayerRects,
|
|
|
|
decomposedRectArrayT* aTextureRects);
|
|
|
|
|
2016-01-19 09:24:19 +03:00
|
|
|
static inline bool
|
|
|
|
BlendOpIsMixBlendMode(gfx::CompositionOp aOp)
|
|
|
|
{
|
|
|
|
switch (aOp) {
|
|
|
|
case gfx::CompositionOp::OP_MULTIPLY:
|
|
|
|
case gfx::CompositionOp::OP_SCREEN:
|
|
|
|
case gfx::CompositionOp::OP_OVERLAY:
|
|
|
|
case gfx::CompositionOp::OP_DARKEN:
|
|
|
|
case gfx::CompositionOp::OP_LIGHTEN:
|
|
|
|
case gfx::CompositionOp::OP_COLOR_DODGE:
|
|
|
|
case gfx::CompositionOp::OP_COLOR_BURN:
|
|
|
|
case gfx::CompositionOp::OP_HARD_LIGHT:
|
|
|
|
case gfx::CompositionOp::OP_SOFT_LIGHT:
|
|
|
|
case gfx::CompositionOp::OP_DIFFERENCE:
|
|
|
|
case gfx::CompositionOp::OP_EXCLUSION:
|
|
|
|
case gfx::CompositionOp::OP_HUE:
|
|
|
|
case gfx::CompositionOp::OP_SATURATION:
|
|
|
|
case gfx::CompositionOp::OP_COLOR:
|
|
|
|
case gfx::CompositionOp::OP_LUMINOSITY:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* MOZILLA_GFX_COMPOSITOR_H */
|