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 02:20:52 -07: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_COMPOSITOROGL_H
|
|
|
|
#define MOZILLA_GFX_COMPOSITOROGL_H
|
|
|
|
|
2014-04-25 05:00:52 -07:00
|
|
|
#include "gfx2DGlue.h"
|
2013-09-04 05:14:52 -07:00
|
|
|
#include "GLContextTypes.h" // for GLContext, etc
|
|
|
|
#include "GLDefs.h" // for GLuint, LOCAL_GL_TEXTURE_2D, etc
|
2013-11-26 14:15:17 -08:00
|
|
|
#include "OGLShaderProgram.h" // for ShaderProgramOGL, etc
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "Units.h" // for ScreenPoint
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE, MOZ_FINAL
|
|
|
|
#include "mozilla/RefPtr.h" // for TemporaryRef, RefPtr
|
2013-09-26 17:37:19 -07:00
|
|
|
#include "mozilla/gfx/2D.h" // for DrawTarget
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/gfx/BaseSize.h" // for BaseSize
|
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize, Point
|
|
|
|
#include "mozilla/gfx/Rect.h" // for Rect, IntRect
|
|
|
|
#include "mozilla/gfx/Types.h" // for Float, SurfaceFormat, etc
|
|
|
|
#include "mozilla/layers/Compositor.h" // for SurfaceInitMode, Compositor, etc
|
2014-04-25 19:34:06 -07:00
|
|
|
#include "mozilla/layers/CompositorTypes.h" // for MaskType::MaskType::NumMaskTypes, etc
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/layers/LayersTypes.h"
|
|
|
|
#include "nsAutoPtr.h" // for nsRefPtr, nsAutoPtr
|
|
|
|
#include "nsCOMPtr.h" // for already_AddRefed
|
|
|
|
#include "nsDebug.h" // for NS_ASSERTION, NS_WARNING
|
2014-02-26 13:36:35 -08:00
|
|
|
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "nsSize.h" // for nsIntSize
|
|
|
|
#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc
|
|
|
|
#include "nsThreadUtils.h" // for nsRunnable
|
|
|
|
#include "nsXULAppAPI.h" // for XRE_GetProcessType
|
|
|
|
#include "nscore.h" // for NS_IMETHOD
|
2014-03-07 13:34:04 -08:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
|
|
|
#include <ui/GraphicBuffer.h>
|
|
|
|
#endif
|
2013-08-22 12:04:55 -07:00
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
class nsIWidget;
|
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 02:20:52 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
2013-08-23 23:12:51 -07:00
|
|
|
class TimeStamp;
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
namespace gfx {
|
|
|
|
class Matrix4x4;
|
|
|
|
}
|
|
|
|
|
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 02:20:52 -07:00
|
|
|
namespace layers {
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
class 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 02:20:52 -07:00
|
|
|
class CompositingRenderTargetOGL;
|
2013-08-11 16:17:23 -07:00
|
|
|
class DataTextureSource;
|
2013-04-16 14:35:57 -07:00
|
|
|
class GLManagerCompositor;
|
2013-08-11 16:17:23 -07:00
|
|
|
class TextureSource;
|
|
|
|
struct Effect;
|
|
|
|
struct EffectChain;
|
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 02:20:52 -07:00
|
|
|
|
2014-03-12 09:28:47 -07:00
|
|
|
/**
|
|
|
|
* Interface for pools of temporary gl textures for the compositor.
|
|
|
|
* The textures are fully owned by the pool, so the latter is responsible
|
|
|
|
* calling fDeleteTextures accordingly.
|
|
|
|
* Users of GetTexture receive a texture that is only valid for the duration
|
|
|
|
* of the current frame.
|
|
|
|
* This is primarily intended for direct texturing APIs that need to attach
|
|
|
|
* shared objects (such as an EGLImage) to a gl texture.
|
|
|
|
*/
|
2014-04-14 12:04:24 -07:00
|
|
|
class CompositorTexturePoolOGL
|
2014-03-12 09:28:47 -07:00
|
|
|
{
|
2014-04-14 12:04:24 -07:00
|
|
|
protected:
|
2014-04-14 13:16:18 -07:00
|
|
|
virtual ~CompositorTexturePoolOGL() {}
|
2014-04-14 12:04:24 -07:00
|
|
|
|
2014-04-14 12:04:24 -07:00
|
|
|
public:
|
|
|
|
NS_INLINE_DECL_REFCOUNTING(CompositorTexturePoolOGL)
|
|
|
|
|
2014-03-12 09:28:47 -07:00
|
|
|
virtual void Clear() = 0;
|
|
|
|
|
2014-03-21 05:54:13 -07:00
|
|
|
virtual GLuint GetTexture(GLenum aTarget, GLenum aEnum) = 0;
|
2014-03-12 09:28:47 -07:00
|
|
|
|
|
|
|
virtual void EndFrame() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Agressively reuses textures. One gl texture per texture unit in total.
|
|
|
|
* So far this hasn't shown the best results on b2g.
|
|
|
|
*/
|
|
|
|
class PerUnitTexturePoolOGL : public CompositorTexturePoolOGL
|
|
|
|
{
|
|
|
|
public:
|
2014-08-19 21:55:14 -07:00
|
|
|
explicit PerUnitTexturePoolOGL(gl::GLContext* aGL)
|
2014-03-21 05:54:13 -07:00
|
|
|
: mTextureTarget(0) // zero is never a valid texture target
|
|
|
|
, mGL(aGL)
|
2014-03-12 09:28:47 -07:00
|
|
|
{}
|
|
|
|
|
|
|
|
virtual ~PerUnitTexturePoolOGL()
|
|
|
|
{
|
|
|
|
DestroyTextures();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Clear() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
DestroyTextures();
|
|
|
|
}
|
|
|
|
|
2014-03-21 05:54:13 -07:00
|
|
|
virtual GLuint GetTexture(GLenum aTarget, GLenum aUnit) MOZ_OVERRIDE;
|
2014-03-12 09:28:47 -07:00
|
|
|
|
|
|
|
virtual void EndFrame() MOZ_OVERRIDE {}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void DestroyTextures();
|
|
|
|
|
2014-03-21 05:54:13 -07:00
|
|
|
GLenum mTextureTarget;
|
2014-03-12 09:28:47 -07:00
|
|
|
nsTArray<GLuint> mTextures;
|
|
|
|
RefPtr<gl::GLContext> mGL;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reuse gl textures from a pool of textures that haven't yet been
|
|
|
|
* used during the current frame.
|
|
|
|
* All the textures that are not used at the end of a frame are
|
|
|
|
* deleted.
|
|
|
|
* This strategy seems to work well with gralloc textures because destroying
|
|
|
|
* unused textures which are bound to gralloc buffers let drivers know that it
|
|
|
|
* can unlock the gralloc buffers.
|
|
|
|
*/
|
|
|
|
class PerFrameTexturePoolOGL : public CompositorTexturePoolOGL
|
|
|
|
{
|
|
|
|
public:
|
2014-08-19 21:55:14 -07:00
|
|
|
explicit PerFrameTexturePoolOGL(gl::GLContext* aGL)
|
2014-03-21 05:54:13 -07:00
|
|
|
: mTextureTarget(0) // zero is never a valid texture target
|
|
|
|
, mGL(aGL)
|
2014-03-12 09:28:47 -07:00
|
|
|
{}
|
|
|
|
|
|
|
|
virtual ~PerFrameTexturePoolOGL()
|
|
|
|
{
|
|
|
|
DestroyTextures();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Clear() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
DestroyTextures();
|
|
|
|
}
|
|
|
|
|
2014-03-21 05:54:13 -07:00
|
|
|
virtual GLuint GetTexture(GLenum aTarget, GLenum aUnit) MOZ_OVERRIDE;
|
2014-03-12 09:28:47 -07:00
|
|
|
|
|
|
|
virtual void EndFrame() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void DestroyTextures();
|
|
|
|
|
2014-03-21 05:54:13 -07:00
|
|
|
GLenum mTextureTarget;
|
2014-03-12 09:28:47 -07:00
|
|
|
RefPtr<gl::GLContext> mGL;
|
|
|
|
nsTArray<GLuint> mCreatedTextures;
|
|
|
|
nsTArray<GLuint> mUnusedTextures;
|
|
|
|
};
|
|
|
|
|
2014-04-28 07:10:35 -07:00
|
|
|
// If you want to make this class not MOZ_FINAL, first remove calls to virtual
|
|
|
|
// methods (Destroy) that are made in the destructor.
|
|
|
|
class CompositorOGL MOZ_FINAL : public 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 02:20:52 -07:00
|
|
|
{
|
|
|
|
typedef mozilla::gl::GLContext GLContext;
|
2014-04-22 16:23:18 -07:00
|
|
|
|
2013-04-16 14:35:57 -07:00
|
|
|
friend class GLManagerCompositor;
|
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 02:20:52 -07:00
|
|
|
|
2013-11-07 22:22:05 -08:00
|
|
|
std::map<ShaderConfigOGL, ShaderProgramOGL*> mPrograms;
|
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 02:20:52 -07:00
|
|
|
public:
|
2014-08-19 21:55:14 -07:00
|
|
|
explicit CompositorOGL(nsIWidget *aWidget, int aSurfaceWidth = -1, int aSurfaceHeight = -1,
|
|
|
|
bool aUseExternalSurfaceSize = 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 02:20:52 -07:00
|
|
|
|
2014-07-15 08:37:45 -07: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 02:20:52 -07:00
|
|
|
virtual ~CompositorOGL();
|
|
|
|
|
2014-07-15 08:37:45 -07:00
|
|
|
public:
|
2013-07-30 02:59:51 -07:00
|
|
|
virtual TemporaryRef<DataTextureSource>
|
2014-04-25 19:34:05 -07:00
|
|
|
CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) MOZ_OVERRIDE;
|
2013-07-30 02:59:51 -07: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 02:20:52 -07:00
|
|
|
virtual bool Initialize() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void Destroy() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() MOZ_OVERRIDE
|
|
|
|
{
|
2014-05-09 03:06:18 -07:00
|
|
|
TextureFactoryIdentifier result =
|
|
|
|
TextureFactoryIdentifier(LayersBackend::LAYERS_OPENGL,
|
|
|
|
XRE_GetProcessType(),
|
|
|
|
GetMaxTextureSize(),
|
|
|
|
mFBOTextureTarget == LOCAL_GL_TEXTURE_2D,
|
|
|
|
SupportsPartialTextureUpdate());
|
|
|
|
result.mSupportedBlendModes += gfx::CompositionOp::OP_SCREEN;
|
|
|
|
result.mSupportedBlendModes += gfx::CompositionOp::OP_MULTIPLY;
|
2014-08-20 08:23:57 -07:00
|
|
|
result.mSupportedBlendModes += gfx::CompositionOp::OP_SOURCE;
|
2014-05-09 03:06:18 -07:00
|
|
|
return result;
|
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 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
2014-04-22 16:23:18 -07:00
|
|
|
virtual TemporaryRef<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 02:20:52 -07:00
|
|
|
CreateRenderTarget(const gfx::IntRect &aRect, SurfaceInitMode aInit) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual TemporaryRef<CompositingRenderTarget>
|
|
|
|
CreateRenderTargetFromSource(const gfx::IntRect &aRect,
|
2013-11-07 01:53:07 -08:00
|
|
|
const CompositingRenderTarget *aSource,
|
|
|
|
const gfx::IntPoint &aSourcePoint) MOZ_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 02:20:52 -07:00
|
|
|
|
|
|
|
virtual void SetRenderTarget(CompositingRenderTarget *aSurface) MOZ_OVERRIDE;
|
2014-04-02 00:27:42 -07:00
|
|
|
virtual CompositingRenderTarget* GetCurrentRenderTarget() const MOZ_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 02:20:52 -07:00
|
|
|
|
2013-11-07 01:53:08 -08:00
|
|
|
virtual void DrawQuad(const gfx::Rect& aRect,
|
|
|
|
const gfx::Rect& aClipRect,
|
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 02:20:52 -07:00
|
|
|
const EffectChain &aEffectChain,
|
2013-11-07 01:53:08 -08:00
|
|
|
gfx::Float aOpacity,
|
2014-05-21 14:26:38 -07:00
|
|
|
const gfx::Matrix4x4 &aTransform) MOZ_OVERRIDE;
|
2013-12-01 12:54:46 -08: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 02:20:52 -07:00
|
|
|
virtual void EndFrame() MOZ_OVERRIDE;
|
2014-03-17 18:36:56 -07:00
|
|
|
virtual void SetFBAcquireFence(Layer* aLayer) MOZ_OVERRIDE;
|
2014-10-06 15:45:03 -07:00
|
|
|
virtual FenceHandle GetReleaseFence() MOZ_OVERRIDE;
|
2014-01-15 23:22:19 -08:00
|
|
|
virtual void EndFrameForExternalComposition(const gfx::Matrix& aTransform) MOZ_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 02:20:52 -07:00
|
|
|
virtual void AbortFrame() MOZ_OVERRIDE;
|
|
|
|
|
2013-09-04 05:14:52 -07:00
|
|
|
virtual bool SupportsPartialTextureUpdate() MOZ_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 02:20:52 -07:00
|
|
|
|
2013-09-26 17:37:19 -07:00
|
|
|
virtual bool CanUseCanvasLayerForSize(const gfx::IntSize &aSize) MOZ_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 02:20:52 -07:00
|
|
|
{
|
|
|
|
if (!mGLContext)
|
|
|
|
return false;
|
|
|
|
int32_t maxSize = GetMaxTextureSize();
|
2013-09-26 17:37:19 -07:00
|
|
|
return aSize <= gfx::IntSize(maxSize, maxSize);
|
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 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
2013-09-04 05:14:52 -07:00
|
|
|
virtual int32_t GetMaxTextureSize() const MOZ_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 02:20:52 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the size of the EGL surface we're rendering to, if we're rendering to
|
|
|
|
* an EGL surface.
|
|
|
|
*/
|
|
|
|
virtual void SetDestinationSurfaceSize(const gfx::IntSize& aSize) MOZ_OVERRIDE;
|
|
|
|
|
2013-06-03 07:00:02 -07:00
|
|
|
virtual void SetScreenRenderOffset(const ScreenPoint& aOffset) MOZ_OVERRIDE {
|
2013-04-25 10:47:08 -07:00
|
|
|
mRenderOffset = aOffset;
|
|
|
|
}
|
|
|
|
|
2013-09-04 05:14:52 -07:00
|
|
|
virtual void MakeCurrent(MakeCurrentFlags aFlags = 0) MOZ_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 02:20:52 -07:00
|
|
|
|
2014-09-10 12:59:00 -07:00
|
|
|
virtual void PrepareViewport(const gfx::IntSize& aSize) MOZ_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 02:20:52 -07:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef MOZ_DUMP_PAINTING
|
|
|
|
virtual const char* Name() const MOZ_OVERRIDE { return "OGL"; }
|
|
|
|
#endif // MOZ_DUMP_PAINTING
|
|
|
|
|
2014-02-17 16:30:05 -08:00
|
|
|
virtual LayersBackend GetBackendType() const MOZ_OVERRIDE {
|
|
|
|
return LayersBackend::LAYERS_OPENGL;
|
|
|
|
}
|
|
|
|
|
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 02:20:52 -07:00
|
|
|
virtual void Pause() MOZ_OVERRIDE;
|
|
|
|
virtual bool Resume() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual nsIWidget* GetWidget() const MOZ_OVERRIDE { return mWidget; }
|
|
|
|
|
|
|
|
GLContext* gl() const { return mGLContext; }
|
2013-07-04 10:25:50 -07:00
|
|
|
gfx::SurfaceFormat GetFBOFormat() const {
|
2014-01-10 11:06:16 -08:00
|
|
|
return gfx::SurfaceFormat::R8G8B8A8;
|
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 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
2013-06-04 11:44:37 -07:00
|
|
|
/**
|
|
|
|
* The compositor provides with temporary textures for use with direct
|
|
|
|
* textruing like gralloc texture.
|
|
|
|
* Doing so lets us use gralloc the way it has been designed to be used
|
|
|
|
* (see https://wiki.mozilla.org/Platform/GFX/Gralloc)
|
|
|
|
*/
|
2014-03-21 05:54:13 -07:00
|
|
|
GLuint GetTemporaryTexture(GLenum aTarget, GLenum aUnit);
|
2013-11-07 22:22:05 -08:00
|
|
|
|
|
|
|
const gfx::Matrix4x4& GetProjMatrix() const {
|
|
|
|
return mProjMatrix;
|
|
|
|
}
|
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 02:20:52 -07:00
|
|
|
private:
|
2014-04-25 04:38:17 -07:00
|
|
|
virtual gfx::IntSize GetWidgetSize() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return gfx::ToIntSize(mWidgetSize);
|
|
|
|
}
|
|
|
|
|
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 02:20:52 -07:00
|
|
|
/** Widget associated with this compositor */
|
|
|
|
nsIWidget *mWidget;
|
|
|
|
nsIntSize mWidgetSize;
|
|
|
|
nsRefPtr<GLContext> mGLContext;
|
2013-11-07 22:22:05 -08:00
|
|
|
gfx::Matrix4x4 mProjMatrix;
|
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 02:20:52 -07:00
|
|
|
|
|
|
|
/** The size of the surface we are rendering to */
|
|
|
|
nsIntSize mSurfaceSize;
|
|
|
|
|
2013-06-03 07:00:02 -07:00
|
|
|
ScreenPoint mRenderOffset;
|
2013-04-25 10:47:08 -07: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 02:20:52 -07:00
|
|
|
already_AddRefed<mozilla::gl::GLContext> CreateContext();
|
|
|
|
|
|
|
|
/** Texture target to use for FBOs */
|
|
|
|
GLenum mFBOTextureTarget;
|
|
|
|
|
|
|
|
/** Currently bound render target */
|
|
|
|
RefPtr<CompositingRenderTargetOGL> mCurrentRenderTarget;
|
|
|
|
#ifdef DEBUG
|
|
|
|
CompositingRenderTargetOGL* mWindowRenderTarget;
|
|
|
|
#endif
|
|
|
|
|
2014-04-02 06:02:07 -07:00
|
|
|
/**
|
|
|
|
* VBO that has some basics in it for a textured quad, including vertex
|
|
|
|
* coords and texcoords.
|
|
|
|
*/
|
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 02:20:52 -07:00
|
|
|
GLuint mQuadVBO;
|
|
|
|
|
|
|
|
bool mHasBGRA;
|
|
|
|
|
|
|
|
/**
|
2013-04-29 20:16:04 -07:00
|
|
|
* When rendering to some EGL surfaces (e.g. on Android), we rely on being told
|
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 02:20:52 -07:00
|
|
|
* about size changes (via SetSurfaceSize) rather than pulling this information
|
|
|
|
* from the widget.
|
|
|
|
*/
|
2013-04-29 20:16:04 -07:00
|
|
|
bool mUseExternalSurfaceSize;
|
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 02:20:52 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Have we had DrawQuad calls since the last frame was rendered?
|
|
|
|
*/
|
|
|
|
bool mFrameInProgress;
|
|
|
|
|
2014-01-17 18:55:30 -08:00
|
|
|
/*
|
2014-03-27 20:38:32 -07:00
|
|
|
* Clear aRect on current render target.
|
2014-01-17 18:55:30 -08:00
|
|
|
*/
|
2014-03-27 20:38:32 -07:00
|
|
|
virtual void ClearRect(const gfx::Rect& aRect) MOZ_OVERRIDE;
|
2014-01-17 18:55:30 -08: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 02:20:52 -07:00
|
|
|
/* Start a new frame. If aClipRectIn is null and aClipRectOut is non-null,
|
|
|
|
* sets *aClipRectOut to the screen dimensions.
|
|
|
|
*/
|
2013-11-21 11:25:16 -08:00
|
|
|
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
|
|
|
|
const gfx::Rect *aClipRectIn,
|
2014-01-15 23:22:19 -08:00
|
|
|
const gfx::Rect& aRenderBounds,
|
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 02:20:52 -07:00
|
|
|
gfx::Rect *aClipRectOut = nullptr,
|
|
|
|
gfx::Rect *aRenderBoundsOut = nullptr) MOZ_OVERRIDE;
|
|
|
|
|
2014-05-09 03:06:18 -07:00
|
|
|
ShaderConfigOGL GetShaderConfigFor(Effect *aEffect,
|
|
|
|
MaskType aMask = MaskType::MaskNone,
|
2014-08-07 14:44:08 -07:00
|
|
|
gfx::CompositionOp aOp = gfx::CompositionOp::OP_OVER,
|
|
|
|
bool aColorMatrix = false) const;
|
2013-11-07 22:22:05 -08:00
|
|
|
ShaderProgramOGL* GetShaderProgramFor(const ShaderConfigOGL &aConfig);
|
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 02:20:52 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a FBO backed by a texture.
|
|
|
|
* Note that the texture target type will be
|
|
|
|
* of the type returned by FBOTextureTarget; different
|
|
|
|
* shaders are required to sample from the different
|
|
|
|
* texture types.
|
|
|
|
*/
|
2013-11-07 01:53:07 -08:00
|
|
|
void CreateFBOWithTexture(const gfx::IntRect& aRect, bool aCopyFromSource,
|
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 02:20:52 -07:00
|
|
|
GLuint aSourceFrameBuffer,
|
|
|
|
GLuint *aFBO, GLuint *aTexture);
|
|
|
|
|
2014-05-28 07:15:31 -07:00
|
|
|
void BindAndDrawQuads(ShaderProgramOGL *aProg,
|
|
|
|
int aQuads,
|
|
|
|
const gfx::Rect* aLayerRect,
|
|
|
|
const gfx::Rect* aTextureRect);
|
2014-05-21 14:36:56 -07:00
|
|
|
void BindAndDrawQuad(ShaderProgramOGL *aProg,
|
2014-05-22 03:29:54 -07:00
|
|
|
const gfx::Rect& aLayerRect,
|
2014-05-28 07:15:31 -07:00
|
|
|
const gfx::Rect& aTextureRect = gfx::Rect(0.0f, 0.0f, 1.0f, 1.0f)) {
|
|
|
|
gfx::Rect layerRects[4];
|
|
|
|
gfx::Rect textureRects[4];
|
|
|
|
layerRects[0] = aLayerRect;
|
|
|
|
textureRects[0] = aTextureRect;
|
|
|
|
BindAndDrawQuads(aProg, 1, layerRects, textureRects);
|
|
|
|
}
|
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 02:20:52 -07:00
|
|
|
void BindAndDrawQuadWithTextureRect(ShaderProgramOGL *aProg,
|
2014-05-21 14:36:56 -07:00
|
|
|
const gfx::Rect& 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 02:20:52 -07:00
|
|
|
const gfx::Rect& aTexCoordRect,
|
|
|
|
TextureSource *aTexture);
|
|
|
|
|
|
|
|
void CleanupResources();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Copies the content of our backbuffer to the set transaction target.
|
|
|
|
* Does not restore the target FBO, so only call from EndFrame.
|
|
|
|
*/
|
2014-05-27 18:21:32 -07:00
|
|
|
void CopyToTarget(gfx::DrawTarget* aTarget, const nsIntPoint& aTopLeft, const gfx::Matrix& aWorldMatrix);
|
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 02:20:52 -07:00
|
|
|
|
2014-01-07 12:02:18 -08:00
|
|
|
/**
|
|
|
|
* Implements the flipping of the y-axis to convert from layers/compositor
|
|
|
|
* coordinates to OpenGL coordinates.
|
|
|
|
*
|
|
|
|
* Indeed, the only coordinate system that OpenGL knows has the y-axis
|
|
|
|
* pointing upwards, but the layers/compositor coordinate system has the
|
|
|
|
* y-axis pointing downwards, for good reason as Web pages are typically
|
|
|
|
* scrolled downwards. So, some flipping has to take place; FlippedY does it.
|
|
|
|
*/
|
|
|
|
GLint FlipY(GLint y) const { return mHeight - y; }
|
|
|
|
|
2014-03-12 09:28:47 -07:00
|
|
|
RefPtr<CompositorTexturePoolOGL> mTexturePool;
|
2014-01-07 12:02:18 -08:00
|
|
|
|
2014-03-12 09:28:47 -07:00
|
|
|
bool mDestroyed;
|
2014-03-13 10:55:52 -07:00
|
|
|
|
2014-01-07 12:02:18 -08:00
|
|
|
/**
|
|
|
|
* Height of the OpenGL context's primary framebuffer in pixels. Used by
|
|
|
|
* FlipY for the y-flipping calculation.
|
|
|
|
*/
|
|
|
|
GLint mHeight;
|
2014-10-06 15:45:03 -07:00
|
|
|
|
|
|
|
FenceHandle mReleaseFenceHandle;
|
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 02:20:52 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* MOZILLA_GFX_COMPOSITOROGL_H */
|