Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef GFX_CONTENTHOST_H
|
|
|
|
#define GFX_CONTENTHOST_H
|
|
|
|
|
2013-08-11 23:17:23 +00:00
|
|
|
#include <stdint.h> // for uint32_t
|
|
|
|
#include <stdio.h> // for FILE
|
|
|
|
#include "mozilla-config.h" // for MOZ_DUMP_PAINTING
|
|
|
|
#include "CompositableHost.h" // for CompositableHost, etc
|
2013-11-27 00:29:46 +00:00
|
|
|
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
2015-03-21 16:28:04 +00:00
|
|
|
#include "mozilla/Attributes.h" // for override
|
2015-10-18 05:24:48 +00:00
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/gfx/BasePoint.h" // for BasePoint
|
2015-12-02 23:52:00 +00:00
|
|
|
#include "mozilla/gfx/MatrixFwd.h" // for Matrix4x4
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/gfx/Point.h" // for Point
|
|
|
|
#include "mozilla/gfx/Rect.h" // for Rect
|
2016-05-25 16:01:18 +00:00
|
|
|
#include "mozilla/gfx/Types.h" // for SamplingFilter
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/layers/CompositorTypes.h" // for TextureInfo, etc
|
|
|
|
#include "mozilla/layers/ISurfaceAllocator.h" // for ISurfaceAllocator
|
|
|
|
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
2013-11-17 21:47:40 +00:00
|
|
|
#include "mozilla/layers/LayersTypes.h" // for etc
|
2014-04-03 06:04:04 +00:00
|
|
|
#include "mozilla/layers/TextureHost.h" // for TextureHost
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "mozilla/mozalloc.h" // for operator delete
|
2014-08-25 15:09:39 +00:00
|
|
|
#include "mozilla/UniquePtr.h" // for UniquePtr
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "nsCOMPtr.h" // for already_AddRefed
|
|
|
|
#include "nsDebug.h" // for NS_RUNTIMEABORT
|
2014-02-26 21:36:35 +00:00
|
|
|
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "nsPoint.h" // for nsIntPoint
|
2015-05-07 09:07:42 +00:00
|
|
|
#include "nsRect.h" // for mozilla::gfx::IntRect
|
2013-08-11 23:17:23 +00:00
|
|
|
#include "nsRegion.h" // for nsIntRegion
|
|
|
|
#include "nsTArray.h" // for nsTArray
|
|
|
|
#include "nscore.h" // for nsACString
|
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
2013-08-11 23:17:23 +00:00
|
|
|
class Compositor;
|
|
|
|
class ThebesBufferData;
|
|
|
|
struct EffectChain;
|
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
|
|
|
|
|
|
|
struct TexturedEffect;
|
|
|
|
|
|
|
|
/**
|
2014-09-26 17:07:06 +00:00
|
|
|
* ContentHosts are used for compositing Painted layers, always matched by a
|
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
|
|
|
* ContentClient of the same type.
|
|
|
|
*
|
|
|
|
* ContentHosts support only UpdateThebes(), not Update().
|
|
|
|
*/
|
|
|
|
class ContentHost : public CompositableHost
|
|
|
|
{
|
|
|
|
public:
|
2014-02-20 13:05:32 +00:00
|
|
|
virtual bool UpdateThebes(const ThebesBufferData& aData,
|
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
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRegion& aOldValidRegionBack,
|
|
|
|
nsIntRegion* aUpdatedRegionBack) = 0;
|
|
|
|
|
2014-08-04 03:29:55 +00:00
|
|
|
virtual void SetPaintWillResample(bool aResample) { mPaintWillResample = aResample; }
|
|
|
|
bool PaintWillResample() { return mPaintWillResample; }
|
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
|
|
|
|
2016-04-26 14:05:14 +00:00
|
|
|
// We use this to allow TiledContentHost to invalidate regions where
|
|
|
|
// tiles are fading in.
|
|
|
|
virtual void AddAnimationInvalidation(nsIntRegion& aRegion) { }
|
|
|
|
|
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
|
|
|
protected:
|
2014-08-20 04:55:14 +00:00
|
|
|
explicit ContentHost(const TextureInfo& aTextureInfo)
|
2013-04-16 21:36:06 +00:00
|
|
|
: CompositableHost(aTextureInfo)
|
2014-08-04 03:29:55 +00:00
|
|
|
, mPaintWillResample(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 09:20:52 +00:00
|
|
|
{}
|
2014-08-04 03:29:55 +00:00
|
|
|
|
|
|
|
bool mPaintWillResample;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base class for non-tiled ContentHosts.
|
|
|
|
*
|
|
|
|
* Ownership of the SurfaceDescriptor and the resources it represents is passed
|
2014-04-03 06:04:04 +00:00
|
|
|
* from the ContentClient to the ContentHost when the TextureClient/Hosts are
|
|
|
|
* created, that is recevied here by SetTextureHosts which assigns one or two
|
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
|
|
|
* texture hosts (for single and double buffering) to the ContentHost.
|
|
|
|
*
|
|
|
|
* It is the responsibility of the ContentHost to destroy its resources when
|
|
|
|
* they are recreated or the ContentHost dies.
|
|
|
|
*/
|
2013-11-27 21:16:35 +00:00
|
|
|
class ContentHostBase : public ContentHost
|
2013-11-27 21:16:34 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef RotatedContentBuffer::ContentType ContentType;
|
|
|
|
typedef RotatedContentBuffer::PaintState PaintState;
|
|
|
|
|
2014-08-20 04:55:14 +00:00
|
|
|
explicit ContentHostBase(const TextureInfo& aTextureInfo);
|
2013-12-05 18:39:22 +00:00
|
|
|
virtual ~ContentHostBase();
|
|
|
|
|
2014-04-02 06:45:02 +00:00
|
|
|
protected:
|
|
|
|
virtual nsIntPoint GetOriginOffset()
|
|
|
|
{
|
|
|
|
return mBufferRect.TopLeft() - mBufferRotation;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-07 09:07:42 +00:00
|
|
|
gfx::IntRect mBufferRect;
|
2014-04-02 06:45:02 +00:00
|
|
|
nsIntPoint mBufferRotation;
|
|
|
|
bool mInitialised;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shared ContentHostBase implementation for content hosts that
|
|
|
|
* use up to two TextureHosts.
|
|
|
|
*/
|
|
|
|
class ContentHostTexture : public ContentHostBase
|
|
|
|
{
|
|
|
|
public:
|
2014-08-20 04:55:14 +00:00
|
|
|
explicit ContentHostTexture(const TextureInfo& aTextureInfo)
|
2014-04-02 06:45:02 +00:00
|
|
|
: ContentHostBase(aTextureInfo)
|
|
|
|
, mLocked(false)
|
2015-10-25 15:00:59 +00:00
|
|
|
, mReceivedNewHost(false)
|
2014-04-02 06:45:02 +00:00
|
|
|
{ }
|
2013-12-05 18:39:22 +00:00
|
|
|
|
2015-07-06 03:02:26 +00:00
|
|
|
virtual void Composite(LayerComposite* aLayer,
|
|
|
|
EffectChain& aEffectChain,
|
2014-10-16 17:08:32 +00:00
|
|
|
float aOpacity,
|
|
|
|
const gfx::Matrix4x4& aTransform,
|
2016-05-25 16:01:18 +00:00
|
|
|
const gfx::SamplingFilter aSamplingFilter,
|
2016-05-13 20:15:17 +00:00
|
|
|
const gfx::IntRect& aClipRect,
|
2015-03-21 16:28:04 +00:00
|
|
|
const nsIntRegion* aVisibleRegion = nullptr) override;
|
2014-10-16 17:08:32 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void SetCompositor(Compositor* aCompositor) override;
|
2013-12-05 18:39:22 +00:00
|
|
|
|
2015-06-17 14:00:52 +00:00
|
|
|
virtual already_AddRefed<gfx::DataSourceSurface> GetAsSurface() override;
|
2013-12-05 18:39:22 +00:00
|
|
|
|
2014-06-19 22:36:25 +00:00
|
|
|
virtual void Dump(std::stringstream& aStream,
|
2014-12-17 02:32:58 +00:00
|
|
|
const char* aPrefix="",
|
2015-03-21 16:28:04 +00:00
|
|
|
bool aDumpHtml=false) override;
|
2013-12-05 18:39:22 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
|
2013-12-05 18:39:22 +00:00
|
|
|
|
2015-05-04 10:59:02 +00:00
|
|
|
virtual void UseTextureHost(const nsTArray<TimedTexture>& aTextures) override;
|
2014-02-06 11:28:29 +00:00
|
|
|
virtual void UseComponentAlphaTextures(TextureHost* aTextureOnBlack,
|
2015-03-21 16:28:04 +00:00
|
|
|
TextureHost* aTextureOnWhite) override;
|
2013-12-05 18:39:22 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual bool Lock() override {
|
2014-04-02 06:45:02 +00:00
|
|
|
MOZ_ASSERT(!mLocked);
|
2014-04-23 12:19:29 +00:00
|
|
|
if (!mTextureHost) {
|
|
|
|
return false;
|
|
|
|
}
|
2014-04-02 06:45:02 +00:00
|
|
|
if (!mTextureHost->Lock()) {
|
|
|
|
return false;
|
|
|
|
}
|
2013-12-05 18:39:22 +00:00
|
|
|
|
2014-04-02 06:45:02 +00:00
|
|
|
if (mTextureHostOnWhite && !mTextureHostOnWhite->Lock()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
mLocked = true;
|
|
|
|
return true;
|
|
|
|
}
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual void Unlock() override {
|
2014-04-02 06:45:02 +00:00
|
|
|
MOZ_ASSERT(mLocked);
|
|
|
|
mTextureHost->Unlock();
|
|
|
|
if (mTextureHostOnWhite) {
|
|
|
|
mTextureHostOnWhite->Unlock();
|
|
|
|
}
|
|
|
|
mLocked = false;
|
2013-12-05 18:39:22 +00:00
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
LayerRenderState GetRenderState() override;
|
2014-10-16 17:08:32 +00:00
|
|
|
|
2016-05-25 16:01:18 +00:00
|
|
|
virtual already_AddRefed<TexturedEffect> GenEffect(const gfx::SamplingFilter aSamplingFilter) override;
|
2014-10-16 17:08:32 +00:00
|
|
|
|
2014-04-02 06:45:02 +00:00
|
|
|
protected:
|
2014-11-17 10:06:25 +00:00
|
|
|
CompositableTextureHostRef mTextureHost;
|
|
|
|
CompositableTextureHostRef mTextureHostOnWhite;
|
2014-10-16 17:08:32 +00:00
|
|
|
CompositableTextureSourceRef mTextureSource;
|
|
|
|
CompositableTextureSourceRef mTextureSourceOnWhite;
|
2014-04-02 06:45:02 +00:00
|
|
|
bool mLocked;
|
2015-10-25 15:00:59 +00:00
|
|
|
bool mReceivedNewHost;
|
2013-12-05 18:39:22 +00:00
|
|
|
};
|
2014-04-01 06:28:05 +00:00
|
|
|
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
/**
|
2013-12-05 18:39:22 +00:00
|
|
|
* Double buffering is implemented by swapping the front and back TextureHosts.
|
|
|
|
* We assume that whenever we use double buffering, then we have
|
|
|
|
* render-to-texture and thus no texture upload to do.
|
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
|
|
|
*/
|
2014-04-02 06:45:02 +00:00
|
|
|
class ContentHostDoubleBuffered : public ContentHostTexture
|
2013-11-27 21:16:34 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-08-20 04:55:14 +00:00
|
|
|
explicit ContentHostDoubleBuffered(const TextureInfo& aTextureInfo)
|
2014-04-02 06:45:02 +00:00
|
|
|
: ContentHostTexture(aTextureInfo)
|
2013-11-27 21:16:34 +00:00
|
|
|
{}
|
|
|
|
|
2013-12-05 18:39:22 +00:00
|
|
|
virtual ~ContentHostDoubleBuffered() {}
|
|
|
|
|
2014-04-26 02:34:06 +00:00
|
|
|
virtual CompositableType GetType() { return CompositableType::CONTENT_DOUBLE; }
|
2013-12-05 18:39:22 +00:00
|
|
|
|
2014-02-20 13:05:32 +00:00
|
|
|
virtual bool UpdateThebes(const ThebesBufferData& aData,
|
2013-12-05 18:39:22 +00:00
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRegion& aOldValidRegionBack,
|
|
|
|
nsIntRegion* aUpdatedRegionBack);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsIntRegion mValidRegionForNextBackBuffer;
|
|
|
|
};
|
|
|
|
|
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
|
|
|
/**
|
|
|
|
* Single buffered, therefore we must synchronously upload the image from the
|
2014-04-03 06:04:04 +00:00
|
|
|
* TextureHost in the layers transaction (i.e., in UpdateThebes).
|
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
|
|
|
*/
|
2014-04-02 06:45:02 +00:00
|
|
|
class ContentHostSingleBuffered : public ContentHostTexture
|
2013-11-27 21:16:34 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-08-20 04:55:14 +00:00
|
|
|
explicit ContentHostSingleBuffered(const TextureInfo& aTextureInfo)
|
2014-04-02 06:45:02 +00:00
|
|
|
: ContentHostTexture(aTextureInfo)
|
2013-11-27 21:16:34 +00:00
|
|
|
{}
|
2013-12-05 18:39:22 +00:00
|
|
|
virtual ~ContentHostSingleBuffered() {}
|
|
|
|
|
2014-04-26 02:34:06 +00:00
|
|
|
virtual CompositableType GetType() { return CompositableType::CONTENT_SINGLE; }
|
2013-12-05 18:39:22 +00:00
|
|
|
|
2014-02-20 13:05:32 +00:00
|
|
|
virtual bool UpdateThebes(const ThebesBufferData& aData,
|
2013-12-05 18:39:22 +00:00
|
|
|
const nsIntRegion& aUpdated,
|
|
|
|
const nsIntRegion& aOldValidRegionBack,
|
|
|
|
nsIntRegion* aUpdatedRegionBack);
|
|
|
|
};
|
|
|
|
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 09:20:52 +00:00
|
|
|
|
|
|
|
#endif
|