2017-10-28 02:10:06 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2017-10-28 01:55:37 +03:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
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
|
|
|
|
|
|
|
#ifndef MOZILLA_LAYERS_EFFECTS_H
|
|
|
|
#define MOZILLA_LAYERS_EFFECTS_H
|
|
|
|
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed, etc
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/gfx/Matrix.h" // for Matrix4x4
|
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
|
|
|
#include "mozilla/gfx/Rect.h" // for Rect
|
2016-05-25 19:01:18 +03:00
|
|
|
#include "mozilla/gfx/Types.h" // for SamplingFilter, etc
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/layers/CompositorTypes.h" // for EffectTypes, etc
|
2013-11-18 01:47:40 +04:00
|
|
|
#include "mozilla/layers/LayersTypes.h"
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/layers/TextureHost.h" // for CompositingRenderTarget, etc
|
|
|
|
#include "mozilla/mozalloc.h" // for operator delete, etc
|
|
|
|
#include "nscore.h" // for nsACString
|
2014-04-26 06:34:06 +04:00
|
|
|
#include "mozilla/EnumeratedArray.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
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Effects and effect chains are used by the compositor API (see Compositor.h).
|
|
|
|
* An effect chain represents a rendering method, for example some shader and
|
|
|
|
* the data required for that shader to run. An effect is some component of the
|
|
|
|
* chain and its data.
|
|
|
|
*
|
|
|
|
* An effect chain consists of a primary effect - how the 'texture' memory should
|
|
|
|
* be interpreted (RGBA, BGRX, YCBCR, etc.) - and any number of secondary effects
|
|
|
|
* - any way in which rendering can be changed, e.g., applying a mask layer.
|
|
|
|
*
|
|
|
|
* During the rendering process, an effect chain is created by the layer being
|
|
|
|
* rendered and the primary effect is added by the compositable host. Secondary
|
|
|
|
* effects may be added by the layer or compositable. The effect chain is passed
|
|
|
|
* to the compositor by the compositable host as a parameter to DrawQuad.
|
|
|
|
*/
|
|
|
|
|
2017-01-19 23:16:30 +03:00
|
|
|
struct TexturedEffect;
|
|
|
|
|
2014-04-14 23:04:24 +04:00
|
|
|
struct Effect
|
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
|
|
|
NS_INLINE_DECL_REFCOUNTING(Effect)
|
|
|
|
|
2014-08-20 08:55:14 +04:00
|
|
|
explicit Effect(EffectTypes aType) : mType(aType) {}
|
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
|
|
|
|
|
|
|
EffectTypes mType;
|
|
|
|
|
2017-01-19 23:16:30 +03:00
|
|
|
virtual TexturedEffect* AsTexturedEffect() { return nullptr; }
|
2014-06-20 02:36:25 +04:00
|
|
|
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) = 0;
|
2014-04-14 23:04:24 +04:00
|
|
|
|
|
|
|
protected:
|
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 ~Effect() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
// Render from a texture
|
|
|
|
struct TexturedEffect : public Effect
|
|
|
|
{
|
|
|
|
TexturedEffect(EffectTypes aType,
|
|
|
|
TextureSource *aTexture,
|
|
|
|
bool aPremultiplied,
|
2016-05-25 19:01:18 +03:00
|
|
|
gfx::SamplingFilter aSamplingFilter)
|
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
|
|
|
: Effect(aType)
|
|
|
|
, mTextureCoords(0, 0, 1.0f, 1.0f)
|
|
|
|
, mTexture(aTexture)
|
|
|
|
, mPremultiplied(aPremultiplied)
|
2016-05-25 19:01:18 +03:00
|
|
|
, mSamplingFilter(aSamplingFilter)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
{}
|
|
|
|
|
2017-01-19 23:16:30 +03:00
|
|
|
virtual TexturedEffect* AsTexturedEffect() { return this; }
|
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 const char* Name() = 0;
|
2014-06-20 02:36:25 +04:00
|
|
|
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);
|
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 mTextureCoords;
|
|
|
|
TextureSource* mTexture;
|
|
|
|
bool mPremultiplied;
|
2016-05-25 19:01:18 +03:00
|
|
|
gfx::SamplingFilter mSamplingFilter;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
// Support an alpha mask.
|
|
|
|
struct EffectMask : public Effect
|
|
|
|
{
|
|
|
|
EffectMask(TextureSource *aMaskTexture,
|
|
|
|
gfx::IntSize aSize,
|
|
|
|
const gfx::Matrix4x4 &aMaskTransform)
|
2014-04-26 06:34:06 +04:00
|
|
|
: Effect(EffectTypes::MASK)
|
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
|
|
|
, mMaskTexture(aMaskTexture)
|
|
|
|
, mSize(aSize)
|
|
|
|
, mMaskTransform(aMaskTransform)
|
|
|
|
{}
|
|
|
|
|
2014-06-20 02:36:25 +04:00
|
|
|
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);
|
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
|
|
|
|
|
|
|
TextureSource* mMaskTexture;
|
|
|
|
gfx::IntSize mSize;
|
|
|
|
gfx::Matrix4x4 mMaskTransform;
|
|
|
|
};
|
|
|
|
|
2014-05-09 13:48:29 +04:00
|
|
|
struct EffectBlendMode : public Effect
|
|
|
|
{
|
2014-08-20 08:55:14 +04:00
|
|
|
explicit EffectBlendMode(gfx::CompositionOp aBlendMode)
|
2014-05-09 13:48:29 +04:00
|
|
|
: Effect(EffectTypes::BLEND_MODE)
|
|
|
|
, mBlendMode(aBlendMode)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
virtual const char* Name() { return "EffectBlendMode"; }
|
2014-06-20 02:36:25 +04:00
|
|
|
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);
|
2014-05-09 13:48:29 +04:00
|
|
|
|
|
|
|
gfx::CompositionOp mBlendMode;
|
|
|
|
};
|
|
|
|
|
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
|
|
|
// Render to a render target rather than the screen.
|
|
|
|
struct EffectRenderTarget : public TexturedEffect
|
|
|
|
{
|
2014-08-20 08:55:14 +04:00
|
|
|
explicit EffectRenderTarget(CompositingRenderTarget *aRenderTarget)
|
2016-05-25 19:01:18 +03:00
|
|
|
: TexturedEffect(EffectTypes::RENDER_TARGET, aRenderTarget, true,
|
|
|
|
gfx::SamplingFilter::LINEAR)
|
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
|
|
|
, mRenderTarget(aRenderTarget)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual const char* Name() { return "EffectRenderTarget"; }
|
2014-06-20 02:36:25 +04:00
|
|
|
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);
|
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-10-18 08:24:48 +03:00
|
|
|
RefPtr<CompositingRenderTarget> mRenderTarget;
|
2014-08-08 01:44:08 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
EffectRenderTarget(EffectTypes aType, CompositingRenderTarget *aRenderTarget)
|
2016-05-25 19:01:18 +03:00
|
|
|
: TexturedEffect(aType, aRenderTarget, true, gfx::SamplingFilter::LINEAR)
|
2014-08-08 01:44:08 +04:00
|
|
|
, mRenderTarget(aRenderTarget)
|
|
|
|
{}
|
|
|
|
|
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-08-08 01:44:08 +04:00
|
|
|
// Render to a render target rather than the screen.
|
|
|
|
struct EffectColorMatrix : public Effect
|
|
|
|
{
|
2014-09-01 07:31:20 +04:00
|
|
|
explicit EffectColorMatrix(gfx::Matrix5x4 aMatrix)
|
2014-08-08 01:44:08 +04:00
|
|
|
: Effect(EffectTypes::COLOR_MATRIX)
|
|
|
|
, mColorMatrix(aMatrix)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual const char* Name() { return "EffectColorMatrix"; }
|
|
|
|
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);
|
|
|
|
const gfx::Matrix5x4 mColorMatrix;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-11-08 10:22:05 +04:00
|
|
|
struct EffectRGB : public TexturedEffect
|
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-08 10:22:05 +04:00
|
|
|
EffectRGB(TextureSource *aTexture,
|
|
|
|
bool aPremultiplied,
|
2016-05-25 19:01:18 +03:00
|
|
|
gfx::SamplingFilter aSamplingFilter,
|
2013-11-08 10:22:05 +04:00
|
|
|
bool aFlipped = false)
|
2016-05-25 19:01:18 +03:00
|
|
|
: TexturedEffect(EffectTypes::RGB, aTexture, aPremultiplied, aSamplingFilter)
|
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-08 10:22:05 +04:00
|
|
|
virtual const char* Name() { return "EffectRGB"; }
|
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
|
|
|
};
|
|
|
|
|
|
|
|
struct EffectYCbCr : public TexturedEffect
|
|
|
|
{
|
2017-09-29 17:37:56 +03:00
|
|
|
EffectYCbCr(TextureSource *aSource, YUVColorSpace aYUVColorSpace, uint32_t aBitDepth, gfx::SamplingFilter aSamplingFilter)
|
2016-05-25 19:01:18 +03:00
|
|
|
: TexturedEffect(EffectTypes::YCBCR, aSource, false, aSamplingFilter)
|
2016-10-18 20:09:00 +03:00
|
|
|
, mYUVColorSpace(aYUVColorSpace)
|
2017-09-29 17:37:56 +03:00
|
|
|
, mBitDepth(aBitDepth)
|
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 const char* Name() { return "EffectYCbCr"; }
|
2016-10-18 20:09:00 +03:00
|
|
|
|
|
|
|
YUVColorSpace mYUVColorSpace;
|
2017-09-29 17:37:56 +03:00
|
|
|
uint32_t mBitDepth;
|
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-08-04 00:57:39 +03:00
|
|
|
struct EffectNV12 : public TexturedEffect
|
|
|
|
{
|
2016-05-25 19:01:18 +03:00
|
|
|
EffectNV12(TextureSource *aSource, gfx::SamplingFilter aSamplingFilter)
|
|
|
|
: TexturedEffect(EffectTypes::NV12, aSource, false, aSamplingFilter)
|
2015-08-04 00:57:39 +03:00
|
|
|
{}
|
|
|
|
|
|
|
|
virtual const char* Name() { return "EffectNV12"; }
|
|
|
|
};
|
|
|
|
|
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
|
|
|
struct EffectComponentAlpha : public TexturedEffect
|
|
|
|
{
|
2013-04-22 06:40:52 +04:00
|
|
|
EffectComponentAlpha(TextureSource *aOnBlack,
|
|
|
|
TextureSource *aOnWhite,
|
2016-05-25 19:01:18 +03:00
|
|
|
gfx::SamplingFilter aSamplingFilter)
|
|
|
|
: TexturedEffect(EffectTypes::COMPONENT_ALPHA, nullptr, false, aSamplingFilter)
|
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
|
|
|
, mOnBlack(aOnBlack)
|
2013-04-22 06:40:52 +04:00
|
|
|
, mOnWhite(aOnWhite)
|
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 const char* Name() { return "EffectComponentAlpha"; }
|
|
|
|
|
|
|
|
TextureSource* mOnBlack;
|
2013-04-22 06:40:52 +04:00
|
|
|
TextureSource* mOnWhite;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
struct EffectSolidColor : public Effect
|
|
|
|
{
|
2014-08-20 08:55:14 +04:00
|
|
|
explicit EffectSolidColor(const gfx::Color &aColor)
|
2014-04-26 06:34:06 +04:00
|
|
|
: Effect(EffectTypes::SOLID_COLOR)
|
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
|
|
|
, mColor(aColor)
|
|
|
|
{}
|
|
|
|
|
2014-06-20 02:36:25 +04:00
|
|
|
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);
|
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::Color mColor;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct EffectChain
|
|
|
|
{
|
2014-01-06 19:06:04 +04:00
|
|
|
EffectChain() : mLayerRef(nullptr) {}
|
2013-11-29 08:11:49 +04:00
|
|
|
explicit EffectChain(void* aLayerRef) : mLayerRef(aLayerRef) {}
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<Effect> mPrimaryEffect;
|
|
|
|
EnumeratedArray<EffectTypes, EffectTypes::MAX_SECONDARY, RefPtr<Effect>>
|
2014-04-26 06:34:06 +04:00
|
|
|
mSecondaryEffects;
|
2013-11-29 08:11:49 +04:00
|
|
|
void* mLayerRef; //!< For LayerScope logging
|
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-24 19:34:09 +04:00
|
|
|
/**
|
|
|
|
* Create a Textured effect corresponding to aFormat and using
|
|
|
|
* aSource as the (first) texture source.
|
|
|
|
*
|
|
|
|
* Note that aFormat can be different form aSource->GetFormat if, we are
|
|
|
|
* creating an effect that takes several texture sources (like with YCBCR
|
|
|
|
* where aFormat would be FOMRAT_YCBCR and each texture source would be
|
|
|
|
* a one-channel A8 texture)
|
|
|
|
*/
|
2015-06-17 17:00:52 +03:00
|
|
|
inline already_AddRefed<TexturedEffect>
|
2013-07-24 19:34:09 +04:00
|
|
|
CreateTexturedEffect(gfx::SurfaceFormat aFormat,
|
|
|
|
TextureSource* aSource,
|
2016-05-25 19:01:18 +03:00
|
|
|
const gfx::SamplingFilter aSamplingFilter,
|
2017-02-14 23:29:39 +03:00
|
|
|
bool isAlphaPremultiplied)
|
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-24 19:34:09 +04:00
|
|
|
MOZ_ASSERT(aSource);
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<TexturedEffect> result;
|
2013-07-24 19:34:09 +04:00
|
|
|
switch (aFormat) {
|
2014-01-10 23:06:16 +04:00
|
|
|
case gfx::SurfaceFormat::B8G8R8A8:
|
|
|
|
case gfx::SurfaceFormat::B8G8R8X8:
|
|
|
|
case gfx::SurfaceFormat::R8G8B8X8:
|
2015-10-23 09:01:31 +03:00
|
|
|
case gfx::SurfaceFormat::R5G6B5_UINT16:
|
2014-01-10 23:06:16 +04:00
|
|
|
case gfx::SurfaceFormat::R8G8B8A8:
|
2016-05-25 19:01:18 +03:00
|
|
|
result = new EffectRGB(aSource, isAlphaPremultiplied, aSamplingFilter);
|
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
|
|
|
break;
|
2015-08-04 00:57:39 +03:00
|
|
|
case gfx::SurfaceFormat::NV12:
|
2016-05-25 19:01:18 +03:00
|
|
|
result = new EffectNV12(aSource, aSamplingFilter);
|
2015-08-04 00:57:39 +03:00
|
|
|
break;
|
2016-10-18 20:09:00 +03:00
|
|
|
case gfx::SurfaceFormat::YUV:
|
|
|
|
MOZ_ASSERT_UNREACHABLE("gfx::SurfaceFormat::YUV is invalid");
|
|
|
|
break;
|
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
|
|
|
default:
|
2013-11-22 02:07:56 +04:00
|
|
|
NS_WARNING("unhandled program type");
|
|
|
|
break;
|
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-05-01 16:14:16 +03:00
|
|
|
return result.forget();
|
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-10-18 20:09:00 +03:00
|
|
|
inline already_AddRefed<TexturedEffect>
|
|
|
|
CreateTexturedEffect(TextureHost* aHost,
|
|
|
|
TextureSource* aSource,
|
|
|
|
const gfx::SamplingFilter aSamplingFilter,
|
2017-02-14 23:29:39 +03:00
|
|
|
bool isAlphaPremultiplied)
|
2016-10-18 20:09:00 +03:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(aHost);
|
|
|
|
MOZ_ASSERT(aSource);
|
|
|
|
|
|
|
|
RefPtr<TexturedEffect> result;
|
|
|
|
if (aHost->GetReadFormat() == gfx::SurfaceFormat::YUV) {
|
|
|
|
MOZ_ASSERT(aHost->GetYUVColorSpace() != YUVColorSpace::UNKNOWN);
|
2017-09-29 17:37:56 +03:00
|
|
|
result = new EffectYCbCr(
|
|
|
|
aSource, aHost->GetYUVColorSpace(), aHost->GetBitDepth(), aSamplingFilter);
|
2016-10-18 20:09:00 +03:00
|
|
|
} else {
|
|
|
|
result = CreateTexturedEffect(aHost->GetReadFormat(),
|
|
|
|
aSource,
|
|
|
|
aSamplingFilter,
|
2017-02-14 23:29:39 +03:00
|
|
|
isAlphaPremultiplied);
|
2016-10-18 20:09:00 +03:00
|
|
|
}
|
|
|
|
return result.forget();
|
|
|
|
}
|
|
|
|
|
2013-07-24 19:34:09 +04:00
|
|
|
/**
|
|
|
|
* Create a textured effect based on aSource format and the presence of
|
|
|
|
* aSourceOnWhite.
|
|
|
|
*
|
|
|
|
* aSourceOnWhite can be null.
|
|
|
|
*/
|
2015-06-17 17:00:52 +03:00
|
|
|
inline already_AddRefed<TexturedEffect>
|
2013-07-24 19:34:09 +04:00
|
|
|
CreateTexturedEffect(TextureSource* aSource,
|
|
|
|
TextureSource* aSourceOnWhite,
|
2016-05-25 19:01:18 +03:00
|
|
|
const gfx::SamplingFilter aSamplingFilter,
|
2017-02-14 23:29:39 +03:00
|
|
|
bool isAlphaPremultiplied)
|
2013-04-22 06:40:52 +04:00
|
|
|
{
|
2013-07-24 19:34:09 +04:00
|
|
|
MOZ_ASSERT(aSource);
|
|
|
|
if (aSourceOnWhite) {
|
2014-01-10 23:06:16 +04:00
|
|
|
MOZ_ASSERT(aSource->GetFormat() == gfx::SurfaceFormat::R8G8B8X8 ||
|
2015-05-22 14:38:13 +03:00
|
|
|
aSource->GetFormat() == gfx::SurfaceFormat::B8G8R8X8);
|
|
|
|
MOZ_ASSERT(aSource->GetFormat() == aSourceOnWhite->GetFormat());
|
2016-05-25 19:01:18 +03:00
|
|
|
return MakeAndAddRef<EffectComponentAlpha>(aSource, aSourceOnWhite,
|
|
|
|
aSamplingFilter);
|
2013-07-24 19:34:09 +04:00
|
|
|
}
|
|
|
|
|
2014-06-19 04:04:06 +04:00
|
|
|
return CreateTexturedEffect(aSource->GetFormat(),
|
|
|
|
aSource,
|
2016-05-25 19:01:18 +03:00
|
|
|
aSamplingFilter,
|
2017-02-14 23:29:39 +03:00
|
|
|
isAlphaPremultiplied);
|
2013-04-22 06:40:52 +04:00
|
|
|
}
|
|
|
|
|
2013-07-24 19:34:09 +04:00
|
|
|
/**
|
|
|
|
* Create a textured effect based on aSource format.
|
|
|
|
*
|
|
|
|
* This version excudes the possibility of component alpha.
|
|
|
|
*/
|
2015-06-17 17:00:52 +03:00
|
|
|
inline already_AddRefed<TexturedEffect>
|
2013-07-24 19:34:09 +04:00
|
|
|
CreateTexturedEffect(TextureSource *aTexture,
|
2017-02-14 23:29:39 +03:00
|
|
|
const gfx::SamplingFilter aSamplingFilter)
|
2013-07-24 19:34:09 +04:00
|
|
|
{
|
2017-02-14 23:29:39 +03:00
|
|
|
return CreateTexturedEffect(aTexture, nullptr, aSamplingFilter, true);
|
2013-07-24 19:34: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
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|