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 -*-
|
2013-07-04 10:25:50 -07:00
|
|
|
* 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/. */
|
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
|
|
|
|
|
|
|
#ifndef MOZILLA_GFX_TEXTUREOGL_H
|
|
|
|
#define MOZILLA_GFX_TEXTUREOGL_H
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stddef.h> // for size_t
|
|
|
|
#include <stdint.h> // for uint64_t
|
2013-09-12 19:39:26 -07:00
|
|
|
#include "CompositableHost.h"
|
2013-09-04 05:14:52 -07:00
|
|
|
#include "GLContextTypes.h" // for GLContext
|
|
|
|
#include "GLDefs.h" // for GLenum, LOCAL_GL_CLAMP_TO_EDGE, etc
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "GLTextureImage.h" // for TextureImage
|
2013-09-24 13:45:14 -07:00
|
|
|
#include "gfxTypes.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/GfxMessageUtils.h" // for gfxContentType
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr
|
2014-01-24 17:49:02 -08:00
|
|
|
#include "mozilla/gfx/Matrix.h" // for Matrix4x4
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize, IntPoint
|
|
|
|
#include "mozilla/gfx/Types.h" // for SurfaceFormat, etc
|
|
|
|
#include "mozilla/layers/CompositorTypes.h" // for TextureFlags
|
|
|
|
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
|
|
|
#include "mozilla/layers/TextureHost.h" // for DeprecatedTextureHost, etc
|
|
|
|
#include "mozilla/mozalloc.h" // for operator delete, etc
|
|
|
|
#include "nsAutoPtr.h" // for nsRefPtr
|
|
|
|
#include "nsCOMPtr.h" // for already_AddRefed
|
|
|
|
#include "nsDebug.h" // for NS_WARNING
|
|
|
|
#include "nsISupportsImpl.h" // for TextureImage::Release, etc
|
2013-11-26 14:15:17 -08:00
|
|
|
#include "OGLShaderProgram.h" // for ShaderProgramType, etc
|
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_WIDGET_GONK
|
|
|
|
#include <ui/GraphicBuffer.h>
|
2014-02-27 13:26:22 -08:00
|
|
|
#if ANDROID_VERSION >= 17
|
2014-02-24 20:23:41 -08:00
|
|
|
#include <ui/Fence.h>
|
|
|
|
#endif
|
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
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
class gfxImageSurface;
|
|
|
|
class gfxReusableSurfaceWrapper;
|
|
|
|
class nsIntRegion;
|
|
|
|
struct nsIntPoint;
|
2013-09-06 19:15:49 -07:00
|
|
|
struct nsIntRect;
|
|
|
|
struct nsIntSize;
|
2013-08-11 16:17:23 -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
|
|
|
namespace mozilla {
|
2013-08-11 16:17:23 -07:00
|
|
|
namespace gfx {
|
|
|
|
class DataSourceSurface;
|
|
|
|
class SurfaceStream;
|
|
|
|
}
|
|
|
|
|
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 Compositor;
|
2013-08-11 19:21:17 -07:00
|
|
|
class CompositorOGL;
|
2013-08-11 16:17:23 -07:00
|
|
|
class TextureImageDeprecatedTextureHostOGL;
|
2013-05-15 20:45:43 -07:00
|
|
|
|
2013-09-12 19:39:26 -07:00
|
|
|
/**
|
2013-09-30 05:14:38 -07:00
|
|
|
* CompositableBackendSpecificData implementation for the Gonk OpenGL backend.
|
2013-09-12 19:39:26 -07:00
|
|
|
* Share a same texture between TextureHosts in the same CompositableHost.
|
|
|
|
* By shareing the texture among the TextureHosts, number of texture allocations
|
|
|
|
* can be reduced than texture allocation in every TextureHosts.
|
|
|
|
* From Bug 912134, use only one texture among all TextureHosts degrade
|
|
|
|
* the rendering performance.
|
2013-09-30 05:14:38 -07:00
|
|
|
* CompositableDataGonkOGL chooses in a middile of them.
|
2013-09-12 19:39:26 -07:00
|
|
|
*/
|
2013-09-30 05:14:38 -07:00
|
|
|
class CompositableDataGonkOGL : public CompositableBackendSpecificData
|
2013-09-12 19:39:26 -07:00
|
|
|
{
|
|
|
|
public:
|
2013-09-30 05:14:38 -07:00
|
|
|
CompositableDataGonkOGL();
|
|
|
|
virtual ~CompositableDataGonkOGL();
|
2013-09-12 19:39:26 -07:00
|
|
|
|
|
|
|
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
2013-10-17 08:09:15 -07:00
|
|
|
virtual void ClearData() MOZ_OVERRIDE;
|
2013-09-12 19:39:26 -07:00
|
|
|
gl::GLContext* gl() const;
|
|
|
|
protected:
|
|
|
|
RefPtr<CompositorOGL> mCompositor;
|
|
|
|
};
|
|
|
|
|
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
|
|
|
/*
|
|
|
|
* TextureHost implementations for the OpenGL backend.
|
|
|
|
*
|
2013-07-08 21:21:06 -07:00
|
|
|
* Note that it is important to be careful about the ownership model with
|
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 OpenGL backend, due to some widget limitation on Linux: before
|
|
|
|
* the nsBaseWidget associated with our OpenGL context has been completely
|
|
|
|
* deleted, every resource belonging to the OpenGL context MUST have been
|
|
|
|
* released. At the moment the teardown sequence happens in the middle of
|
|
|
|
* the nsBaseWidget's destructor, meaning that at a given moment we must be
|
|
|
|
* able to easily find and release all the GL resources.
|
|
|
|
* The point is: be careful about the ownership model and limit the number
|
|
|
|
* of objects sharing references to GL resources to make the tear down
|
|
|
|
* sequence as simple as possible.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureSourceOGL provides the necessary API for CompositorOGL to composite
|
|
|
|
* a TextureSource.
|
|
|
|
*/
|
|
|
|
class TextureSourceOGL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual bool IsValid() const = 0;
|
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 void BindTexture(GLenum aTextureUnit) = 0;
|
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 gfx::IntSize GetSize() const = 0;
|
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 GLenum GetTextureTarget() const { return LOCAL_GL_TEXTURE_2D; }
|
2013-07-30 02:59:51 -07:00
|
|
|
|
|
|
|
virtual gfx::SurfaceFormat GetFormat() const = 0;
|
|
|
|
|
|
|
|
virtual GLenum GetWrapMode() const = 0;
|
|
|
|
|
2014-01-24 17:49:02 -08:00
|
|
|
virtual gfx::Matrix4x4 GetTextureTransform() { return gfx::Matrix4x4(); }
|
2013-05-15 20:45:43 -07:00
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
virtual TextureImageDeprecatedTextureHostOGL* AsTextureImageDeprecatedTextureHost() { return nullptr; }
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
};
|
|
|
|
|
2014-02-24 20:23:41 -08:00
|
|
|
/**
|
|
|
|
* TextureHostOGL provides the necessary API for platform specific composition.
|
|
|
|
*/
|
|
|
|
class TextureHostOGL
|
|
|
|
{
|
|
|
|
public:
|
2014-02-27 13:26:22 -08:00
|
|
|
#if MOZ_WIDGET_GONK && ANDROID_VERSION >= 17
|
2014-02-24 20:23:41 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Store a fence that will signal when the current buffer is no longer being read.
|
|
|
|
* Similar to android's GLConsumer::setReleaseFence()
|
|
|
|
*/
|
|
|
|
virtual bool SetReleaseFence(const android::sp<android::Fence>& aReleaseFence);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a releaseFence's Fence and clear a reference to the Fence.
|
|
|
|
*/
|
|
|
|
virtual android::sp<android::Fence> GetAndResetReleaseFence();
|
|
|
|
protected:
|
|
|
|
android::sp<android::Fence> mReleaseFence;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
/**
|
|
|
|
* A TextureSource backed by a TextureImage.
|
|
|
|
*
|
|
|
|
* Depending on the underlying TextureImage, may support texture tiling, so
|
|
|
|
* make sure to check AsTileIterator() and use the texture accordingly.
|
|
|
|
*
|
|
|
|
* This TextureSource can be used without a TextureHost and manage it's own
|
|
|
|
* GL texture(s).
|
|
|
|
*/
|
|
|
|
class TextureImageTextureSourceOGL : public DataTextureSource
|
|
|
|
, public TextureSourceOGL
|
|
|
|
, public TileIterator
|
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-07-30 02:59:51 -07:00
|
|
|
public:
|
2014-01-07 08:20:11 -08:00
|
|
|
TextureImageTextureSourceOGL(gl::GLContext* aGL,
|
|
|
|
TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT)
|
2013-07-30 02:59:51 -07:00
|
|
|
: mGL(aGL)
|
2014-01-07 08:20:11 -08:00
|
|
|
, mFlags(aFlags)
|
2013-07-30 02:59:51 -07:00
|
|
|
, mIterating(false)
|
|
|
|
{}
|
|
|
|
|
|
|
|
// DataTextureSource
|
|
|
|
|
|
|
|
virtual bool Update(gfx::DataSourceSurface* aSurface,
|
|
|
|
nsIntRegion* aDestRegion = nullptr,
|
|
|
|
gfx::IntPoint* aSrcOffset = nullptr) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// TextureSource
|
|
|
|
|
|
|
|
virtual void DeallocateDeviceData() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
mTexImage = nullptr;
|
|
|
|
SetUpdateSerial(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual TextureSourceOGL* AsSourceOGL() MOZ_OVERRIDE { return this; }
|
|
|
|
|
|
|
|
virtual void BindTexture(GLenum aTextureUnit) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool IsValid() const MOZ_OVERRIDE { return !!mTexImage; }
|
|
|
|
|
2014-01-07 08:20:11 -08:00
|
|
|
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
virtual GLenum GetWrapMode() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTexImage->GetWrapMode();
|
|
|
|
}
|
|
|
|
|
|
|
|
// TileIterator
|
|
|
|
|
|
|
|
virtual TileIterator* AsTileIterator() MOZ_OVERRIDE { return this; }
|
|
|
|
|
|
|
|
virtual void BeginTileIteration() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
mTexImage->BeginTileIteration();
|
|
|
|
mIterating = true;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
2013-07-30 02:59:51 -07:00
|
|
|
|
|
|
|
virtual void EndTileIteration() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
mIterating = false;
|
|
|
|
}
|
|
|
|
|
2013-08-13 06:44:53 -07:00
|
|
|
virtual nsIntRect GetTileRect() MOZ_OVERRIDE;
|
2013-07-30 02:59:51 -07:00
|
|
|
|
|
|
|
virtual size_t GetTileCount() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTexImage->GetTileCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool NextTile() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTexImage->NextTile();
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsRefPtr<gl::TextureImage> mTexImage;
|
|
|
|
gl::GLContext* mGL;
|
2014-01-07 08:20:11 -08:00
|
|
|
TextureFlags mFlags;
|
2013-07-30 02:59:51 -07:00
|
|
|
bool mIterating;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A texture source meant for use with SharedTextureHostOGL.
|
|
|
|
*
|
|
|
|
* It does not own any GL texture, and attaches its shared handle to one of
|
|
|
|
* the compositor's temporary textures when binding.
|
|
|
|
*
|
|
|
|
* The shared texture handle is owned by the TextureHost.
|
|
|
|
*/
|
|
|
|
class SharedTextureSourceOGL : public NewTextureSource
|
|
|
|
, public TextureSourceOGL
|
|
|
|
{
|
|
|
|
public:
|
2013-09-04 05:14:52 -07:00
|
|
|
typedef gl::SharedTextureShareType SharedTextureShareType;
|
2013-07-30 02:59:51 -07:00
|
|
|
|
|
|
|
SharedTextureSourceOGL(CompositorOGL* aCompositor,
|
|
|
|
gl::SharedTextureHandle aHandle,
|
|
|
|
gfx::SurfaceFormat aFormat,
|
|
|
|
GLenum aTarget,
|
|
|
|
GLenum aWrapMode,
|
|
|
|
SharedTextureShareType aShareType,
|
2013-11-19 06:41:57 -08:00
|
|
|
gfx::IntSize aSize);
|
2013-07-30 02:59:51 -07:00
|
|
|
|
|
|
|
virtual TextureSourceOGL* AsSourceOGL() { return this; }
|
|
|
|
|
|
|
|
virtual void BindTexture(GLenum activetex) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool IsValid() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE { return mSize; }
|
|
|
|
|
|
|
|
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE { return mFormat; }
|
|
|
|
|
2014-01-24 17:49:02 -08:00
|
|
|
virtual gfx::Matrix4x4 GetTextureTransform() MOZ_OVERRIDE;
|
2013-07-30 02:59:51 -07:00
|
|
|
|
2013-08-27 13:16:54 -07:00
|
|
|
virtual GLenum GetTextureTarget() const { return mTextureTarget; }
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
virtual GLenum GetWrapMode() const MOZ_OVERRIDE { return mWrapMode; }
|
|
|
|
|
|
|
|
// SharedTextureSource doesn't own any gl texture
|
|
|
|
virtual void DeallocateDeviceData() {}
|
|
|
|
|
|
|
|
void DetachSharedHandle();
|
|
|
|
|
2014-01-08 11:25:52 -08:00
|
|
|
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
2013-07-30 02:59:51 -07:00
|
|
|
|
|
|
|
gl::GLContext* gl() const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
gfx::IntSize mSize;
|
|
|
|
CompositorOGL* mCompositor;
|
|
|
|
gl::SharedTextureHandle mSharedHandle;
|
|
|
|
gfx::SurfaceFormat mFormat;
|
|
|
|
SharedTextureShareType mShareType;
|
|
|
|
GLenum mTextureTarget;
|
|
|
|
GLenum mWrapMode;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A TextureHost for shared GL Textures
|
|
|
|
*
|
|
|
|
* Most of the logic actually happens in SharedTextureSourceOGL.
|
|
|
|
*/
|
|
|
|
class SharedTextureHostOGL : public TextureHost
|
|
|
|
{
|
|
|
|
public:
|
2013-12-11 17:44:47 -08:00
|
|
|
SharedTextureHostOGL(TextureFlags aFlags,
|
2013-09-04 05:14:52 -07:00
|
|
|
gl::SharedTextureShareType aShareType,
|
2013-08-08 05:53:12 -07:00
|
|
|
gl::SharedTextureHandle aSharedhandle,
|
2013-07-30 02:59:51 -07:00
|
|
|
gfx::IntSize aSize,
|
|
|
|
bool inverted);
|
|
|
|
|
|
|
|
virtual ~SharedTextureHostOGL();
|
|
|
|
|
|
|
|
// SharedTextureHostOGL doesn't own any GL texture
|
|
|
|
virtual void DeallocateDeviceData() MOZ_OVERRIDE {}
|
|
|
|
|
|
|
|
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool Lock() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void Unlock() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTextureSource;
|
|
|
|
}
|
|
|
|
|
2013-11-27 01:59:01 -08:00
|
|
|
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE
|
2013-07-30 02:59:51 -07:00
|
|
|
{
|
|
|
|
return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING)
|
|
|
|
}
|
|
|
|
|
|
|
|
gl::GLContext* gl() const;
|
|
|
|
|
|
|
|
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE { return mSize; }
|
|
|
|
|
|
|
|
virtual const char* Name() { return "SharedTextureHostOGL"; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
gfx::IntSize mSize;
|
|
|
|
CompositorOGL* mCompositor;
|
|
|
|
gl::SharedTextureHandle mSharedHandle;
|
2013-09-04 05:14:52 -07:00
|
|
|
gl::SharedTextureShareType mShareType;
|
2013-07-30 02:59:51 -07:00
|
|
|
|
|
|
|
RefPtr<SharedTextureSourceOGL> mTextureSource;
|
2014-01-10 05:06:06 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A texture source meant for use with StreamTextureHostOGL.
|
|
|
|
*
|
|
|
|
* It does not own any texture, we get texture from SurfaceStream.
|
|
|
|
*/
|
|
|
|
class StreamTextureSourceOGL : public NewTextureSource
|
|
|
|
, public TextureSourceOGL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StreamTextureSourceOGL(CompositorOGL* aCompositor,
|
|
|
|
gfx::SurfaceStream* aStream)
|
|
|
|
: mCompositor(aCompositor)
|
|
|
|
, mStream(aStream)
|
|
|
|
, mTextureHandle(0)
|
|
|
|
, mTextureTarget(LOCAL_GL_TEXTURE_2D)
|
|
|
|
, mUploadTexture(0)
|
2014-01-10 11:06:16 -08:00
|
|
|
, mFormat(gfx::SurfaceFormat::UNKNOWN)
|
2014-01-10 05:06:06 -08:00
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(StreamTextureSourceOGL);
|
|
|
|
}
|
|
|
|
|
|
|
|
~StreamTextureSourceOGL()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(StreamTextureSourceOGL);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual TextureSourceOGL* AsSourceOGL() { return this; }
|
|
|
|
|
|
|
|
virtual void BindTexture(GLenum activetex) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool IsValid() const MOZ_OVERRIDE { return !!gl(); }
|
|
|
|
|
|
|
|
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE { return mSize; }
|
|
|
|
|
|
|
|
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE { return mFormat; }
|
|
|
|
|
|
|
|
virtual GLenum GetTextureTarget() const { return mTextureTarget; }
|
|
|
|
|
|
|
|
virtual GLenum GetWrapMode() const MOZ_OVERRIDE { return LOCAL_GL_CLAMP_TO_EDGE; }
|
|
|
|
|
|
|
|
virtual void DeallocateDeviceData();
|
|
|
|
|
|
|
|
bool RetrieveTextureFromStream();
|
|
|
|
|
|
|
|
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
gl::GLContext* gl() const;
|
|
|
|
|
|
|
|
CompositorOGL* mCompositor;
|
|
|
|
gfx::SurfaceStream* mStream;
|
|
|
|
GLuint mTextureHandle;
|
|
|
|
GLenum mTextureTarget;
|
|
|
|
GLuint mUploadTexture;
|
|
|
|
gfx::IntSize mSize;
|
|
|
|
gfx::SurfaceFormat mFormat;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A TextureHost for shared SurfaceStream
|
|
|
|
*/
|
|
|
|
class StreamTextureHostOGL : public TextureHost
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StreamTextureHostOGL(TextureFlags aFlags,
|
|
|
|
const SurfaceStreamDescriptor& aDesc);
|
|
|
|
|
|
|
|
virtual ~StreamTextureHostOGL();
|
|
|
|
|
|
|
|
// SharedTextureHostOGL doesn't own any GL texture
|
|
|
|
virtual void DeallocateDeviceData() MOZ_OVERRIDE {}
|
|
|
|
|
|
|
|
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool Lock() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void Unlock() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTextureSource;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING)
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
#ifdef MOZ_LAYERS_HAVE_LOG
|
|
|
|
virtual const char* Name() { return "StreamTextureHostOGL"; }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
|
|
|
CompositorOGL* mCompositor;
|
|
|
|
gfx::SurfaceStream* mStream;
|
|
|
|
RefPtr<StreamTextureSourceOGL> mTextureSource;
|
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
|
|
|
|
|
|
|
/**
|
2013-07-08 14:30:44 -07:00
|
|
|
* DeprecatedTextureHost implementation using a TextureImage as the underlying texture.
|
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-07-08 14:30:44 -07:00
|
|
|
class TextureImageDeprecatedTextureHostOGL : public DeprecatedTextureHost
|
|
|
|
, public TextureSourceOGL
|
|
|
|
, public TileIterator
|
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:
|
2013-07-08 14:30:44 -07:00
|
|
|
TextureImageDeprecatedTextureHostOGL(gl::TextureImage* aTexImage = nullptr)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
: mTexture(aTexImage)
|
|
|
|
, mGL(nullptr)
|
|
|
|
, mIterating(false)
|
|
|
|
{
|
2013-07-08 14:30:44 -07:00
|
|
|
MOZ_COUNT_CTOR(TextureImageDeprecatedTextureHostOGL);
|
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-07-08 14:30:44 -07:00
|
|
|
~TextureImageDeprecatedTextureHostOGL();
|
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
|
|
|
|
|
|
|
TextureSourceOGL* AsSourceOGL() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
virtual TextureImageDeprecatedTextureHostOGL* AsTextureImageDeprecatedTextureHost() MOZ_OVERRIDE
|
2013-05-15 20:45:43 -07:00
|
|
|
{
|
|
|
|
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 02:20:52 -07:00
|
|
|
// This is a hack that is here to not break on-main-thread ThebesLayerBuffer
|
|
|
|
// please do not use it anywhere else, use SetCompositor instead.
|
|
|
|
void SetGLContext(gl::GLContext* aGL)
|
|
|
|
{
|
|
|
|
mGL = aGL;
|
|
|
|
}
|
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
// DeprecatedTextureHost
|
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 UpdateImpl(const SurfaceDescriptor& aImage,
|
2013-05-15 20:45:43 -07:00
|
|
|
nsIntRegion* aRegion = nullptr,
|
|
|
|
nsIntPoint* aOffset = nullptr) 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 SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
|
|
|
|
2013-05-15 20:45:43 -07:00
|
|
|
virtual void EnsureBuffer(const nsIntSize& aSize, gfxContentType aType) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void CopyTo(const nsIntRect& aSourceRect,
|
2013-07-08 14:30:44 -07:00
|
|
|
DeprecatedTextureHost *aDest,
|
2013-05-15 20:45:43 -07:00
|
|
|
const nsIntRect& aDestRect) 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
|
|
|
bool IsValid() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return !!mTexture;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool Lock() MOZ_OVERRIDE;
|
|
|
|
|
2013-11-27 01:59:01 -08:00
|
|
|
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE;
|
2013-05-25 19:43:43 -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
|
|
|
// textureSource
|
|
|
|
void BindTexture(GLenum aTextureUnit) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
mTexture->BindTexture(aTextureUnit);
|
|
|
|
}
|
|
|
|
|
|
|
|
gfx::IntSize GetSize() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
GLenum GetWrapMode() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTexture->GetWrapMode();
|
|
|
|
}
|
|
|
|
|
|
|
|
gl::TextureImage* GetTextureImage()
|
|
|
|
{
|
|
|
|
return mTexture;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetTextureImage(gl::TextureImage* aImage)
|
|
|
|
{
|
|
|
|
mTexture = aImage;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TileIterator
|
|
|
|
|
|
|
|
TileIterator* AsTileIterator() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BeginTileIteration() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
mTexture->BeginTileIteration();
|
|
|
|
mIterating = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EndTileIteration() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
mIterating = false;
|
|
|
|
}
|
|
|
|
|
2013-08-13 06:44:53 -07:00
|
|
|
nsIntRect GetTileRect() 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
|
|
|
|
|
|
|
size_t GetTileCount() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTexture->GetTileCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool NextTile() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTexture->NextTile();
|
|
|
|
}
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return DeprecatedTextureHost::GetFormat();
|
|
|
|
}
|
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
virtual const char* Name() { return "TextureImageDeprecatedTextureHostOGL"; }
|
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
|
|
|
|
|
|
|
protected:
|
|
|
|
nsRefPtr<gl::TextureImage> mTexture;
|
|
|
|
gl::GLContext* mGL;
|
|
|
|
bool mIterating;
|
|
|
|
};
|
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
class TiledDeprecatedTextureHostOGL : public DeprecatedTextureHost
|
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 TextureSourceOGL
|
|
|
|
{
|
|
|
|
public:
|
2013-07-08 14:30:44 -07:00
|
|
|
TiledDeprecatedTextureHostOGL()
|
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
|
|
|
: mTextureHandle(0)
|
|
|
|
, mGL(nullptr)
|
|
|
|
{}
|
2013-07-08 14:30:44 -07:00
|
|
|
~TiledDeprecatedTextureHostOGL();
|
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 SetCompositor(Compositor* aCompositor);
|
|
|
|
|
|
|
|
// have to pass the size in here (every time) because of DrawQuad API :-(
|
|
|
|
virtual void Update(gfxReusableSurfaceWrapper* aReusableSurface, TextureFlags aFlags, const gfx::IntSize& aSize) MOZ_OVERRIDE;
|
|
|
|
virtual bool Lock() MOZ_OVERRIDE;
|
|
|
|
virtual void Unlock() MOZ_OVERRIDE {}
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return DeprecatedTextureHost::GetFormat();
|
|
|
|
}
|
|
|
|
|
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 TextureSourceOGL* AsSourceOGL() MOZ_OVERRIDE { return this; }
|
|
|
|
virtual bool IsValid() const MOZ_OVERRIDE { return true; }
|
|
|
|
virtual GLenum GetWrapMode() const MOZ_OVERRIDE { return LOCAL_GL_CLAMP_TO_EDGE; }
|
2013-09-04 05:14:52 -07:00
|
|
|
virtual void BindTexture(GLenum aTextureUnit);
|
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 gfx::IntSize GetSize() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void SwapTexturesImpl(const SurfaceDescriptor& aImage,
|
|
|
|
nsIntRegion* aRegion = nullptr)
|
|
|
|
{ MOZ_ASSERT(false, "Tiles should not use this path"); }
|
|
|
|
|
2013-11-27 01:59:01 -08:00
|
|
|
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE;
|
2013-05-25 19:43:43 -07:00
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
virtual const char* Name() { return "TiledDeprecatedTextureHostOGL"; }
|
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
|
|
|
|
|
|
|
protected:
|
|
|
|
void DeleteTextures();
|
|
|
|
|
|
|
|
virtual uint64_t GetIdentifier() const MOZ_OVERRIDE {
|
|
|
|
return static_cast<uint64_t>(mTextureHandle);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
GLenum GetTileType()
|
|
|
|
{
|
|
|
|
// Deduce the type that was assigned in GetFormatAndTileForImageFormat
|
|
|
|
return mGLFormat == LOCAL_GL_RGB ? LOCAL_GL_UNSIGNED_SHORT_5_6_5 : LOCAL_GL_UNSIGNED_BYTE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gfx::IntSize mSize;
|
|
|
|
GLuint mTextureHandle;
|
|
|
|
GLenum mGLFormat;
|
2013-06-16 19:50:32 -07:00
|
|
|
nsRefPtr<gl::GLContext> mGL;
|
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_WIDGET_GONK
|
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
// For direct texturing with gralloc buffers. The corresponding DeprecatedTextureClient is DeprecatedTextureClientShmem,
|
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
|
|
|
// which automatically gets gralloc when it can, in which case the compositor sees that the
|
2013-07-08 14:30:44 -07:00
|
|
|
// SurfaceDescriptor is gralloc, and decides to use a GrallocDeprecatedTextureHostOGL to do direct texturing,
|
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
|
|
|
// saving the cost of a texture upload.
|
2013-07-08 14:30:44 -07:00
|
|
|
class GrallocDeprecatedTextureHostOGL
|
|
|
|
: public DeprecatedTextureHost
|
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 TextureSourceOGL
|
|
|
|
{
|
|
|
|
public:
|
2013-07-08 14:30:44 -07:00
|
|
|
GrallocDeprecatedTextureHostOGL();
|
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-07-08 14:30:44 -07:00
|
|
|
~GrallocDeprecatedTextureHostOGL();
|
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 SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void UpdateImpl(const SurfaceDescriptor& aImage,
|
2013-05-15 20:45:43 -07:00
|
|
|
nsIntRegion* aRegion = nullptr,
|
|
|
|
nsIntPoint* aOffset = nullptr) 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 SwapTexturesImpl(const SurfaceDescriptor& aImage,
|
|
|
|
nsIntRegion* aRegion = nullptr) MOZ_OVERRIDE;
|
|
|
|
virtual bool Lock() MOZ_OVERRIDE;
|
|
|
|
virtual void Unlock() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual gfx::IntSize GetSize() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mGraphicBuffer.get() ? gfx::IntSize(mGraphicBuffer->getWidth(), mGraphicBuffer->getHeight()) : gfx::IntSize(0, 0);
|
|
|
|
}
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() 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
|
|
|
|
|
|
|
GLenum GetWrapMode() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return LOCAL_GL_CLAMP_TO_EDGE;
|
|
|
|
}
|
|
|
|
|
2013-07-18 20:05:06 -07:00
|
|
|
virtual GLenum GetTextureTarget() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTextureTarget;
|
|
|
|
}
|
|
|
|
|
2013-04-11 09:37:07 -07:00
|
|
|
bool IsValid() 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-27 01:59:01 -08:00
|
|
|
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE;
|
2013-05-25 19:43:43 -07:00
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
virtual const char* Name() { return "GrallocDeprecatedTextureHostOGL"; }
|
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 BindTexture(GLenum aTextureUnit) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual TextureSourceOGL* AsSourceOGL() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2013-04-26 20:31:53 -07:00
|
|
|
// only overridden for hacky fix in gecko 23 for bug 862324
|
|
|
|
// see bug 865908 about fixing this.
|
|
|
|
virtual void SetBuffer(SurfaceDescriptor* aBuffer, ISurfaceAllocator* aAllocator) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// used only for hacky fix in gecko 23 for bug 862324
|
|
|
|
virtual void ForgetBuffer()
|
|
|
|
{
|
|
|
|
if (mBuffer) {
|
|
|
|
// Intentionally don't destroy the actor held by mBuffer here.
|
|
|
|
// The point is that this is only called from GrallocBufferActor::ActorDestroy
|
|
|
|
// where we know that the actor is already being deleted.
|
|
|
|
// See bug 862324 comment 39.
|
|
|
|
delete mBuffer;
|
|
|
|
mBuffer = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
mGraphicBuffer = nullptr;
|
|
|
|
DeleteTextures();
|
|
|
|
}
|
|
|
|
|
2013-06-05 15:14:51 -07:00
|
|
|
virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
|
|
|
|
|
2013-09-17 06:29:19 -07:00
|
|
|
GLuint GetGLTexture();
|
|
|
|
|
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:
|
2013-06-04 11:44:37 -07:00
|
|
|
gl::GLContext* gl() const;
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
void DeleteTextures();
|
|
|
|
|
2013-06-04 11:44:37 -07:00
|
|
|
RefPtr<CompositorOGL> mCompositor;
|
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
|
|
|
android::sp<android::GraphicBuffer> mGraphicBuffer;
|
2013-04-17 13:56:03 -07:00
|
|
|
GLenum mTextureTarget;
|
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
|
|
|
EGLImage mEGLImage;
|
2013-06-11 03:14:33 -07:00
|
|
|
//Set when the composer needs to swap RB pixels of gralloc buffer
|
|
|
|
bool mIsRBSwapped;
|
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
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif /* MOZILLA_GFX_TEXTUREOGL_H */
|