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 09:20:52 +00: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 12:14:52 +00:00
|
|
|
#include "GLContextTypes.h" // for SharedTextureHandle, etc
|
2013-09-24 20:45:14 +00:00
|
|
|
#include "gfxTypes.h"
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
|
|
|
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
2014-04-03 06:04:04 +00:00
|
|
|
#include "mozilla/layers/TextureClient.h" // for TextureClient, etc
|
2013-08-12 02:21:17 +00:00
|
|
|
|
2014-01-10 13:06:06 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
|
|
|
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 09:20:52 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2013-08-11 23:17:23 +00:00
|
|
|
class CompositableForwarder;
|
|
|
|
|
2013-07-30 09:59:51 +00:00
|
|
|
/**
|
|
|
|
* A TextureClient implementation to share TextureMemory that is already
|
|
|
|
* on the GPU, for the OpenGL backend.
|
|
|
|
*/
|
|
|
|
class SharedTextureClientOGL : public TextureClient
|
|
|
|
{
|
|
|
|
public:
|
2013-08-27 20:16:54 +00:00
|
|
|
SharedTextureClientOGL(TextureFlags aFlags);
|
2013-07-30 09:59:51 +00:00
|
|
|
|
|
|
|
~SharedTextureClientOGL();
|
|
|
|
|
|
|
|
virtual bool IsAllocated() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-24 14:25:04 +00:00
|
|
|
virtual bool Lock(OpenMode mode) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void Unlock() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool IsLocked() const MOZ_OVERRIDE { return mIsLocked; }
|
|
|
|
|
2014-03-07 21:34:04 +00:00
|
|
|
virtual bool HasInternalBuffer() const MOZ_OVERRIDE { return false; }
|
|
|
|
|
2013-07-30 09:59:51 +00:00
|
|
|
void InitWith(gl::SharedTextureHandle aHandle,
|
|
|
|
gfx::IntSize aSize,
|
2013-09-04 12:14:52 +00:00
|
|
|
gl::SharedTextureShareType aShareType,
|
2013-07-30 09:59:51 +00:00
|
|
|
bool aInverted = false);
|
|
|
|
|
2013-08-03 17:29:18 +00:00
|
|
|
virtual gfx::IntSize GetSize() const { return mSize; }
|
2013-07-30 09:59:51 +00:00
|
|
|
|
2013-09-12 14:50:28 +00:00
|
|
|
virtual TextureClientData* DropTextureData() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
// XXX - right now the code paths using this are managing the shared texture
|
|
|
|
// data, although they should use a TextureClientData for this to ensure that
|
|
|
|
// the destruction sequence is race-free.
|
|
|
|
MarkInvalid();
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2013-07-30 09:59:51 +00:00
|
|
|
protected:
|
2013-08-27 17:07:33 +00:00
|
|
|
gl::SharedTextureHandle mHandle;
|
2013-08-27 20:16:54 +00:00
|
|
|
gfx::IntSize mSize;
|
2013-09-04 12:14:52 +00:00
|
|
|
gl::SharedTextureShareType mShareType;
|
2013-07-30 09:59:51 +00:00
|
|
|
bool mInverted;
|
2014-01-24 14:25:04 +00:00
|
|
|
bool mIsLocked;
|
2013-07-30 09:59:51 +00:00
|
|
|
};
|
|
|
|
|
2014-01-10 13:06:06 +00:00
|
|
|
/**
|
|
|
|
* A TextureClient implementation to share SurfaceStream.
|
|
|
|
*/
|
|
|
|
class StreamTextureClientOGL : public TextureClient
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StreamTextureClientOGL(TextureFlags aFlags);
|
|
|
|
|
|
|
|
~StreamTextureClientOGL();
|
|
|
|
|
|
|
|
virtual bool IsAllocated() const MOZ_OVERRIDE;
|
|
|
|
|
2014-01-24 14:25:04 +00:00
|
|
|
virtual bool Lock(OpenMode mode) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void Unlock() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool IsLocked() const MOZ_OVERRIDE { return mIsLocked; }
|
|
|
|
|
2014-01-10 13:06:06 +00:00
|
|
|
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual TextureClientData* DropTextureData() MOZ_OVERRIDE { return nullptr; }
|
|
|
|
|
2014-03-07 21:34:04 +00:00
|
|
|
virtual bool HasInternalBuffer() const MOZ_OVERRIDE { return false; }
|
|
|
|
|
2014-01-10 13:06:06 +00:00
|
|
|
void InitWith(gfx::SurfaceStream* aStream);
|
|
|
|
|
|
|
|
virtual gfx::IntSize GetSize() const { return gfx::IntSize(); }
|
|
|
|
|
|
|
|
protected:
|
2014-01-24 14:25:04 +00:00
|
|
|
bool mIsLocked;
|
2014-03-05 21:49:37 +00:00
|
|
|
RefPtr<gfx::SurfaceStream> mStream;
|
|
|
|
RefPtr<gl::GLContext> mGL;
|
2014-01-10 13:06:06 +00: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 09:20:52 +00:00
|
|
|
} // namespace
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|