2012-04-16 23:02:45 +00:00
|
|
|
/* 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/. */
|
|
|
|
|
2013-05-01 05:03:25 +00:00
|
|
|
#ifndef GFX_CLIENTTILEDTHEBESLAYER_H
|
|
|
|
#define GFX_CLIENTTILEDTHEBESLAYER_H
|
2012-04-16 23:02:45 +00:00
|
|
|
|
|
|
|
#include "mozilla/layers/ShadowLayers.h"
|
2013-05-01 05:03:25 +00:00
|
|
|
#include "ClientLayerManager.h"
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
#include "mozilla/layers/TiledContentClient.h" // tiles and tile buffer
|
2012-04-16 23:02:45 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
class BasicTiledLayerBuffer;
|
2012-04-16 23:02:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* An implementation of ThebesLayer that ONLY supports remote
|
|
|
|
* composition that is backed by tiles. This thebes layer implementation
|
|
|
|
* is better suited to mobile hardware to work around slow implementation
|
|
|
|
* of glTexImage2D (for OGL compositors), and restrait memory bandwidth.
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
*
|
|
|
|
* Tiled Thebes layers use a different protocol compared with other
|
|
|
|
* layers. A copy of the tiled buffer is made and sent to the compositing
|
|
|
|
* thread via the layers protocol. Tiles are uploaded by the buffers
|
|
|
|
* asynchonously without using IPC, that means they are not safe for cross-
|
|
|
|
* process use (bug 747811). Each tile has a TextureHost/Client pair but
|
|
|
|
* they communicate directly rather than using the Texture protocol.
|
|
|
|
*
|
|
|
|
* There is no ContentClient for tiled layers. There is a ContentHost, however.
|
2012-04-16 23:02:45 +00:00
|
|
|
*/
|
2013-05-01 05:03:25 +00:00
|
|
|
class ClientTiledThebesLayer : public ThebesLayer,
|
|
|
|
public ClientLayer
|
2012-04-16 23:02:45 +00:00
|
|
|
{
|
|
|
|
typedef ThebesLayer Base;
|
|
|
|
|
|
|
|
public:
|
2013-05-01 05:03:25 +00:00
|
|
|
ClientTiledThebesLayer(ClientLayerManager* const aManager);
|
|
|
|
~ClientTiledThebesLayer();
|
2012-04-16 23:02:45 +00:00
|
|
|
|
|
|
|
// Thebes Layer
|
|
|
|
virtual Layer* AsLayer() { return this; }
|
|
|
|
virtual void InvalidateRegion(const nsIntRegion& aRegion) {
|
2012-08-29 05:47:18 +00:00
|
|
|
mInvalidRegion.Or(mInvalidRegion, aRegion);
|
2012-07-04 00:24:55 +00:00
|
|
|
mValidRegion.Sub(mValidRegion, aRegion);
|
2012-11-21 22:34:19 +00:00
|
|
|
mLowPrecisionValidRegion.Sub(mLowPrecisionValidRegion, aRegion);
|
2012-04-16 23:02:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Shadow methods
|
|
|
|
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs);
|
|
|
|
virtual ShadowableLayer* AsShadowableLayer() { return this; }
|
|
|
|
|
|
|
|
virtual void Disconnect()
|
|
|
|
{
|
2013-05-01 05:03:25 +00:00
|
|
|
ClientLayer::Disconnect();
|
2012-04-16 23:02:45 +00:00
|
|
|
}
|
|
|
|
|
2013-05-01 05:03:25 +00:00
|
|
|
virtual void RenderLayer();
|
2012-04-16 23:02:45 +00:00
|
|
|
|
|
|
|
private:
|
2013-05-01 05:03:25 +00:00
|
|
|
ClientLayerManager* ClientManager()
|
2012-04-16 23:02:45 +00:00
|
|
|
{
|
2013-05-01 05:03:25 +00:00
|
|
|
return static_cast<ClientLayerManager*>(mManager);
|
2012-04-16 23:02:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// BasicImplData
|
|
|
|
virtual void
|
|
|
|
PaintBuffer(gfxContext* aContext,
|
|
|
|
const nsIntRegion& aRegionToDraw,
|
|
|
|
const nsIntRegion& aExtendedRegionToDraw,
|
|
|
|
const nsIntRegion& aRegionToInvalidate,
|
|
|
|
bool aDidSelfCopy,
|
|
|
|
LayerManager::DrawThebesLayerCallback aCallback,
|
|
|
|
void* aCallbackData)
|
|
|
|
{ NS_RUNTIMEABORT("Not reached."); }
|
|
|
|
|
2012-11-21 22:34:19 +00:00
|
|
|
|
2012-11-29 13:08:40 +00:00
|
|
|
/**
|
|
|
|
* For the initial PaintThebes of a transaction, calculates all the data
|
|
|
|
* needed for that paint and any repeated transactions.
|
|
|
|
*/
|
|
|
|
void BeginPaint();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* When a paint ends, updates any data necessary to persist until the next
|
|
|
|
* paint. If aFinish is true, this will cause the paint to be marked as
|
|
|
|
* finished.
|
|
|
|
*/
|
|
|
|
void EndPaint(bool aFinish);
|
|
|
|
|
2013-04-16 21:36:06 +00:00
|
|
|
RefPtr<TiledContentClient> mContentClient;
|
2012-11-21 22:34:19 +00:00
|
|
|
nsIntRegion mLowPrecisionValidRegion;
|
2012-11-29 13:08:40 +00:00
|
|
|
BasicTiledLayerPaintData mPaintData;
|
2012-04-16 23:02:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // layers
|
|
|
|
} // mozilla
|
|
|
|
|
|
|
|
#endif
|