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 13:20:52 +04: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_TEXTURECLIENT_H
|
|
|
|
#define MOZILLA_GFX_TEXTURECLIENT_H
|
|
|
|
|
2013-08-12 03:17:23 +04:00
|
|
|
#include <stddef.h> // for size_t
|
|
|
|
#include <stdint.h> // for uint32_t, uint8_t, uint64_t
|
2013-09-04 16:14:52 +04:00
|
|
|
#include "GLContextTypes.h" // for GLContext (ptr only), etc
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "GLTextureImage.h" // for TextureImage
|
|
|
|
#include "ImageTypes.h" // for StereoMode
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr, RefCounted
|
|
|
|
#include "mozilla/gfx/2D.h" // for DrawTarget
|
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
|
|
|
#include "mozilla/gfx/Types.h" // for SurfaceFormat
|
|
|
|
#include "mozilla/ipc/Shmem.h" // for Shmem
|
2014-01-21 22:53:48 +04:00
|
|
|
#include "mozilla/layers/AtomicRefCountedWithFinalize.h"
|
2013-08-12 03:17:23 +04:00
|
|
|
#include "mozilla/layers/CompositorTypes.h" // for TextureFlags, etc
|
|
|
|
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
|
|
|
#include "mozilla/mozalloc.h" // for operator delete
|
|
|
|
#include "nsAutoPtr.h" // for nsRefPtr
|
|
|
|
#include "nsCOMPtr.h" // for already_AddRefed
|
|
|
|
#include "nsISupportsImpl.h" // for TextureImage::AddRef, 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 13:20:52 +04:00
|
|
|
|
|
|
|
class gfxReusableSurfaceWrapper;
|
2013-09-25 00:45:14 +04:00
|
|
|
class gfxASurface;
|
|
|
|
class gfxImageSurface;
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
class ContentClient;
|
|
|
|
class CompositableForwarder;
|
2013-07-30 13:59:51 +04:00
|
|
|
class ISurfaceAllocator;
|
|
|
|
class CompositableClient;
|
2013-10-02 04:57:50 +04:00
|
|
|
class PlanarYCbCrImage;
|
|
|
|
class PlanarYCbCrData;
|
|
|
|
class Image;
|
2013-12-12 05:44:44 +04:00
|
|
|
class PTextureChild;
|
|
|
|
class TextureChild;
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureClient is the abstraction that allows us to share data between the
|
|
|
|
* content and the compositor side.
|
2013-08-08 16:53:12 +04:00
|
|
|
* TextureClient can also provide with some more "producer" facing APIs
|
2013-07-30 13:59:51 +04:00
|
|
|
* such as TextureClientSurface and TextureClientYCbCr, that can be queried
|
|
|
|
* using AsTextureCLientSurface(), etc.
|
|
|
|
*/
|
|
|
|
|
2013-12-05 22:39:22 +04:00
|
|
|
enum TextureAllocationFlags {
|
|
|
|
ALLOC_DEFAULT = 0,
|
|
|
|
ALLOC_CLEAR_BUFFER = 1
|
|
|
|
};
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
/**
|
|
|
|
* Interface for TextureClients that can be updated using a gfxASurface.
|
|
|
|
*/
|
|
|
|
class TextureClientSurface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual bool UpdateSurface(gfxASurface* aSurface) = 0;
|
2013-08-03 21:29:37 +04:00
|
|
|
virtual already_AddRefed<gfxASurface> GetAsSurface() = 0;
|
2013-12-05 22:39:22 +04:00
|
|
|
/**
|
|
|
|
* Allocates for a given surface size, taking into account the pixel format
|
|
|
|
* which is part of the state of the TextureClient.
|
|
|
|
*
|
|
|
|
* Does not clear the surface by default, clearing the surface can be done
|
|
|
|
* by passing the CLEAR_BUFFER flag.
|
|
|
|
*/
|
|
|
|
virtual bool AllocateForSurface(gfx::IntSize aSize,
|
|
|
|
TextureAllocationFlags flags = ALLOC_DEFAULT) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface for TextureClients that can be updated using a DrawTarget.
|
|
|
|
*/
|
|
|
|
class TextureClientDrawTarget
|
|
|
|
{
|
|
|
|
public:
|
2014-02-05 00:32:02 +04:00
|
|
|
/**
|
|
|
|
* Returns a DrawTarget to draw into the TextureClient.
|
|
|
|
*
|
|
|
|
* This must never be called on a TextureClient that is not sucessfully locked.
|
|
|
|
* When called several times within one Lock/Unlock pair, this method should
|
|
|
|
* return the same DrawTarget.
|
|
|
|
* The DrawTarget is automatically flushed by the TextureClient when the latter
|
|
|
|
* is unlocked, and the DrawTarget that will be returned within the next
|
|
|
|
* lock/unlock pair may or may not be the same object.
|
|
|
|
* Do not keep references to the DrawTarget outside of the lock/unlock pair.
|
|
|
|
*
|
|
|
|
* This is typically used as follows:
|
|
|
|
*
|
|
|
|
* if (!texture->Lock(OPEN_READ_WRITE)) {
|
|
|
|
* return false;
|
|
|
|
* }
|
|
|
|
* {
|
|
|
|
* // Restrict this code's scope to ensure all references to dt are gone
|
|
|
|
* // when Unlock is called.
|
|
|
|
* RefPtr<DrawTarget> dt = texture->AsTextureClientDrawTarget()->GetAsDrawTarget();
|
|
|
|
* // use the draw target ...
|
|
|
|
* }
|
|
|
|
* texture->Unlock();
|
|
|
|
*
|
|
|
|
*/
|
2013-12-05 22:39:22 +04:00
|
|
|
virtual TemporaryRef<gfx::DrawTarget> GetAsDrawTarget() = 0;
|
|
|
|
virtual gfx::SurfaceFormat GetFormat() const = 0;
|
|
|
|
/**
|
|
|
|
* Allocates for a given surface size, taking into account the pixel format
|
|
|
|
* which is part of the state of the TextureClient.
|
|
|
|
*
|
|
|
|
* Does not clear the surface by default, clearing the surface can be done
|
|
|
|
* by passing the CLEAR_BUFFER flag.
|
|
|
|
*/
|
|
|
|
virtual bool AllocateForSurface(gfx::IntSize aSize,
|
|
|
|
TextureAllocationFlags flags = ALLOC_DEFAULT) = 0;
|
2013-11-28 01:16:34 +04:00
|
|
|
};
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
/**
|
|
|
|
* Interface for TextureClients that can be updated using YCbCr data.
|
|
|
|
*/
|
|
|
|
class TextureClientYCbCr
|
|
|
|
{
|
|
|
|
public:
|
2014-02-05 00:32:02 +04:00
|
|
|
/**
|
|
|
|
* Copy aData into this texture client.
|
|
|
|
*
|
|
|
|
* This must never be called on a TextureClient that is not sucessfully locked.
|
|
|
|
*/
|
2013-10-02 04:57:50 +04:00
|
|
|
virtual bool UpdateYCbCr(const PlanarYCbCrData& aData) = 0;
|
2014-02-05 00:32:02 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Allocates for a given surface size, taking into account the pixel format
|
|
|
|
* which is part of the state of the TextureClient.
|
|
|
|
*
|
|
|
|
* Does not clear the surface, since we consider that the surface
|
|
|
|
* be painted entirely with opaque content.
|
|
|
|
*/
|
2013-08-04 11:46:17 +04:00
|
|
|
virtual bool AllocateForYCbCr(gfx::IntSize aYSize,
|
|
|
|
gfx::IntSize aCbCrSize,
|
|
|
|
StereoMode aStereoMode) = 0;
|
2013-07-30 13:59:51 +04:00
|
|
|
};
|
|
|
|
|
2013-09-12 18:50:28 +04:00
|
|
|
/**
|
|
|
|
* Holds the shared data of a TextureClient, to be destroyed later.
|
|
|
|
*
|
|
|
|
* TextureClient's destructor initiates the destruction sequence of the
|
|
|
|
* texture client/host pair. If the shared data is to be deallocated on the
|
|
|
|
* host side, there is nothing to do.
|
|
|
|
* On the other hand, if the client data must be deallocated on the client
|
|
|
|
* side, the CompositableClient will ask the TextureClient to drop its shared
|
2013-12-12 05:44:45 +04:00
|
|
|
* data in the form of a TextureClientData object. This data will be kept alive
|
|
|
|
* until the host side confirms that it is not using the data anymore and that
|
|
|
|
* it is completely safe to deallocate the shared data.
|
2013-09-12 18:50:28 +04:00
|
|
|
*
|
|
|
|
* See:
|
2013-12-12 05:44:45 +04:00
|
|
|
* - The PTexture IPDL protocol
|
|
|
|
* - CompositableChild in TextureClient.cpp
|
2013-09-12 18:50:28 +04:00
|
|
|
*/
|
|
|
|
class TextureClientData {
|
|
|
|
public:
|
|
|
|
virtual void DeallocateSharedData(ISurfaceAllocator* allocator) = 0;
|
|
|
|
virtual ~TextureClientData() {}
|
|
|
|
};
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureClient is a thin abstraction over texture data that need to be shared
|
|
|
|
* between the content process and the compositor process. It is the
|
|
|
|
* content-side half of a TextureClient/TextureHost pair. A corresponding
|
|
|
|
* TextureHost lives on the compositor-side.
|
|
|
|
*
|
|
|
|
* TextureClient's primary purpose is to present texture data in a way that is
|
|
|
|
* understood by the IPC system. There are two ways to use it:
|
|
|
|
* - Use it to serialize image data that is not IPC-friendly (most likely
|
|
|
|
* involving a copy into shared memory)
|
|
|
|
* - preallocate it and paint directly into it, which avoids copy but requires
|
2013-08-08 16:53:12 +04:00
|
|
|
* the painting code to be aware of TextureClient (or at least the underlying
|
|
|
|
* shared memory).
|
2013-07-30 13:59:51 +04:00
|
|
|
*
|
|
|
|
* There is always one and only one TextureClient per TextureHost, and the
|
|
|
|
* TextureClient/Host pair only owns one buffer of image data through its
|
2013-08-08 16:53:12 +04:00
|
|
|
* lifetime. This means that the lifetime of the underlying shared data
|
2013-07-30 13:59:51 +04:00
|
|
|
* matches the lifetime of the TextureClient/Host pair. It also means
|
|
|
|
* TextureClient/Host do not implement double buffering, which is the
|
|
|
|
* responsibility of the compositable (which would use two Texture pairs).
|
|
|
|
* In order to send several different buffers to the compositor side, use
|
|
|
|
* several TextureClients.
|
|
|
|
*/
|
2013-12-12 05:44:40 +04:00
|
|
|
class TextureClient
|
2013-12-12 05:45:11 +04:00
|
|
|
: public AtomicRefCountedWithFinalize<TextureClient>
|
2013-07-30 13:59:51 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
TextureClient(TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
|
|
|
|
virtual ~TextureClient();
|
|
|
|
|
|
|
|
virtual TextureClientSurface* AsTextureClientSurface() { return nullptr; }
|
2013-12-05 22:39:22 +04:00
|
|
|
virtual TextureClientDrawTarget* AsTextureClientDrawTarget() { return nullptr; }
|
2013-07-30 13:59:51 +04:00
|
|
|
virtual TextureClientYCbCr* AsTextureClientYCbCr() { return nullptr; }
|
|
|
|
|
2013-09-30 16:42:47 +04:00
|
|
|
/**
|
|
|
|
* Locks the shared data, allowing the caller to get access to it.
|
|
|
|
*
|
|
|
|
* Please always lock/unlock when accessing the shared data.
|
|
|
|
* If Lock() returns false, you should not attempt to access the shared data.
|
|
|
|
*/
|
|
|
|
virtual bool Lock(OpenMode aMode) { return IsValid(); }
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
virtual void Unlock() {}
|
|
|
|
|
2014-01-24 18:25:04 +04:00
|
|
|
virtual bool IsLocked() const = 0;
|
|
|
|
|
2013-08-26 16:50:16 +04:00
|
|
|
/**
|
|
|
|
* Returns true if this texture has a lock/unlock mechanism.
|
|
|
|
* Textures that do not implement locking should be immutable or should
|
|
|
|
* use immediate uploads (see TextureFlags in CompositorTypes.h)
|
|
|
|
*/
|
2013-09-30 16:42:47 +04:00
|
|
|
virtual bool ImplementsLocking() const { return false; }
|
2013-08-26 16:50:16 +04:00
|
|
|
|
2013-12-12 05:44:44 +04:00
|
|
|
/**
|
|
|
|
* Allocate and deallocate a TextureChild actor.
|
|
|
|
*
|
|
|
|
* TextureChild is an implementation detail of TextureHost that is not
|
|
|
|
* exposed to the rest of the code base. CreateIPDLActor and DestroyIPDLActor
|
|
|
|
* are for use with the maging IPDL protocols only (so that they can
|
|
|
|
* implement AllocPextureChild and DeallocPTextureChild).
|
|
|
|
*/
|
|
|
|
static PTextureChild* CreateIPDLActor();
|
|
|
|
static bool DestroyIPDLActor(PTextureChild* actor);
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
virtual bool IsAllocated() const = 0;
|
|
|
|
|
|
|
|
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor) = 0;
|
|
|
|
|
2013-08-03 21:29:18 +04:00
|
|
|
virtual gfx::IntSize GetSize() const = 0;
|
|
|
|
|
2013-09-30 16:42:47 +04:00
|
|
|
/**
|
|
|
|
* TextureFlags contain important information about various aspects
|
|
|
|
* of the texture, like how its liferime is managed, and how it
|
|
|
|
* should be displayed.
|
|
|
|
* See TextureFlags in CompositorTypes.h.
|
|
|
|
*/
|
2013-07-30 13:59:51 +04:00
|
|
|
TextureFlags GetFlags() const { return mFlags; }
|
|
|
|
|
|
|
|
/**
|
2013-08-08 16:53:12 +04:00
|
|
|
* After being shared with the compositor side, an immutable texture is never
|
2013-07-30 13:59:51 +04:00
|
|
|
* modified, it can only be read. It is safe to not Lock/Unlock immutable
|
|
|
|
* textures.
|
|
|
|
*/
|
|
|
|
bool IsImmutable() const { return mFlags & TEXTURE_IMMUTABLE; }
|
|
|
|
|
|
|
|
void MarkImmutable() { AddFlags(TEXTURE_IMMUTABLE); }
|
|
|
|
|
2013-08-28 00:16:03 +04:00
|
|
|
bool IsSharedWithCompositor() const { return mShared; }
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
bool ShouldDeallocateInDestructor() const;
|
2013-09-06 13:04:50 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If this method returns false users of TextureClient are not allowed
|
|
|
|
* to access the shared data.
|
|
|
|
*/
|
|
|
|
bool IsValid() const { return mValid; }
|
|
|
|
|
2013-12-12 05:44:44 +04:00
|
|
|
/**
|
|
|
|
* Create and init the TextureChild/Parent IPDL actor pair.
|
|
|
|
*
|
|
|
|
* Should be called only once per TextureClient.
|
|
|
|
*/
|
|
|
|
bool InitIPDLActor(CompositableForwarder* aForwarder);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a pointer to the IPDLActor.
|
|
|
|
*
|
|
|
|
* This is to be used with IPDL messages only. Do not store the returned
|
|
|
|
* pointer.
|
|
|
|
*/
|
|
|
|
PTextureChild* GetIPDLActor();
|
|
|
|
|
2013-12-12 05:44:45 +04:00
|
|
|
/**
|
2014-02-05 00:32:02 +04:00
|
|
|
* Triggers the destruction of the shared data and the corresponding TextureHost.
|
|
|
|
*
|
|
|
|
* If the texture flags contain TEXTURE_DEALLOCATE_CLIENT, the destruction
|
|
|
|
* will be synchronously coordinated with the compositor side, otherwise it
|
|
|
|
* will be done asynchronously.
|
2013-12-12 05:44:45 +04:00
|
|
|
*/
|
|
|
|
void ForceRemove();
|
|
|
|
|
2013-12-12 05:44:40 +04:00
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* Called once, just before the destructor.
|
|
|
|
*
|
|
|
|
* Here goes the shut-down code that uses virtual methods.
|
|
|
|
* Must only be called by Release().
|
|
|
|
*/
|
2013-12-12 05:44:45 +04:00
|
|
|
void Finalize();
|
2013-12-12 05:44:40 +04:00
|
|
|
|
2013-12-12 05:45:11 +04:00
|
|
|
friend class AtomicRefCountedWithFinalize<TextureClient>;
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
protected:
|
2014-02-05 00:32:02 +04:00
|
|
|
/**
|
|
|
|
* An invalid TextureClient cannot provide access to its shared data
|
|
|
|
* anymore. This usually means it will soon be destroyed.
|
|
|
|
*/
|
|
|
|
void MarkInvalid() { mValid = false; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Drop the shared data into a TextureClientData object and mark this
|
|
|
|
* TextureClient as invalid.
|
|
|
|
*
|
|
|
|
* The TextureClient must not hold any reference to the shared data
|
|
|
|
* after this method has been called.
|
|
|
|
* The TextureClientData is owned by the caller.
|
|
|
|
*/
|
|
|
|
virtual TextureClientData* DropTextureData() = 0;
|
|
|
|
|
2013-08-03 21:30:28 +04:00
|
|
|
void AddFlags(TextureFlags aFlags)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(!IsSharedWithCompositor());
|
|
|
|
mFlags |= aFlags;
|
|
|
|
}
|
|
|
|
|
2013-12-21 01:44:30 +04:00
|
|
|
RefPtr<TextureChild> mActor;
|
2013-07-30 13:59:51 +04:00
|
|
|
TextureFlags mFlags;
|
2013-08-28 00:16:03 +04:00
|
|
|
bool mShared;
|
2013-09-06 13:04:50 +04:00
|
|
|
bool mValid;
|
2013-12-12 05:44:55 +04:00
|
|
|
|
|
|
|
friend class TextureChild;
|
2013-07-30 13:59:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureClient that wraps a random access buffer such as a Shmem or raw memory.
|
|
|
|
* This class must be inherited to implement the memory allocation and access bits.
|
|
|
|
* (see ShmemTextureClient and MemoryTextureClient)
|
|
|
|
*/
|
|
|
|
class BufferTextureClient : public TextureClient
|
|
|
|
, public TextureClientSurface
|
2013-12-05 22:39:22 +04:00
|
|
|
, public TextureClientYCbCr
|
|
|
|
, public TextureClientDrawTarget
|
2013-07-30 13:59:51 +04:00
|
|
|
{
|
|
|
|
public:
|
2013-08-03 21:30:28 +04:00
|
|
|
BufferTextureClient(CompositableClient* aCompositable, gfx::SurfaceFormat aFormat,
|
2014-02-19 21:17:49 +04:00
|
|
|
gfx::BackendType aBackend, TextureFlags aFlags);
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
virtual ~BufferTextureClient();
|
|
|
|
|
|
|
|
virtual bool IsAllocated() const = 0;
|
|
|
|
|
|
|
|
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor) = 0;
|
|
|
|
|
|
|
|
virtual uint8_t* GetBuffer() const = 0;
|
|
|
|
|
2013-08-03 21:29:18 +04:00
|
|
|
virtual gfx::IntSize GetSize() const { return mSize; }
|
|
|
|
|
2014-01-07 20:20:11 +04:00
|
|
|
virtual bool Lock(OpenMode aMode) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void Unlock() MOZ_OVERRIDE;
|
|
|
|
|
2014-01-24 18:25:04 +04:00
|
|
|
virtual bool IsLocked() const MOZ_OVERRIDE { return mLocked; }
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
// TextureClientSurface
|
|
|
|
|
|
|
|
virtual TextureClientSurface* AsTextureClientSurface() MOZ_OVERRIDE { return this; }
|
|
|
|
|
|
|
|
virtual bool UpdateSurface(gfxASurface* aSurface) MOZ_OVERRIDE;
|
|
|
|
|
2013-08-03 21:29:37 +04:00
|
|
|
virtual already_AddRefed<gfxASurface> GetAsSurface() MOZ_OVERRIDE;
|
|
|
|
|
2013-12-05 22:39:22 +04:00
|
|
|
virtual bool AllocateForSurface(gfx::IntSize aSize,
|
|
|
|
TextureAllocationFlags aFlags = ALLOC_DEFAULT) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// TextureClientDrawTarget
|
|
|
|
|
|
|
|
virtual TextureClientDrawTarget* AsTextureClientDrawTarget() MOZ_OVERRIDE { return this; }
|
|
|
|
|
|
|
|
virtual TemporaryRef<gfx::DrawTarget> GetAsDrawTarget() MOZ_OVERRIDE;
|
2013-11-28 01:16:34 +04:00
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
// TextureClientYCbCr
|
|
|
|
|
|
|
|
virtual TextureClientYCbCr* AsTextureClientYCbCr() MOZ_OVERRIDE { return this; }
|
|
|
|
|
2013-10-02 04:57:50 +04:00
|
|
|
virtual bool UpdateYCbCr(const PlanarYCbCrData& aData) MOZ_OVERRIDE;
|
2013-07-30 13:59:51 +04:00
|
|
|
|
2013-08-04 11:46:17 +04:00
|
|
|
virtual bool AllocateForYCbCr(gfx::IntSize aYSize,
|
|
|
|
gfx::IntSize aCbCrSize,
|
|
|
|
StereoMode aStereoMode) MOZ_OVERRIDE;
|
2013-07-30 13:59:51 +04:00
|
|
|
|
2013-12-05 22:39:22 +04:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE { return mFormat; }
|
2013-07-30 13:59:51 +04:00
|
|
|
|
2013-08-28 17:21:13 +04:00
|
|
|
// XXX - Bug 908196 - Make Allocate(uint32_t) and GetBufferSize() protected.
|
|
|
|
// these two methods should only be called by methods of BufferTextureClient
|
|
|
|
// that are overridden in GrallocTextureClient (which does not implement the
|
|
|
|
// two methods below)
|
|
|
|
virtual bool Allocate(uint32_t aSize) = 0;
|
|
|
|
|
|
|
|
virtual size_t GetBufferSize() const = 0;
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
protected:
|
2014-01-07 20:20:11 +04:00
|
|
|
RefPtr<gfx::DrawTarget> mDrawTarget;
|
2013-07-30 13:59:51 +04:00
|
|
|
CompositableClient* mCompositable;
|
|
|
|
gfx::SurfaceFormat mFormat;
|
2013-08-03 21:29:18 +04:00
|
|
|
gfx::IntSize mSize;
|
2014-02-19 21:17:49 +04:00
|
|
|
gfx::BackendType mBackend;
|
2014-01-07 20:20:11 +04:00
|
|
|
OpenMode mOpenMode;
|
|
|
|
bool mUsingFallbackDrawTarget;
|
|
|
|
bool mLocked;
|
2013-07-30 13:59:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureClient that wraps shared memory.
|
|
|
|
* the corresponding texture on the host side is ShmemTextureHost.
|
|
|
|
*/
|
|
|
|
class ShmemTextureClient : public BufferTextureClient
|
|
|
|
{
|
|
|
|
public:
|
2013-08-03 21:30:28 +04:00
|
|
|
ShmemTextureClient(CompositableClient* aCompositable, gfx::SurfaceFormat aFormat,
|
2014-02-19 21:17:49 +04:00
|
|
|
gfx::BackendType aBackend, TextureFlags aFlags);
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
~ShmemTextureClient();
|
|
|
|
|
|
|
|
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool Allocate(uint32_t aSize) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual uint8_t* GetBuffer() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual size_t GetBufferSize() const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool IsAllocated() const MOZ_OVERRIDE { return mAllocated; }
|
|
|
|
|
2013-09-12 18:50:28 +04:00
|
|
|
virtual TextureClientData* DropTextureData() MOZ_OVERRIDE;
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
ISurfaceAllocator* GetAllocator() const;
|
|
|
|
|
2014-01-23 18:31:12 +04:00
|
|
|
mozilla::ipc::Shmem& GetShmem() { return mShmem; }
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
protected:
|
2014-01-23 18:31:12 +04:00
|
|
|
mozilla::ipc::Shmem mShmem;
|
2013-12-03 22:44:38 +04:00
|
|
|
RefPtr<ISurfaceAllocator> mAllocator;
|
2013-07-30 13:59:51 +04:00
|
|
|
bool mAllocated;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TextureClient that wraps raw memory.
|
|
|
|
* The corresponding texture on the host side is MemoryTextureHost.
|
|
|
|
* Can obviously not be used in a cross process setup.
|
|
|
|
*/
|
|
|
|
class MemoryTextureClient : public BufferTextureClient
|
|
|
|
{
|
|
|
|
public:
|
2013-08-03 21:30:28 +04:00
|
|
|
MemoryTextureClient(CompositableClient* aCompositable, gfx::SurfaceFormat aFormat,
|
2014-02-19 21:17:49 +04:00
|
|
|
gfx::BackendType aBackend, TextureFlags aFlags);
|
2013-07-30 13:59:51 +04:00
|
|
|
|
|
|
|
~MemoryTextureClient();
|
|
|
|
|
|
|
|
virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual bool Allocate(uint32_t aSize) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual uint8_t* GetBuffer() const MOZ_OVERRIDE { return mBuffer; }
|
|
|
|
|
|
|
|
virtual size_t GetBufferSize() const MOZ_OVERRIDE { return mBufSize; }
|
|
|
|
|
|
|
|
virtual bool IsAllocated() const MOZ_OVERRIDE { return mBuffer != nullptr; }
|
|
|
|
|
2013-09-12 18:50:28 +04:00
|
|
|
virtual TextureClientData* DropTextureData() MOZ_OVERRIDE;
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
protected:
|
|
|
|
uint8_t* mBuffer;
|
|
|
|
size_t mBufSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TextureClientAutoUnlock
|
|
|
|
{
|
|
|
|
TextureClient* mTexture;
|
|
|
|
|
|
|
|
TextureClientAutoUnlock(TextureClient* aTexture)
|
|
|
|
: mTexture(aTexture) {}
|
|
|
|
|
|
|
|
~TextureClientAutoUnlock()
|
|
|
|
{
|
|
|
|
mTexture->Unlock();
|
|
|
|
}
|
|
|
|
};
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
/**
|
2013-07-09 01:30:44 +04:00
|
|
|
* XXX - This class is deprecated, will be removed soon.
|
|
|
|
*
|
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 13:20:52 +04:00
|
|
|
* This class allows texture clients to draw into textures through Azure or
|
|
|
|
* thebes and applies locking semantics to allow GPU or CPU level
|
|
|
|
* synchronization.
|
2013-07-09 01:30:44 +04:00
|
|
|
* DeprecatedTextureClient's purpose is for the texture data to be
|
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 13:20:52 +04:00
|
|
|
* forwarded to the right place on the compositor side and with correct locking
|
|
|
|
* semantics.
|
|
|
|
*
|
2013-07-09 01:30:44 +04:00
|
|
|
* When modifying a DeprecatedTextureClient's data, first call LockDescriptor, modify the
|
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 13:20:52 +04:00
|
|
|
* data in the descriptor, and then call Unlock. This makes sure that if the
|
|
|
|
* data is shared with the compositor, the later will not try to read while the
|
2013-07-09 01:30:44 +04:00
|
|
|
* data is being modified (on the other side, DeprecatedTextureHost also has Lock/Unlock
|
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 13:20:52 +04:00
|
|
|
* semantics).
|
|
|
|
* After unlocking, call Updated in order to add the modification to the current
|
|
|
|
* layer transaction.
|
|
|
|
* Depending on whether the data is shared or copied, Lock/Unlock and Updated
|
|
|
|
* can be no-ops. What's important is that the Client/Host pair implement the
|
|
|
|
* same semantics.
|
|
|
|
*
|
2013-07-09 01:30:44 +04:00
|
|
|
* Ownership of the surface descriptor depends on how the DeprecatedTextureClient/Host is
|
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 13:20:52 +04:00
|
|
|
* used by the CompositableClient/Host.
|
|
|
|
*/
|
2013-07-09 01:30:44 +04:00
|
|
|
class DeprecatedTextureClient : public RefCounted<DeprecatedTextureClient>
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef gl::SharedTextureHandle SharedTextureHandle;
|
|
|
|
typedef gl::GLContext GLContext;
|
|
|
|
typedef gl::TextureImage TextureImage;
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
virtual ~DeprecatedTextureClient();
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
/* This will return an identifier that can be sent accross a process or
|
2013-07-09 01:30:44 +04:00
|
|
|
* thread boundary and used to construct a DeprecatedTextureHost object
|
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 13:20:52 +04:00
|
|
|
* which can then be used as a texture for rendering by a compatible
|
|
|
|
* compositor. This texture should have been created with the
|
2013-07-09 01:30:44 +04:00
|
|
|
* DeprecatedTextureHostIdentifier specified by the compositor that this identifier
|
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 13:20:52 +04:00
|
|
|
* is to be used with.
|
|
|
|
*/
|
|
|
|
virtual const TextureInfo& GetTextureInfo() const
|
|
|
|
{
|
|
|
|
return mTextureInfo;
|
|
|
|
}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
virtual bool SupportsType(DeprecatedTextureClientType aType) { return false; }
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The Lock* methods lock the texture client for drawing into, providing some
|
|
|
|
* object that can be used for drawing to. Once the user is finished
|
|
|
|
* with the object it should call Unlock.
|
|
|
|
*/
|
|
|
|
virtual gfxImageSurface* LockImageSurface() { return nullptr; }
|
|
|
|
virtual gfxASurface* LockSurface() { return nullptr; }
|
2013-08-09 03:32:19 +04:00
|
|
|
// If you implement LockDrawTarget, you MUST implement BackendType()
|
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 13:20:52 +04:00
|
|
|
virtual gfx::DrawTarget* LockDrawTarget() { return nullptr; }
|
|
|
|
|
2013-08-09 03:32:19 +04:00
|
|
|
// The type of draw target returned by LockDrawTarget.
|
|
|
|
virtual gfx::BackendType BackendType()
|
|
|
|
{
|
2014-01-10 23:06:16 +04:00
|
|
|
return gfx::BackendType::NONE;
|
2013-08-09 03:32:19 +04: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 13:20:52 +04:00
|
|
|
virtual void ReleaseResources() {}
|
|
|
|
/**
|
|
|
|
* This unlocks the current DrawableTexture and allows the host to composite
|
|
|
|
* it directly.
|
|
|
|
*/
|
|
|
|
virtual void Unlock() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Ensure that the texture client is suitable for the given size and content
|
|
|
|
* type and that any initialisation has taken place.
|
2013-08-04 11:46:17 +04:00
|
|
|
* Returns true if succeeded, false if failed.
|
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 13:20:52 +04:00
|
|
|
*/
|
2013-08-04 11:46:17 +04:00
|
|
|
virtual bool EnsureAllocated(gfx::IntSize aSize,
|
2013-09-25 00:45:13 +04:00
|
|
|
gfxContentType aType) = 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 13:20:52 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* _Only_ used at the end of the layer transaction when receiving a reply from
|
|
|
|
* the compositor.
|
|
|
|
*/
|
|
|
|
virtual void SetDescriptorFromReply(const SurfaceDescriptor& aDescriptor)
|
|
|
|
{
|
2013-04-12 11:28:55 +04:00
|
|
|
// default implementation
|
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 13:20:52 +04:00
|
|
|
SetDescriptor(aDescriptor);
|
|
|
|
}
|
|
|
|
virtual void SetDescriptor(const SurfaceDescriptor& aDescriptor)
|
|
|
|
{
|
|
|
|
mDescriptor = aDescriptor;
|
|
|
|
}
|
2013-04-12 11:28:55 +04:00
|
|
|
SurfaceDescriptor* GetDescriptor() { return &mDescriptor; }
|
2013-09-24 05:14:12 +04:00
|
|
|
/**
|
|
|
|
* Use LockSurfaceDescriptor to get the descriptor if it will be sent across IPC.
|
|
|
|
* Use GetDescriptor if you want to keep the descriptor on one thread.
|
|
|
|
*/
|
|
|
|
virtual SurfaceDescriptor* LockSurfaceDescriptor() { return GetDescriptor(); }
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
CompositableForwarder* GetForwarder() const
|
|
|
|
{
|
|
|
|
return mForwarder;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetFlags(TextureFlags aFlags)
|
|
|
|
{
|
|
|
|
mTextureInfo.mTextureFlags = aFlags;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum AccessMode
|
|
|
|
{
|
|
|
|
ACCESS_NONE = 0x0,
|
|
|
|
ACCESS_READ_ONLY = 0x1,
|
|
|
|
ACCESS_READ_WRITE = 0x2
|
|
|
|
};
|
|
|
|
|
|
|
|
void SetAccessMode(AccessMode aAccessMode)
|
|
|
|
{
|
|
|
|
mAccessMode = aAccessMode;
|
|
|
|
}
|
|
|
|
|
|
|
|
AccessMode GetAccessMode() const
|
|
|
|
{
|
|
|
|
return mAccessMode;
|
|
|
|
}
|
|
|
|
|
2013-09-25 00:45:13 +04:00
|
|
|
virtual gfxContentType GetContentType() = 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 13:20:52 +04:00
|
|
|
|
|
|
|
protected:
|
2013-07-09 01:30:44 +04:00
|
|
|
DeprecatedTextureClient(CompositableForwarder* aForwarder,
|
2013-04-12 11:28:55 +04:00
|
|
|
const TextureInfo& aTextureInfo);
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
CompositableForwarder* mForwarder;
|
2013-07-09 01:30:44 +04:00
|
|
|
// So far all DeprecatedTextureClients use a SurfaceDescriptor, so it makes sense to
|
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 13:20:52 +04:00
|
|
|
// keep the reference here.
|
|
|
|
SurfaceDescriptor mDescriptor;
|
|
|
|
TextureInfo mTextureInfo;
|
|
|
|
AccessMode mAccessMode;
|
|
|
|
};
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
class DeprecatedTextureClientShmem : public DeprecatedTextureClient
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
public:
|
2013-07-09 01:30:44 +04:00
|
|
|
DeprecatedTextureClientShmem(CompositableForwarder* aForwarder, const TextureInfo& aTextureInfo);
|
2013-09-25 00:45:14 +04:00
|
|
|
~DeprecatedTextureClientShmem();
|
2013-07-09 01:30:44 +04:00
|
|
|
virtual bool SupportsType(DeprecatedTextureClientType aType) 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 13:20:52 +04:00
|
|
|
{
|
2013-08-04 11:46:17 +04:00
|
|
|
return aType == TEXTURE_SHMEM || aType == TEXTURE_CONTENT || aType == TEXTURE_FALLBACK;
|
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 13:20:52 +04:00
|
|
|
}
|
|
|
|
virtual gfxImageSurface* LockImageSurface() MOZ_OVERRIDE;
|
|
|
|
virtual gfxASurface* LockSurface() MOZ_OVERRIDE { return GetSurface(); }
|
2013-07-29 02:12:37 +04:00
|
|
|
virtual gfx::DrawTarget* LockDrawTarget();
|
2013-08-09 03:32:19 +04:00
|
|
|
virtual gfx::BackendType BackendType() MOZ_OVERRIDE
|
|
|
|
{
|
2014-01-10 23:06:16 +04:00
|
|
|
return gfx::BackendType::CAIRO;
|
2013-08-09 03:32:19 +04: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 13:20:52 +04:00
|
|
|
virtual void Unlock() MOZ_OVERRIDE;
|
2013-09-25 00:45:13 +04:00
|
|
|
virtual bool EnsureAllocated(gfx::IntSize aSize, gfxContentType aType) 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 13:20:52 +04:00
|
|
|
|
|
|
|
virtual void ReleaseResources() MOZ_OVERRIDE;
|
|
|
|
virtual void SetDescriptor(const SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE;
|
2013-09-25 00:45:13 +04:00
|
|
|
virtual gfxContentType GetContentType() MOZ_OVERRIDE { return mContentType; }
|
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 13:20:52 +04:00
|
|
|
private:
|
|
|
|
gfxASurface* GetSurface();
|
|
|
|
|
|
|
|
nsRefPtr<gfxASurface> mSurface;
|
|
|
|
nsRefPtr<gfxImageSurface> mSurfaceAsImage;
|
2013-07-29 02:12:37 +04:00
|
|
|
RefPtr<gfx::DrawTarget> mDrawTarget;
|
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 13:20:52 +04:00
|
|
|
|
2013-09-25 00:45:13 +04:00
|
|
|
gfxContentType mContentType;
|
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 13:20:52 +04:00
|
|
|
gfx::IntSize mSize;
|
|
|
|
|
|
|
|
friend class CompositingFactory;
|
|
|
|
};
|
|
|
|
|
2013-07-30 13:59:51 +04:00
|
|
|
// XXX - this class can be removed as soon as we remove DeprecatedImageClientSingle
|
2013-07-09 01:30:44 +04:00
|
|
|
class DeprecatedTextureClientShmemYCbCr : public DeprecatedTextureClient
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
public:
|
2013-07-09 01:30:44 +04:00
|
|
|
DeprecatedTextureClientShmemYCbCr(CompositableForwarder* aForwarder, const TextureInfo& aTextureInfo)
|
|
|
|
: DeprecatedTextureClient(aForwarder, aTextureInfo)
|
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 13:20:52 +04:00
|
|
|
{ }
|
2013-07-09 01:30:44 +04:00
|
|
|
~DeprecatedTextureClientShmemYCbCr() { ReleaseResources(); }
|
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 13:20:52 +04:00
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
virtual bool SupportsType(DeprecatedTextureClientType aType) MOZ_OVERRIDE { return aType == TEXTURE_YCBCR; }
|
2013-09-25 00:45:13 +04:00
|
|
|
bool EnsureAllocated(gfx::IntSize aSize, gfxContentType aType) 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 13:20:52 +04:00
|
|
|
virtual void SetDescriptorFromReply(const SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE;
|
|
|
|
virtual void SetDescriptor(const SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE;
|
|
|
|
virtual void ReleaseResources();
|
2014-01-23 22:26:40 +04:00
|
|
|
virtual gfxContentType GetContentType() MOZ_OVERRIDE { return gfxContentType::COLOR_ALPHA; }
|
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 13:20:52 +04:00
|
|
|
};
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
class DeprecatedTextureClientTile : public DeprecatedTextureClient
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
public:
|
2013-07-09 01:30:44 +04:00
|
|
|
DeprecatedTextureClientTile(const DeprecatedTextureClientTile& aOther);
|
|
|
|
DeprecatedTextureClientTile(CompositableForwarder* aForwarder,
|
2013-08-19 17:59:22 +04:00
|
|
|
const TextureInfo& aTextureInfo,
|
|
|
|
gfxReusableSurfaceWrapper* aSurface = nullptr);
|
2013-07-09 01:30:44 +04:00
|
|
|
~DeprecatedTextureClientTile();
|
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 13:20:52 +04:00
|
|
|
|
2013-08-04 11:46:17 +04:00
|
|
|
virtual bool EnsureAllocated(gfx::IntSize aSize,
|
2013-09-25 00:45:13 +04:00
|
|
|
gfxContentType aType) 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 13:20:52 +04:00
|
|
|
|
|
|
|
virtual gfxImageSurface* LockImageSurface() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
gfxReusableSurfaceWrapper* GetReusableSurfaceWrapper()
|
|
|
|
{
|
|
|
|
return mSurface;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void SetDescriptor(const SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(false, "Tiled texture clients don't use SurfaceDescriptors.");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-09-25 00:45:13 +04:00
|
|
|
virtual gfxContentType GetContentType() { return mContentType; }
|
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 13:20:52 +04:00
|
|
|
|
|
|
|
private:
|
2013-09-25 00:45:13 +04:00
|
|
|
gfxContentType mContentType;
|
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 13:20:52 +04:00
|
|
|
nsRefPtr<gfxReusableSurfaceWrapper> mSurface;
|
|
|
|
|
|
|
|
friend class CompositingFactory;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base class for AutoLock*Client.
|
|
|
|
* handles lock/unlock
|
2013-07-30 13:59:51 +04:00
|
|
|
* XXX - this can be removed as soon as we remove DeprecatedImageClientSingle
|
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 13:20:52 +04:00
|
|
|
*/
|
2013-07-09 01:30:44 +04:00
|
|
|
class AutoLockDeprecatedTextureClient
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
public:
|
2013-07-09 01:30:44 +04:00
|
|
|
AutoLockDeprecatedTextureClient(DeprecatedTextureClient* aTexture)
|
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 13:20:52 +04:00
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
mDeprecatedTextureClient = aTexture;
|
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 13:20:52 +04:00
|
|
|
mDescriptor = aTexture->LockSurfaceDescriptor();
|
|
|
|
}
|
|
|
|
|
|
|
|
SurfaceDescriptor* GetSurfaceDescriptor()
|
|
|
|
{
|
|
|
|
return mDescriptor;
|
|
|
|
}
|
|
|
|
|
2013-07-09 01:30:44 +04:00
|
|
|
virtual ~AutoLockDeprecatedTextureClient()
|
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 13:20:52 +04:00
|
|
|
{
|
2013-07-09 01:30:44 +04:00
|
|
|
mDeprecatedTextureClient->Unlock();
|
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 13:20:52 +04:00
|
|
|
}
|
|
|
|
protected:
|
2013-07-09 01:30:44 +04:00
|
|
|
DeprecatedTextureClient* mDeprecatedTextureClient;
|
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 13:20:52 +04:00
|
|
|
SurfaceDescriptor* mDescriptor;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes the content of a PlanarYCbCrImage into a SurfaceDescriptor.
|
2013-07-30 13:59:51 +04:00
|
|
|
* XXX - this can be removed as soon as we remove DeprecatedImageClientSingle
|
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 13:20:52 +04:00
|
|
|
*/
|
2013-07-09 01:30:44 +04:00
|
|
|
class AutoLockYCbCrClient : public AutoLockDeprecatedTextureClient
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
public:
|
2013-07-09 01:30:44 +04:00
|
|
|
AutoLockYCbCrClient(DeprecatedTextureClient* aTexture) : AutoLockDeprecatedTextureClient(aTexture) {}
|
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 13:20:52 +04:00
|
|
|
bool Update(PlanarYCbCrImage* aImage);
|
|
|
|
protected:
|
2013-07-09 01:30:44 +04:00
|
|
|
bool EnsureDeprecatedTextureClient(PlanarYCbCrImage* aImage);
|
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 13:20:52 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes the content of a gfxASurface into a SurfaceDescriptor.
|
2013-07-30 13:59:51 +04:00
|
|
|
* XXX - this can be removed as soon as we remove DeprecatedImageClientSingle
|
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 13:20:52 +04:00
|
|
|
*/
|
2013-07-09 01:30:44 +04:00
|
|
|
class AutoLockShmemClient : public AutoLockDeprecatedTextureClient
|
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 13:20:52 +04:00
|
|
|
{
|
|
|
|
public:
|
2013-07-09 01:30:44 +04:00
|
|
|
AutoLockShmemClient(DeprecatedTextureClient* aTexture) : AutoLockDeprecatedTextureClient(aTexture) {}
|
2013-07-10 01:52:30 +04:00
|
|
|
bool Update(Image* aImage, uint32_t aContentFlags, gfxASurface *aSurface);
|
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 13:20:52 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|