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_TEXTURECLIENTOGL_H
|
|
|
|
#define MOZILLA_GFX_TEXTURECLIENTOGL_H
|
|
|
|
|
2013-09-04 05:14:52 -07:00
|
|
|
#include "GLContextTypes.h" // for SharedTextureHandle, etc
|
2014-11-26 13:16:07 -08:00
|
|
|
#include "GLImages.h"
|
2013-09-24 13:45:14 -07:00
|
|
|
#include "gfxTypes.h"
|
2015-03-21 09:28:04 -07:00
|
|
|
#include "mozilla/Attributes.h" // for override
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
|
|
|
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
2014-04-02 23:04:04 -07:00
|
|
|
#include "mozilla/layers/TextureClient.h" // for TextureClient, etc
|
2014-10-21 06:53:00 -07:00
|
|
|
#include "AndroidSurfaceTexture.h"
|
2013-08-11 19:21:17 -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 {
|
2014-10-21 06:53:00 -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 layers {
|
|
|
|
|
2014-09-17 06:13:29 -07:00
|
|
|
class EGLImageTextureClient : public TextureClient
|
2013-07-30 02:59:51 -07:00
|
|
|
{
|
|
|
|
public:
|
2014-12-22 00:49:00 -08:00
|
|
|
EGLImageTextureClient(ISurfaceAllocator* aAllocator,
|
|
|
|
TextureFlags aFlags,
|
2014-11-26 13:16:07 -08:00
|
|
|
EGLImageImage* aImage,
|
|
|
|
gfx::IntSize aSize);
|
2013-07-30 02:59:51 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool IsAllocated() const override { return true; }
|
2014-09-17 06:13:29 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool HasInternalBuffer() const override { return false; }
|
2014-09-17 06:13:29 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual gfx::IntSize GetSize() const override { return mSize; }
|
2013-07-30 02:59:51 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) override;
|
2013-07-30 02:59:51 -07:00
|
|
|
|
2014-09-17 06:13:29 -07:00
|
|
|
// Useless functions.
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool Lock(OpenMode mode) override;
|
2014-01-24 06:25:04 -08:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void Unlock() override;
|
2014-01-24 06:25:04 -08:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool IsLocked() const override { return mIsLocked; }
|
2014-01-24 06:25:04 -08:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const override
|
2014-09-17 06:13:29 -07:00
|
|
|
{
|
|
|
|
return gfx::SurfaceFormat::UNKNOWN;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual TemporaryRef<TextureClient>
|
|
|
|
CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT,
|
2015-03-21 09:28:04 -07:00
|
|
|
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override
|
2014-09-17 06:13:29 -07:00
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlags aFlags) override
|
2014-09-17 06:13:29 -07:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2014-11-26 13:16:07 -08:00
|
|
|
RefPtr<EGLImageImage> mImage;
|
2014-09-17 06:13:29 -07:00
|
|
|
const gfx::IntSize mSize;
|
|
|
|
bool mIsLocked;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
|
|
|
|
|
|
|
class SurfaceTextureClient : public TextureClient
|
|
|
|
{
|
|
|
|
public:
|
2014-12-22 00:49:00 -08:00
|
|
|
SurfaceTextureClient(ISurfaceAllocator* aAllocator,
|
|
|
|
TextureFlags aFlags,
|
2014-10-21 06:53:00 -07:00
|
|
|
gl::AndroidSurfaceTexture* aSurfTex,
|
2014-09-17 06:13:29 -07:00
|
|
|
gfx::IntSize aSize,
|
2014-11-17 17:02:19 -08:00
|
|
|
gl::OriginPos aOriginPos);
|
2014-09-17 06:13:29 -07:00
|
|
|
|
|
|
|
~SurfaceTextureClient();
|
2013-07-30 02:59:51 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool IsAllocated() const override { return true; }
|
2014-09-17 06:13:29 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool HasInternalBuffer() const override { return false; }
|
2014-09-12 11:39:20 -07:00
|
|
|
|
2014-09-12 12:01:26 -07:00
|
|
|
virtual gfx::IntSize GetSize() const { return mSize; }
|
2014-09-12 11:39:20 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) override;
|
2014-09-17 06:13:29 -07:00
|
|
|
|
|
|
|
// Useless functions.
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool Lock(OpenMode mode) override;
|
2014-09-17 06:13:29 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void Unlock() override;
|
2014-09-17 06:13:29 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool IsLocked() const override { return mIsLocked; }
|
2014-09-17 06:13:29 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const override
|
2014-04-10 01:14:28 -07:00
|
|
|
{
|
|
|
|
return gfx::SurfaceFormat::UNKNOWN;
|
|
|
|
}
|
|
|
|
|
2014-07-25 02:24:46 -07:00
|
|
|
virtual TemporaryRef<TextureClient>
|
2014-09-17 06:13:29 -07:00
|
|
|
CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT,
|
2015-03-21 09:28:04 -07:00
|
|
|
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override
|
2014-09-17 06:13:29 -07:00
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
2014-07-25 02:24:46 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlags aFlags) override
|
2014-04-10 01:14:28 -07:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-07-30 02:59:51 -07:00
|
|
|
protected:
|
2014-10-21 06:53:00 -07:00
|
|
|
const RefPtr<gl::AndroidSurfaceTexture> mSurfTex;
|
2014-09-17 06:13:29 -07:00
|
|
|
const gfx::IntSize mSize;
|
2014-01-24 06:25:04 -08:00
|
|
|
bool mIsLocked;
|
2013-07-30 02:59:51 -07:00
|
|
|
};
|
|
|
|
|
2014-09-17 06:13:29 -07:00
|
|
|
#endif // MOZ_WIDGET_ANDROID
|
|
|
|
|
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
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|