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 {
|
|
|
|
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:
|
2019-04-11 15:36:51 +03:00
|
|
|
virtual ~Effect() = default;
|
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 from a texture
|
|
|
|
struct TexturedEffect : public Effect {
|
|
|
|
TexturedEffect(EffectTypes aType, TextureSource* aTexture,
|
2016-05-25 19:01:18 +03:00
|
|
|
bool aPremultiplied, 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
|
|
|
|
2019-04-11 15:36:51 +03:00
|
|
|
TexturedEffect* AsTexturedEffect() override { 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;
|
2019-04-11 15:36:51 +03:00
|
|
|
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
|
|
|
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) {}
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2019-04-11 15:36:51 +03:00
|
|
|
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
|
|
|
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"; }
|
2019-04-11 15:36:51 +03:00
|
|
|
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
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) {}
|
|
|
|
|
2019-04-11 15:36:51 +03:00
|
|
|
const char* Name() override { return "EffectRenderTarget"; }
|
|
|
|
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
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) {}
|
|
|
|
|
2019-04-11 15:36:51 +03:00
|
|
|
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
2014-08-08 01:44:08 +04:00
|
|
|
const gfx::Matrix5x4 mColorMatrix;
|
|
|
|
};
|
|
|
|
|
2013-11-08 10:22:05 +04:00
|
|
|
struct EffectRGB : public TexturedEffect {
|
|
|
|
EffectRGB(TextureSource* aTexture, bool aPremultiplied,
|
2016-05-25 19:01:18 +03:00
|
|
|
gfx::SamplingFilter aSamplingFilter, bool aFlipped = false)
|
|
|
|
: 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
|
|
|
|
2019-04-11 15:36:51 +03:00
|
|
|
const char* Name() override { 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 {
|
2019-04-11 15:41:33 +03:00
|
|
|
EffectYCbCr(TextureSource* aSource, gfx::YUVColorSpace aYUVColorSpace,
|
2019-07-26 11:45:26 +03:00
|
|
|
gfx::ColorRange aColorRange, gfx::ColorDepth aColorDepth,
|
|
|
|
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),
|
2019-07-26 11:45:26 +03:00
|
|
|
mColorRange(aColorRange),
|
2018-09-25 23:44:55 +03:00
|
|
|
mColorDepth(aColorDepth) {}
|
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
|
|
|
|
2019-04-11 15:36:51 +03:00
|
|
|
const char* Name() override { return "EffectYCbCr"; }
|
2016-10-18 20:09:00 +03:00
|
|
|
|
2019-04-11 15:41:33 +03:00
|
|
|
gfx::YUVColorSpace mYUVColorSpace;
|
2019-07-26 11:45:26 +03:00
|
|
|
gfx::ColorRange mColorRange;
|
2018-09-25 23:44:55 +03:00
|
|
|
gfx::ColorDepth mColorDepth;
|
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
|
|
|
};
|
|
|
|
|
2019-04-11 15:36:19 +03:00
|
|
|
struct EffectNV12 : public EffectYCbCr {
|
|
|
|
EffectNV12(TextureSource* aSource, gfx::YUVColorSpace aYUVColorSpace,
|
2019-07-26 11:45:26 +03:00
|
|
|
gfx::ColorRange aColorRange, gfx::ColorDepth aColorDepth,
|
|
|
|
gfx::SamplingFilter aSamplingFilter)
|
|
|
|
: EffectYCbCr(aSource, aYUVColorSpace, aColorRange, aColorDepth,
|
|
|
|
aSamplingFilter) {
|
2019-04-11 15:36:19 +03:00
|
|
|
mType = EffectTypes::NV12;
|
|
|
|
}
|
2015-08-04 00:57:39 +03:00
|
|
|
|
2019-04-11 15:36:51 +03:00
|
|
|
const char* Name() override { return "EffectNV12"; }
|
2015-08-04 00:57:39 +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
|
|
|
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
|
|
|
|
2019-04-11 15:36:51 +03:00
|
|
|
const char* Name() override { return "EffectComponentAlpha"; }
|
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* 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), mColor(aColor) {}
|
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
|
|
|
|
2019-04-11 15:36:51 +03:00
|
|
|
void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
|
|
|
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
|
2019-04-11 15:36:19 +03:00
|
|
|
* where aFormat would be FORMAT_YCBCR and each texture source would be
|
2013-07-24 19:34:09 +04:00
|
|
|
* a one-channel A8 texture)
|
|
|
|
*/
|
2015-06-17 17:00:52 +03:00
|
|
|
inline already_AddRefed<TexturedEffect> CreateTexturedEffect(
|
2013-07-24 19:34:09 +04:00
|
|
|
gfx::SurfaceFormat aFormat, TextureSource* aSource,
|
2016-05-25 19:01:18 +03:00
|
|
|
const gfx::SamplingFilter aSamplingFilter, bool isAlphaPremultiplied) {
|
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;
|
2019-04-11 15:36:19 +03:00
|
|
|
case gfx::SurfaceFormat::YUV:
|
2015-08-04 00:57:39 +03:00
|
|
|
case gfx::SurfaceFormat::NV12:
|
2018-10-11 01:21:53 +03:00
|
|
|
case gfx::SurfaceFormat::P010:
|
|
|
|
case gfx::SurfaceFormat::P016:
|
2019-04-11 15:36:19 +03:00
|
|
|
MOZ_ASSERT_UNREACHABLE(
|
|
|
|
"gfx::SurfaceFormat::YUV/NV12/P010/P016 is invalid");
|
2016-10-18 20:09:00 +03:00
|
|
|
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, bool isAlphaPremultiplied) {
|
|
|
|
MOZ_ASSERT(aHost);
|
|
|
|
MOZ_ASSERT(aSource);
|
|
|
|
|
|
|
|
RefPtr<TexturedEffect> result;
|
2019-04-11 15:36:19 +03:00
|
|
|
|
|
|
|
switch (aHost->GetReadFormat()) {
|
|
|
|
case gfx::SurfaceFormat::YUV:
|
|
|
|
MOZ_ASSERT(aHost->GetYUVColorSpace() != gfx::YUVColorSpace::UNKNOWN);
|
|
|
|
result = new EffectYCbCr(aSource, aHost->GetYUVColorSpace(),
|
2019-07-26 11:45:26 +03:00
|
|
|
aHost->GetColorRange(), aHost->GetColorDepth(),
|
|
|
|
aSamplingFilter);
|
2019-04-11 15:36:19 +03:00
|
|
|
break;
|
|
|
|
case gfx::SurfaceFormat::NV12:
|
|
|
|
case gfx::SurfaceFormat::P010:
|
|
|
|
case gfx::SurfaceFormat::P016:
|
|
|
|
result = new EffectNV12(aSource, aHost->GetYUVColorSpace(),
|
2019-07-26 11:45:26 +03:00
|
|
|
aHost->GetColorRange(), aHost->GetColorDepth(),
|
|
|
|
aSamplingFilter);
|
2019-04-11 15:36:19 +03:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
result = CreateTexturedEffect(aHost->GetReadFormat(), aSource,
|
|
|
|
aSamplingFilter, isAlphaPremultiplied);
|
|
|
|
break;
|
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> CreateTexturedEffect(
|
2013-07-24 19:34:09 +04:00
|
|
|
TextureSource* aSource, TextureSource* aSourceOnWhite,
|
2016-05-25 19:01:18 +03:00
|
|
|
const gfx::SamplingFilter aSamplingFilter, bool isAlphaPremultiplied) {
|
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, 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> CreateTexturedEffect(
|
2017-02-14 23:29:39 +03:00
|
|
|
TextureSource* aTexture, const gfx::SamplingFilter aSamplingFilter) {
|
|
|
|
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
|