Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_GFX_CONTENTCLIENT_H
|
|
|
|
#define MOZILLA_GFX_CONTENTCLIENT_H
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stdint.h> // for uint32_t
|
2013-11-26 16:29:46 -08:00
|
|
|
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
2013-09-24 13:45:14 -07:00
|
|
|
#include "gfxTypes.h"
|
2013-08-11 16:17:23 -07:00
|
|
|
#include "gfxPlatform.h" // for gfxPlatform
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_CRASH
|
|
|
|
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef
|
|
|
|
#include "mozilla/gfx/Point.h" // for IntSize
|
|
|
|
#include "mozilla/layers/CompositableClient.h" // for CompositableClient
|
|
|
|
#include "mozilla/layers/CompositableForwarder.h"
|
|
|
|
#include "mozilla/layers/CompositorTypes.h" // for TextureInfo, etc
|
|
|
|
#include "mozilla/layers/ISurfaceAllocator.h"
|
|
|
|
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
|
|
|
#include "mozilla/layers/TextureClient.h" // for DeprecatedTextureClient
|
|
|
|
#include "mozilla/mozalloc.h" // for operator delete
|
|
|
|
#include "nsCOMPtr.h" // for already_AddRefed
|
|
|
|
#include "nsPoint.h" // for nsIntPoint
|
|
|
|
#include "nsRect.h" // for nsIntRect
|
|
|
|
#include "nsRegion.h" // for nsIntRegion
|
|
|
|
#include "nsTArray.h" // for nsTArray
|
|
|
|
|
|
|
|
class gfxContext;
|
2013-09-24 13:45:14 -07:00
|
|
|
class gfxASurface;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
2013-08-11 16:17:23 -07:00
|
|
|
namespace gfx {
|
|
|
|
class DrawTarget;
|
|
|
|
}
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
class BasicLayerManager;
|
2013-08-11 16:17:23 -07:00
|
|
|
class ThebesLayer;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A compositable client for Thebes layers. These are different to Image/Canvas
|
|
|
|
* clients due to sending a valid region across IPC and because we do a lot more
|
2013-11-26 16:29:46 -08:00
|
|
|
* optimisation work, encapsualted in RotatedContentBuffers.
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
*
|
|
|
|
* We use content clients for OMTC and non-OMTC, basic rendering so that
|
|
|
|
* BasicThebesLayer has only one interface to deal with. We support single and
|
|
|
|
* double buffered flavours. For tiled layers, we do not use a ContentClient
|
|
|
|
* although we do have a ContentHost, and we do use texture clients and texture
|
|
|
|
* hosts.
|
|
|
|
*
|
|
|
|
* The interface presented by ContentClient is used by the BasicThebesLayer
|
|
|
|
* methods - PaintThebes, which is the same for MT and OMTC, and PaintBuffer
|
|
|
|
* which is different (the OMTC one does a little more). The 'buffer' in the
|
|
|
|
* names of a lot of these method is actually the TextureClient. But, 'buffer'
|
2013-11-26 16:29:46 -08:00
|
|
|
* for the RotatedContentBuffer (as in SetBuffer) means a gfxSurface. See the
|
|
|
|
* comments for SetBuffer and SetBufferProvider in RotatedContentBuffer. To keep
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
* these mapped buffers alive, we store a pointer in mOldTextures if the
|
2013-11-26 16:29:46 -08:00
|
|
|
* RotatedContentBuffer's surface is not the one from our texture client, once we
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
* are done painting we unmap the surface/texture client and don't need to keep
|
|
|
|
* it alive anymore, so we clear mOldTextures.
|
|
|
|
*
|
2014-01-12 12:06:45 -08:00
|
|
|
* The sequence for painting is: call BeginPaint on the content client;
|
|
|
|
* call PrepareFrame on the content client;
|
|
|
|
* call BeginPaintBuffer on the content client. That will initialise the buffer
|
|
|
|
* for painting, by calling RotatedContentBuffer::BeginPaint (usually) which
|
|
|
|
* will call back to ContentClient::FinalizeFrame to finalize update of the
|
|
|
|
* buffers before drawing (i.e., it finalizes the previous frame). Then call
|
|
|
|
* BorrowDrawTargetForPainting to get a DrawTarget to paint into. Then paint.
|
|
|
|
* Then return that DrawTarget using ReturnDrawTarget.
|
|
|
|
* Call EndPaint on the content client;
|
|
|
|
* call OnTransaction on the content client.
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
*
|
2013-07-08 21:21:06 -07:00
|
|
|
* SwapBuffers is called in response to the transaction reply from the compositor.
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
*/
|
|
|
|
class ContentClient : public CompositableClient
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates, configures, and returns a new content client. If necessary, a
|
|
|
|
* message will be sent to the compositor to create a corresponding content
|
|
|
|
* host.
|
|
|
|
*/
|
2013-04-16 14:36:06 -07:00
|
|
|
static TemporaryRef<ContentClient> CreateContentClient(CompositableForwarder* aFwd);
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
ContentClient(CompositableForwarder* aForwarder)
|
|
|
|
: CompositableClient(aForwarder)
|
|
|
|
{}
|
|
|
|
virtual ~ContentClient()
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
2013-05-15 20:45:42 -07:00
|
|
|
virtual void Clear() = 0;
|
2013-11-26 16:29:46 -08:00
|
|
|
virtual RotatedContentBuffer::PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
|
|
|
uint32_t aFlags) = 0;
|
2014-01-12 12:06:45 -08:00
|
|
|
virtual gfx::DrawTarget* BorrowDrawTargetForPainting(ThebesLayer* aLayer,
|
|
|
|
const RotatedContentBuffer::PaintState& aPaintState) = 0;
|
2014-01-23 22:58:33 -08:00
|
|
|
virtual void ReturnDrawTargetToBuffer(gfx::DrawTarget*& aReturned) = 0;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2014-01-12 11:54:40 -08:00
|
|
|
virtual void PrepareFrame() {}
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
// Called as part of the layers transation reply. Conveys data about our
|
|
|
|
// buffer(s) from the compositor. If appropriate we should swap references
|
|
|
|
// to our buffers.
|
|
|
|
virtual void SwapBuffers(const nsIntRegion& aFrontUpdatedRegion) {}
|
|
|
|
|
|
|
|
// call before and after painting into this content client
|
|
|
|
virtual void BeginPaint() {}
|
|
|
|
virtual void EndPaint() {}
|
|
|
|
};
|
|
|
|
|
2013-05-15 20:45:42 -07:00
|
|
|
/**
|
|
|
|
* A ContentClient for use with OMTC.
|
|
|
|
*/
|
|
|
|
class ContentClientRemote : public ContentClient
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ContentClientRemote(CompositableForwarder* aForwarder)
|
|
|
|
: ContentClient(aForwarder)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual void Updated(const nsIntRegion& aRegionToDraw,
|
|
|
|
const nsIntRegion& aVisibleRegion,
|
|
|
|
bool aDidSelfCopy) = 0;
|
|
|
|
};
|
|
|
|
|
2013-11-26 16:29:46 -08:00
|
|
|
// thin wrapper around RotatedContentBuffer, for on-mtc
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
class ContentClientBasic : public ContentClient
|
2013-11-26 16:29:46 -08:00
|
|
|
, protected RotatedContentBuffer
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
|
|
|
public:
|
2013-11-27 19:19:56 -08:00
|
|
|
ContentClientBasic();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2013-11-26 16:29:46 -08:00
|
|
|
typedef RotatedContentBuffer::PaintState PaintState;
|
|
|
|
typedef RotatedContentBuffer::ContentType ContentType;
|
2013-05-15 20:45:42 -07:00
|
|
|
|
2013-11-26 16:29:46 -08:00
|
|
|
virtual void Clear() { RotatedContentBuffer::Clear(); }
|
2014-01-12 12:06:45 -08:00
|
|
|
virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
2014-01-07 13:09:34 -08:00
|
|
|
uint32_t aFlags) MOZ_OVERRIDE
|
2013-05-15 20:45:42 -07:00
|
|
|
{
|
2014-01-12 12:06:45 -08:00
|
|
|
return RotatedContentBuffer::BeginPaint(aLayer, aFlags);
|
|
|
|
}
|
|
|
|
virtual gfx::DrawTarget* BorrowDrawTargetForPainting(ThebesLayer* aLayer,
|
|
|
|
const PaintState& aPaintState) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return RotatedContentBuffer::BorrowDrawTargetForPainting(aLayer, aPaintState);
|
2013-05-15 20:45:42 -07:00
|
|
|
}
|
2014-01-23 22:58:33 -08:00
|
|
|
virtual void ReturnDrawTargetToBuffer(gfx::DrawTarget*& aReturned) MOZ_OVERRIDE
|
2014-01-07 13:09:34 -08:00
|
|
|
{
|
|
|
|
BorrowDrawTarget::ReturnDrawTarget(aReturned);
|
|
|
|
}
|
2013-05-15 20:45:42 -07:00
|
|
|
|
2014-01-07 13:09:34 -08:00
|
|
|
void DrawTo(ThebesLayer* aLayer,
|
|
|
|
gfx::DrawTarget* aTarget,
|
|
|
|
float aOpacity,
|
|
|
|
gfx::CompositionOp aOp,
|
|
|
|
gfxASurface* aMask,
|
2014-01-27 12:25:20 -08:00
|
|
|
const gfx::Matrix* aMaskTransform)
|
2013-05-15 20:45:42 -07:00
|
|
|
{
|
2014-01-07 13:09:34 -08:00
|
|
|
RotatedContentBuffer::DrawTo(aLayer, aTarget, aOpacity, aOp,
|
|
|
|
aMask, aMaskTransform);
|
2013-05-15 20:45:42 -07:00
|
|
|
}
|
|
|
|
|
2013-09-11 21:53:46 -07:00
|
|
|
virtual void CreateBuffer(ContentType aType, const nsIntRect& aRect, uint32_t aFlags,
|
|
|
|
RefPtr<gfx::DrawTarget>* aBlackDT, RefPtr<gfx::DrawTarget>* aWhiteDT) MOZ_OVERRIDE;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2013-04-12 00:28:55 -07:00
|
|
|
virtual TextureInfo GetTextureInfo() const MOZ_OVERRIDE
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
2013-06-28 18:38:30 -07:00
|
|
|
MOZ_CRASH("Should not be called on non-remote ContentClient");
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2013-11-26 16:29:46 -08:00
|
|
|
* A ContentClientRemote backed by a RotatedContentBuffer.
|
2013-05-15 20:45:42 -07:00
|
|
|
*
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
* When using a ContentClientRemote, SurfaceDescriptors are created on
|
|
|
|
* the rendering side and destroyed on the compositing side. They are only
|
|
|
|
* passed from one side to the other when the TextureClient/Hosts are created.
|
|
|
|
* *Ownership* of the SurfaceDescriptor moves from the rendering side to the
|
2013-07-08 21:21:06 -07:00
|
|
|
* compositing side with the create message (send from CreateBuffer) which
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
* tells the compositor that TextureClients have been created and that the
|
|
|
|
* compositor should assign the corresponding TextureHosts to our corresponding
|
|
|
|
* ContentHost.
|
|
|
|
*
|
|
|
|
* If the size or type of our buffer(s) change(s), then we simply destroy and
|
|
|
|
* create them.
|
|
|
|
*/
|
2013-12-05 10:39:22 -08:00
|
|
|
// Version using new texture clients
|
2013-11-27 13:16:35 -08:00
|
|
|
class ContentClientRemoteBuffer : public ContentClientRemote
|
|
|
|
, protected RotatedContentBuffer
|
2013-11-27 13:16:34 -08:00
|
|
|
{
|
|
|
|
using RotatedContentBuffer::BufferRect;
|
|
|
|
using RotatedContentBuffer::BufferRotation;
|
|
|
|
public:
|
2013-11-27 13:16:35 -08:00
|
|
|
ContentClientRemoteBuffer(CompositableForwarder* aForwarder)
|
2013-12-05 10:39:22 -08:00
|
|
|
: ContentClientRemote(aForwarder)
|
|
|
|
, RotatedContentBuffer(ContainsVisibleBounds)
|
|
|
|
, mIsNewBuffer(false)
|
|
|
|
, mFrontAndBackBufferDiffer(false)
|
2014-01-10 11:06:16 -08:00
|
|
|
, mSurfaceFormat(gfx::SurfaceFormat::B8G8R8A8)
|
2013-12-05 10:39:22 -08:00
|
|
|
{}
|
|
|
|
|
|
|
|
typedef RotatedContentBuffer::PaintState PaintState;
|
|
|
|
typedef RotatedContentBuffer::ContentType ContentType;
|
|
|
|
|
|
|
|
virtual void Clear() { RotatedContentBuffer::Clear(); }
|
2014-01-07 13:09:34 -08:00
|
|
|
|
2014-01-12 12:06:45 -08:00
|
|
|
virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
2014-01-07 13:09:34 -08:00
|
|
|
uint32_t aFlags) MOZ_OVERRIDE
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
2014-01-12 12:06:45 -08:00
|
|
|
return RotatedContentBuffer::BeginPaint(aLayer, aFlags);
|
|
|
|
}
|
|
|
|
virtual gfx::DrawTarget* BorrowDrawTargetForPainting(ThebesLayer* aLayer,
|
|
|
|
const PaintState& aPaintState) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return RotatedContentBuffer::BorrowDrawTargetForPainting(aLayer, aPaintState);
|
2013-12-05 10:39:22 -08:00
|
|
|
}
|
2014-01-23 22:58:33 -08:00
|
|
|
virtual void ReturnDrawTargetToBuffer(gfx::DrawTarget*& aReturned) MOZ_OVERRIDE
|
2014-01-07 13:09:34 -08:00
|
|
|
{
|
|
|
|
BorrowDrawTarget::ReturnDrawTarget(aReturned);
|
|
|
|
}
|
2013-12-05 10:39:22 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Begin/End Paint map a gfxASurface from the texture client
|
|
|
|
* into the buffer of RotatedBuffer. The surface is only
|
|
|
|
* valid when the texture client is locked, so is mapped out
|
|
|
|
* of RotatedContentBuffer when we are done painting.
|
|
|
|
* None of the underlying buffer attributes (rect, rotation)
|
|
|
|
* are affected by mapping/unmapping.
|
|
|
|
*/
|
|
|
|
virtual void BeginPaint() MOZ_OVERRIDE;
|
|
|
|
virtual void EndPaint() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void Updated(const nsIntRegion& aRegionToDraw,
|
|
|
|
const nsIntRegion& aVisibleRegion,
|
|
|
|
bool aDidSelfCopy);
|
|
|
|
|
|
|
|
virtual void SwapBuffers(const nsIntRegion& aFrontUpdatedRegion) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// Expose these protected methods from the superclass.
|
|
|
|
virtual const nsIntRect& BufferRect() const
|
|
|
|
{
|
|
|
|
return RotatedContentBuffer::BufferRect();
|
|
|
|
}
|
|
|
|
virtual const nsIntPoint& BufferRotation() const
|
|
|
|
{
|
|
|
|
return RotatedContentBuffer::BufferRotation();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void CreateBuffer(ContentType aType, const nsIntRect& aRect, uint32_t aFlags,
|
|
|
|
RefPtr<gfx::DrawTarget>* aBlackDT, RefPtr<gfx::DrawTarget>* aWhiteDT) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual TextureInfo GetTextureInfo() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTextureInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void DestroyBuffers();
|
|
|
|
|
|
|
|
virtual nsIntRegion GetUpdatedRegion(const nsIntRegion& aRegionToDraw,
|
|
|
|
const nsIntRegion& aVisibleRegion,
|
|
|
|
bool aDidSelfCopy);
|
|
|
|
|
|
|
|
void BuildTextureClients(gfx::SurfaceFormat aFormat,
|
|
|
|
const nsIntRect& aRect,
|
|
|
|
uint32_t aFlags);
|
|
|
|
|
|
|
|
// Create the front buffer for the ContentClient/Host pair if necessary
|
|
|
|
// and notify the compositor that we have created the buffer(s).
|
|
|
|
virtual void CreateFrontBuffer(const nsIntRect& aBufferRect) = 0;
|
|
|
|
virtual void DestroyFrontBuffer() {}
|
|
|
|
|
|
|
|
bool CreateAndAllocateTextureClient(RefPtr<TextureClient>& aClient,
|
|
|
|
TextureFlags aFlags = 0);
|
|
|
|
|
|
|
|
virtual void AbortTextureClientCreation()
|
|
|
|
{
|
|
|
|
mTextureClient = nullptr;
|
|
|
|
mTextureClientOnWhite = nullptr;
|
|
|
|
mIsNewBuffer = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
RefPtr<TextureClient> mTextureClient;
|
|
|
|
RefPtr<TextureClient> mTextureClientOnWhite;
|
|
|
|
// keep a record of texture clients we have created and need to keep around
|
|
|
|
// (for RotatedBuffer to access), then unlock and remove them when we are done
|
|
|
|
// painting.
|
|
|
|
nsTArray<RefPtr<TextureClient> > mOldTextures;
|
|
|
|
|
|
|
|
TextureInfo mTextureInfo;
|
|
|
|
bool mIsNewBuffer;
|
|
|
|
bool mFrontAndBackBufferDiffer;
|
|
|
|
gfx::IntSize mSize;
|
|
|
|
gfx::SurfaceFormat mSurfaceFormat;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DeprecatedContentClientRemoteBuffer : public ContentClientRemote
|
|
|
|
, protected RotatedContentBuffer
|
|
|
|
{
|
|
|
|
using RotatedContentBuffer::BufferRect;
|
|
|
|
using RotatedContentBuffer::BufferRotation;
|
|
|
|
public:
|
|
|
|
DeprecatedContentClientRemoteBuffer(CompositableForwarder* aForwarder)
|
2013-05-15 20:45:42 -07:00
|
|
|
: ContentClientRemote(aForwarder)
|
2013-11-26 16:29:46 -08:00
|
|
|
, RotatedContentBuffer(ContainsVisibleBounds)
|
2013-07-08 14:30:44 -07:00
|
|
|
, mDeprecatedTextureClient(nullptr)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
, mIsNewBuffer(false)
|
|
|
|
, mFrontAndBackBufferDiffer(false)
|
2014-01-23 10:26:40 -08:00
|
|
|
, mContentType(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 02:20:52 -07:00
|
|
|
{}
|
|
|
|
|
2013-11-26 16:29:46 -08:00
|
|
|
typedef RotatedContentBuffer::PaintState PaintState;
|
|
|
|
typedef RotatedContentBuffer::ContentType ContentType;
|
2013-05-15 20:45:42 -07:00
|
|
|
|
2013-11-26 16:29:46 -08:00
|
|
|
virtual void Clear() { RotatedContentBuffer::Clear(); }
|
2014-01-07 13:09:34 -08:00
|
|
|
|
2014-01-12 12:06:45 -08:00
|
|
|
virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
2014-01-07 13:09:34 -08:00
|
|
|
uint32_t aFlags) MOZ_OVERRIDE
|
2013-05-15 20:45:42 -07:00
|
|
|
{
|
2014-01-12 12:06:45 -08:00
|
|
|
return RotatedContentBuffer::BeginPaint(aLayer, aFlags);
|
|
|
|
}
|
|
|
|
virtual gfx::DrawTarget* BorrowDrawTargetForPainting(ThebesLayer* aLayer,
|
|
|
|
const PaintState& aPaintState) MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return RotatedContentBuffer::BorrowDrawTargetForPainting(aLayer, aPaintState);
|
2013-05-15 20:45:42 -07:00
|
|
|
}
|
2014-01-23 22:58:33 -08:00
|
|
|
virtual void ReturnDrawTargetToBuffer(gfx::DrawTarget*& aReturned) MOZ_OVERRIDE
|
2014-01-07 13:09:34 -08:00
|
|
|
{
|
|
|
|
BorrowDrawTarget::ReturnDrawTarget(aReturned);
|
|
|
|
}
|
2013-05-15 20:45:42 -07:00
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
/**
|
|
|
|
* Begin/End Paint map a gfxASurface from the texture client
|
2013-11-26 16:29:46 -08:00
|
|
|
* into the buffer of RotatedContentBuffer. The surface is only
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
* valid when the texture client is locked, so is mapped out
|
2013-11-26 16:29:46 -08:00
|
|
|
* of RotatedContentBuffer when we are done painting.
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
* None of the underlying buffer attributes (rect, rotation)
|
|
|
|
* are affected by mapping/unmapping.
|
|
|
|
*/
|
|
|
|
virtual void BeginPaint() MOZ_OVERRIDE;
|
|
|
|
virtual void EndPaint() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void Updated(const nsIntRegion& aRegionToDraw,
|
|
|
|
const nsIntRegion& aVisibleRegion,
|
|
|
|
bool aDidSelfCopy);
|
|
|
|
|
|
|
|
virtual void SwapBuffers(const nsIntRegion& aFrontUpdatedRegion) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// Expose these protected methods from the superclass.
|
|
|
|
virtual const nsIntRect& BufferRect() const
|
|
|
|
{
|
2013-11-26 16:29:46 -08:00
|
|
|
return RotatedContentBuffer::BufferRect();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
virtual const nsIntPoint& BufferRotation() const
|
|
|
|
{
|
2013-11-26 16:29:46 -08:00
|
|
|
return RotatedContentBuffer::BufferRotation();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
|
2013-09-11 21:53:46 -07:00
|
|
|
virtual void CreateBuffer(ContentType aType, const nsIntRect& aRect, uint32_t aFlags,
|
|
|
|
RefPtr<gfx::DrawTarget>* aBlackDT, RefPtr<gfx::DrawTarget>* aWhiteDT) MOZ_OVERRIDE;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2013-04-12 00:28:55 -07:00
|
|
|
virtual TextureInfo GetTextureInfo() const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return mTextureInfo;
|
|
|
|
}
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
protected:
|
2013-12-05 10:39:22 -08:00
|
|
|
void DestroyBuffers();
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
virtual nsIntRegion GetUpdatedRegion(const nsIntRegion& aRegionToDraw,
|
|
|
|
const nsIntRegion& aVisibleRegion,
|
|
|
|
bool aDidSelfCopy);
|
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
// create and configure mDeprecatedTextureClient
|
|
|
|
void BuildDeprecatedTextureClients(ContentType aType,
|
|
|
|
const nsIntRect& aRect,
|
|
|
|
uint32_t aFlags);
|
2013-04-14 18:25:14 -07:00
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
// Create the front buffer for the ContentClient/Host pair if necessary
|
|
|
|
// and notify the compositor that we have created the buffer(s).
|
2013-04-12 00:28:55 -07:00
|
|
|
virtual void CreateFrontBufferAndNotify(const nsIntRect& aBufferRect) = 0;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
virtual void DestroyFrontBuffer() {}
|
|
|
|
// We're about to hand off to the compositor, if you've got a back buffer,
|
|
|
|
// lock it now.
|
|
|
|
virtual void LockFrontBuffer() {}
|
|
|
|
|
2013-08-04 00:46:17 -07:00
|
|
|
bool CreateAndAllocateDeprecatedTextureClient(RefPtr<DeprecatedTextureClient>& aClient);
|
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
RefPtr<DeprecatedTextureClient> mDeprecatedTextureClient;
|
|
|
|
RefPtr<DeprecatedTextureClient> mDeprecatedTextureClientOnWhite;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
// keep a record of texture clients we have created and need to keep
|
|
|
|
// around, then unlock when we are done painting
|
2013-07-08 14:30:44 -07:00
|
|
|
nsTArray<RefPtr<DeprecatedTextureClient> > mOldTextures;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2013-04-12 00:28:55 -07:00
|
|
|
TextureInfo mTextureInfo;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
bool mIsNewBuffer;
|
|
|
|
bool mFrontAndBackBufferDiffer;
|
|
|
|
gfx::IntSize mSize;
|
|
|
|
ContentType mContentType;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2013-07-08 14:30:44 -07:00
|
|
|
* A double buffered ContentClient. mDeprecatedTextureClient is the back buffer, which
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
* we draw into. mFrontClient is the front buffer which we may read from, but
|
|
|
|
* not write to, when the compositor does not have the 'soft' lock. We can write
|
2013-07-08 14:30:44 -07:00
|
|
|
* into mDeprecatedTextureClient at any time.
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
*
|
|
|
|
* The ContentHost keeps a reference to both corresponding texture hosts, in
|
2013-07-08 21:21:06 -07:00
|
|
|
* response to our UpdateTextureRegion message, the compositor swaps its
|
|
|
|
* references. In response to the compositor's reply we swap our references
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
* (in SwapBuffers).
|
|
|
|
*/
|
2013-11-27 13:16:35 -08:00
|
|
|
class ContentClientDoubleBuffered : public ContentClientRemoteBuffer
|
2013-11-27 13:16:34 -08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-27 13:16:35 -08:00
|
|
|
ContentClientDoubleBuffered(CompositableForwarder* aFwd)
|
|
|
|
: ContentClientRemoteBuffer(aFwd)
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
|
|
|
mTextureInfo.mCompositableType = COMPOSITABLE_CONTENT_DOUBLE;
|
|
|
|
}
|
|
|
|
virtual ~ContentClientDoubleBuffered() {}
|
|
|
|
|
|
|
|
virtual void SwapBuffers(const nsIntRegion& aFrontUpdatedRegion) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-12 11:54:40 -08:00
|
|
|
virtual void PrepareFrame() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void FinalizeFrame(const nsIntRegion& aRegionToDraw) MOZ_OVERRIDE;
|
2013-12-05 10:39:22 -08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void CreateFrontBuffer(const nsIntRect& aBufferRect) MOZ_OVERRIDE;
|
|
|
|
virtual void DestroyFrontBuffer() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void UpdateDestinationFrom(const RotatedBuffer& aSource,
|
|
|
|
const nsIntRegion& aUpdateRegion);
|
|
|
|
|
|
|
|
virtual void AbortTextureClientCreation() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
mTextureClient = nullptr;
|
|
|
|
mTextureClientOnWhite = nullptr;
|
|
|
|
mFrontClient = nullptr;
|
|
|
|
mFrontClientOnWhite = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
RefPtr<TextureClient> mFrontClient;
|
|
|
|
RefPtr<TextureClient> mFrontClientOnWhite;
|
|
|
|
nsIntRegion mFrontUpdatedRegion;
|
|
|
|
nsIntRect mFrontBufferRect;
|
|
|
|
nsIntPoint mFrontBufferRotation;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DeprecatedContentClientDoubleBuffered : public DeprecatedContentClientRemoteBuffer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DeprecatedContentClientDoubleBuffered(CompositableForwarder* aFwd)
|
|
|
|
: DeprecatedContentClientRemoteBuffer(aFwd)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
2013-04-12 00:28:55 -07:00
|
|
|
mTextureInfo.mCompositableType = BUFFER_CONTENT_DIRECT;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
2013-12-05 10:39:22 -08:00
|
|
|
~DeprecatedContentClientDoubleBuffered();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
virtual void SwapBuffers(const nsIntRegion& aFrontUpdatedRegion) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-12 11:54:40 -08:00
|
|
|
virtual void PrepareFrame() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void FinalizeFrame(const nsIntRegion& aRegionToDraw) MOZ_OVERRIDE;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
protected:
|
2013-04-12 00:28:55 -07:00
|
|
|
virtual void CreateFrontBufferAndNotify(const nsIntRect& aBufferRect) MOZ_OVERRIDE;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
virtual void DestroyFrontBuffer() MOZ_OVERRIDE;
|
|
|
|
virtual void LockFrontBuffer() MOZ_OVERRIDE;
|
2013-11-27 15:31:31 -08:00
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
private:
|
|
|
|
void UpdateDestinationFrom(const RotatedBuffer& aSource,
|
|
|
|
const nsIntRegion& aUpdateRegion);
|
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
RefPtr<DeprecatedTextureClient> mFrontClient;
|
|
|
|
RefPtr<DeprecatedTextureClient> mFrontClientOnWhite;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
nsIntRegion mFrontUpdatedRegion;
|
|
|
|
nsIntRect mFrontBufferRect;
|
|
|
|
nsIntPoint mFrontBufferRotation;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A single buffered ContentClient. We have a single TextureClient/Host
|
|
|
|
* which we update and then send a message to the compositor that we are
|
|
|
|
* done updating. It is not safe for the compositor to use the corresponding
|
2013-07-08 21:21:06 -07:00
|
|
|
* TextureHost's memory directly, it must upload it to video memory of some
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
* kind. We are free to modify the TextureClient once we receive reply from
|
|
|
|
* the compositor.
|
|
|
|
*/
|
2013-11-27 13:16:35 -08:00
|
|
|
class ContentClientSingleBuffered : public ContentClientRemoteBuffer
|
2013-11-27 13:16:34 -08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-27 13:16:35 -08:00
|
|
|
ContentClientSingleBuffered(CompositableForwarder* aFwd)
|
|
|
|
: ContentClientRemoteBuffer(aFwd)
|
2013-12-05 10:39:22 -08:00
|
|
|
{
|
|
|
|
mTextureInfo.mCompositableType = COMPOSITABLE_CONTENT_SINGLE;
|
|
|
|
}
|
|
|
|
virtual ~ContentClientSingleBuffered() {}
|
|
|
|
|
2014-01-12 11:54:40 -08:00
|
|
|
virtual void PrepareFrame() MOZ_OVERRIDE;
|
2013-12-05 10:39:22 -08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void CreateFrontBuffer(const nsIntRect& aBufferRect) MOZ_OVERRIDE {}
|
|
|
|
};
|
|
|
|
|
|
|
|
class DeprecatedContentClientSingleBuffered : public DeprecatedContentClientRemoteBuffer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DeprecatedContentClientSingleBuffered(CompositableForwarder* aFwd)
|
|
|
|
: DeprecatedContentClientRemoteBuffer(aFwd)
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
{
|
2013-04-12 00:28:55 -07:00
|
|
|
mTextureInfo.mCompositableType = BUFFER_CONTENT;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
2013-12-05 10:39:22 -08:00
|
|
|
~DeprecatedContentClientSingleBuffered();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
2014-01-12 11:54:40 -08:00
|
|
|
virtual void PrepareFrame() MOZ_OVERRIDE;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
|
|
|
|
protected:
|
2013-04-12 00:28:55 -07:00
|
|
|
virtual void CreateFrontBufferAndNotify(const nsIntRect& aBufferRect) MOZ_OVERRIDE;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
};
|
|
|
|
|
2013-05-15 20:45:43 -07:00
|
|
|
/**
|
|
|
|
* A single buffered ContentClient that creates temporary buffers which are
|
|
|
|
* used to update the host-side texture. The ownership of the buffers is
|
|
|
|
* passed to the host side during the transaction, and we need to create
|
|
|
|
* new ones each frame.
|
|
|
|
*/
|
|
|
|
class ContentClientIncremental : public ContentClientRemote
|
2014-01-07 13:09:34 -08:00
|
|
|
, public BorrowDrawTarget
|
2013-05-15 20:45:43 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
ContentClientIncremental(CompositableForwarder* aFwd)
|
|
|
|
: ContentClientRemote(aFwd)
|
2014-01-23 10:26:40 -08:00
|
|
|
, mContentType(gfxContentType::COLOR_ALPHA)
|
2013-05-15 20:45:43 -07:00
|
|
|
, mHasBuffer(false)
|
|
|
|
, mHasBufferOnWhite(false)
|
|
|
|
{
|
|
|
|
mTextureInfo.mCompositableType = BUFFER_CONTENT_INC;
|
|
|
|
}
|
|
|
|
|
2013-11-26 16:29:46 -08:00
|
|
|
typedef RotatedContentBuffer::PaintState PaintState;
|
|
|
|
typedef RotatedContentBuffer::ContentType ContentType;
|
2013-05-15 20:45:43 -07:00
|
|
|
|
|
|
|
virtual TextureInfo GetTextureInfo() const
|
|
|
|
{
|
|
|
|
return mTextureInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void Clear()
|
|
|
|
{
|
|
|
|
mBufferRect.SetEmpty();
|
|
|
|
mHasBuffer = false;
|
|
|
|
mHasBufferOnWhite = false;
|
|
|
|
}
|
2014-01-07 13:09:34 -08:00
|
|
|
|
2014-01-12 12:06:45 -08:00
|
|
|
virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
|
|
|
uint32_t aFlags) MOZ_OVERRIDE;
|
|
|
|
virtual gfx::DrawTarget* BorrowDrawTargetForPainting(ThebesLayer* aLayer,
|
|
|
|
const PaintState& aPaintState) MOZ_OVERRIDE;
|
2014-01-23 22:58:33 -08:00
|
|
|
virtual void ReturnDrawTargetToBuffer(gfx::DrawTarget*& aReturned) MOZ_OVERRIDE
|
2014-01-07 13:09:34 -08:00
|
|
|
{
|
|
|
|
BorrowDrawTarget::ReturnDrawTarget(aReturned);
|
|
|
|
}
|
2013-05-15 20:45:43 -07:00
|
|
|
|
|
|
|
virtual void Updated(const nsIntRegion& aRegionToDraw,
|
|
|
|
const nsIntRegion& aVisibleRegion,
|
|
|
|
bool aDidSelfCopy);
|
|
|
|
|
|
|
|
virtual void EndPaint()
|
|
|
|
{
|
|
|
|
if (IsSurfaceDescriptorValid(mUpdateDescriptor)) {
|
|
|
|
mForwarder->DestroySharedSurface(&mUpdateDescriptor);
|
|
|
|
}
|
|
|
|
if (IsSurfaceDescriptorValid(mUpdateDescriptorOnWhite)) {
|
|
|
|
mForwarder->DestroySharedSurface(&mUpdateDescriptorOnWhite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
enum BufferType{
|
|
|
|
BUFFER_BLACK,
|
|
|
|
BUFFER_WHITE
|
|
|
|
};
|
|
|
|
|
|
|
|
void NotifyBufferCreated(ContentType aType, uint32_t aFlags)
|
|
|
|
{
|
2013-10-02 13:52:04 -07:00
|
|
|
mTextureInfo.mTextureFlags = aFlags & ~TEXTURE_DEALLOCATE_CLIENT;
|
2013-05-15 20:45:43 -07:00
|
|
|
mContentType = aType;
|
|
|
|
|
|
|
|
mForwarder->CreatedIncrementalBuffer(this,
|
|
|
|
mTextureInfo,
|
|
|
|
mBufferRect);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2014-01-12 12:06:45 -08:00
|
|
|
already_AddRefed<gfxASurface> GetUpdateSurface(BufferType aType,
|
|
|
|
const nsIntRegion& aUpdateRegion);
|
2013-05-15 20:45:43 -07:00
|
|
|
|
|
|
|
TextureInfo mTextureInfo;
|
|
|
|
nsIntRect mBufferRect;
|
|
|
|
nsIntPoint mBufferRotation;
|
|
|
|
|
|
|
|
SurfaceDescriptor mUpdateDescriptor;
|
|
|
|
SurfaceDescriptor mUpdateDescriptorOnWhite;
|
|
|
|
|
|
|
|
ContentType mContentType;
|
|
|
|
|
|
|
|
bool mHasBuffer;
|
|
|
|
bool mHasBufferOnWhite;
|
|
|
|
};
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|