2017-10-27 23:10:06 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
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
|
|
|
* 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
|
2014-11-26 21:16:07 +00:00
|
|
|
#include "GLImages.h"
|
2013-09-24 20:45:14 +00:00
|
|
|
#include "gfxTypes.h"
|
2015-03-21 16:28:04 +00:00
|
|
|
#include "mozilla/Attributes.h" // for override
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
2018-03-06 15:25:39 +00:00
|
|
|
#include "mozilla/gfx/Types.h" // for SurfaceFormat
|
2013-08-11 23:17:23 +00:00
|
|
|
#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
|
2014-10-21 13:53:00 +00:00
|
|
|
#include "AndroidSurfaceTexture.h"
|
2017-10-28 10:59:58 +00:00
|
|
|
#include "AndroidNativeWindow.h"
|
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
|
|
|
# include "GeneratedJNIWrappers.h"
|
|
|
|
#endif
|
2013-08-12 02:21:17 +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 mozilla {
|
2014-10-21 13:53:00 +00:00
|
|
|
|
2018-03-06 15:25:39 +00:00
|
|
|
namespace gfx {
|
|
|
|
|
|
|
|
class DrawTarget;
|
|
|
|
|
|
|
|
} // namespace gfx
|
|
|
|
|
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 layers {
|
|
|
|
|
2014-09-17 13:13:29 +00:00
|
|
|
#ifdef MOZ_WIDGET_ANDROID
|
|
|
|
|
2015-11-20 13:24:52 +00:00
|
|
|
class AndroidSurfaceTextureData : public TextureData {
|
2014-09-17 13:13:29 +00:00
|
|
|
public:
|
2015-11-20 13:24:52 +00:00
|
|
|
static already_AddRefed<TextureClient> CreateTextureClient(
|
2017-03-03 21:14:27 +00:00
|
|
|
AndroidSurfaceTextureHandle aHandle, gfx::IntSize aSize, bool aContinuous,
|
2019-04-10 08:08:22 +00:00
|
|
|
gl::OriginPos aOriginPos, bool aHasAlpha, LayersIPCChannel* aAllocator,
|
2015-11-20 13:24:52 +00:00
|
|
|
TextureFlags aFlags);
|
2015-11-24 18:07:02 +00:00
|
|
|
|
2019-04-11 12:36:51 +00:00
|
|
|
virtual ~AndroidSurfaceTextureData();
|
2014-09-17 13:13:29 +00:00
|
|
|
|
2019-04-11 12:36:51 +00:00
|
|
|
void FillInfo(TextureData::Info& aInfo) const override;
|
2014-09-12 18:39:20 +00:00
|
|
|
|
2019-04-11 12:36:51 +00:00
|
|
|
bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
2014-09-17 13:13:29 +00:00
|
|
|
|
|
|
|
// Useless functions.
|
2019-04-11 12:36:51 +00:00
|
|
|
bool Lock(OpenMode) override { return true; }
|
2014-09-17 13:13:29 +00:00
|
|
|
|
2019-04-11 12:36:51 +00:00
|
|
|
void Unlock() override {}
|
2014-09-17 13:13:29 +00:00
|
|
|
|
2015-11-20 13:24:52 +00:00
|
|
|
// Our data is always owned externally.
|
2019-04-11 12:36:51 +00:00
|
|
|
void Deallocate(LayersIPCChannel*) override {}
|
2015-11-20 13:24:52 +00:00
|
|
|
|
2015-11-24 18:07:02 +00:00
|
|
|
protected:
|
2017-03-09 23:50:21 +00:00
|
|
|
AndroidSurfaceTextureData(AndroidSurfaceTextureHandle aHandle,
|
2019-04-10 08:08:22 +00:00
|
|
|
gfx::IntSize aSize, bool aContinuous,
|
|
|
|
bool aHasAlpha);
|
2015-11-20 13:24:52 +00:00
|
|
|
|
2017-03-03 21:14:27 +00:00
|
|
|
const AndroidSurfaceTextureHandle mHandle;
|
2014-09-17 13:13:29 +00:00
|
|
|
const gfx::IntSize mSize;
|
2017-03-09 23:50:21 +00:00
|
|
|
const bool mContinuous;
|
2019-04-10 08:08:22 +00:00
|
|
|
const bool mHasAlpha;
|
2013-07-30 09:59:51 +00:00
|
|
|
};
|
|
|
|
|
2017-10-28 10:59:58 +00:00
|
|
|
class AndroidNativeWindowTextureData : public TextureData {
|
|
|
|
public:
|
2018-03-06 15:25:39 +00:00
|
|
|
static AndroidNativeWindowTextureData* Create(gfx::IntSize aSize,
|
|
|
|
gfx::SurfaceFormat aFormat);
|
2017-10-28 10:59:58 +00:00
|
|
|
|
2019-04-11 12:36:51 +00:00
|
|
|
void FillInfo(TextureData::Info& aInfo) const override;
|
2017-10-28 10:59:58 +00:00
|
|
|
|
2019-04-11 12:36:51 +00:00
|
|
|
bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
|
2017-10-28 10:59:58 +00:00
|
|
|
|
2019-04-11 12:36:51 +00:00
|
|
|
bool Lock(OpenMode) override;
|
|
|
|
void Unlock() override;
|
2017-10-28 10:59:58 +00:00
|
|
|
|
2019-04-11 12:36:51 +00:00
|
|
|
void Forget(LayersIPCChannel*) override;
|
|
|
|
void Deallocate(LayersIPCChannel*) override {}
|
2017-10-28 10:59:58 +00:00
|
|
|
|
2019-04-11 12:36:51 +00:00
|
|
|
already_AddRefed<gfx::DrawTarget> BorrowDrawTarget() override;
|
2017-10-28 10:59:58 +00:00
|
|
|
|
2019-04-11 12:36:51 +00:00
|
|
|
void OnForwardedToHost() override;
|
2017-10-28 10:59:58 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
AndroidNativeWindowTextureData(java::GeckoSurface::Param aSurface,
|
|
|
|
gfx::IntSize aSize,
|
2018-03-06 15:25:39 +00:00
|
|
|
gfx::SurfaceFormat aFormat);
|
2017-10-28 10:59:58 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
java::GeckoSurface::GlobalRef mSurface;
|
|
|
|
ANativeWindow* mNativeWindow;
|
|
|
|
ANativeWindow_Buffer mBuffer;
|
|
|
|
// Keeps track of whether the underlying NativeWindow is actually locked.
|
|
|
|
bool mIsLocked;
|
|
|
|
|
|
|
|
const gfx::IntSize mSize;
|
2018-03-06 15:25:39 +00:00
|
|
|
const gfx::SurfaceFormat mFormat;
|
2017-10-28 10:59:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MOZ_WIDGET_ANDROID
|
|
|
|
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
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
|
|
|
|
|
|
|
#endif
|