зеркало из https://github.com/mozilla/gecko-dev.git
Bug 932888. Rename ThebesLayerBuffer. r=mattwoodrow
--HG-- rename : gfx/layers/ThebesLayerBuffer.cpp => gfx/layers/RotatedBuffer.cpp rename : gfx/layers/ThebesLayerBuffer.h => gfx/layers/RotatedBuffer.h
This commit is contained in:
Родитель
0e18340ba9
Коммит
d265676d31
|
@ -3,7 +3,7 @@
|
|||
* 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/. */
|
||||
|
||||
#include "ThebesLayerBuffer.h"
|
||||
#include "RotatedBuffer.h"
|
||||
#include <sys/types.h> // for int32_t
|
||||
#include <algorithm> // for max
|
||||
#include "BasicImplData.h" // for BasicImplData
|
||||
|
@ -178,7 +178,7 @@ RotatedBuffer::DrawBufferWithRotation(gfx::DrawTarget *aTarget, ContextSource aS
|
|||
}
|
||||
|
||||
/* static */ bool
|
||||
ThebesLayerBuffer::IsClippingCheap(gfxContext* aTarget, const nsIntRegion& aRegion)
|
||||
RotatedContentBuffer::IsClippingCheap(gfxContext* aTarget, const nsIntRegion& aRegion)
|
||||
{
|
||||
// Assume clipping is cheap if the context just has an integer
|
||||
// translation, and the visible region is simple.
|
||||
|
@ -187,11 +187,11 @@ ThebesLayerBuffer::IsClippingCheap(gfxContext* aTarget, const nsIntRegion& aRegi
|
|||
}
|
||||
|
||||
void
|
||||
ThebesLayerBuffer::DrawTo(ThebesLayer* aLayer,
|
||||
gfxContext* aTarget,
|
||||
float aOpacity,
|
||||
gfxASurface* aMask,
|
||||
const gfxMatrix* aMaskTransform)
|
||||
RotatedContentBuffer::DrawTo(ThebesLayer* aLayer,
|
||||
gfxContext* aTarget,
|
||||
float aOpacity,
|
||||
gfxASurface* aMask,
|
||||
const gfxMatrix* aMaskTransform)
|
||||
{
|
||||
if (!EnsureBuffer()) {
|
||||
return;
|
||||
|
@ -236,7 +236,9 @@ ThebesLayerBuffer::DrawTo(ThebesLayer* aLayer,
|
|||
}
|
||||
|
||||
already_AddRefed<gfxContext>
|
||||
ThebesLayerBuffer::GetContextForQuadrantUpdate(const nsIntRect& aBounds, ContextSource aSource, nsIntPoint *aTopLeft)
|
||||
RotatedContentBuffer::GetContextForQuadrantUpdate(const nsIntRect& aBounds,
|
||||
ContextSource aSource,
|
||||
nsIntPoint *aTopLeft)
|
||||
{
|
||||
if (!EnsureBuffer()) {
|
||||
return nullptr;
|
||||
|
@ -277,7 +279,7 @@ ThebesLayerBuffer::GetContextForQuadrantUpdate(const nsIntRect& aBounds, Context
|
|||
}
|
||||
|
||||
gfxContentType
|
||||
ThebesLayerBuffer::BufferContentType()
|
||||
RotatedContentBuffer::BufferContentType()
|
||||
{
|
||||
if (mBufferProvider) {
|
||||
return mBufferProvider->GetContentType();
|
||||
|
@ -297,7 +299,7 @@ ThebesLayerBuffer::BufferContentType()
|
|||
}
|
||||
|
||||
bool
|
||||
ThebesLayerBuffer::BufferSizeOkFor(const nsIntSize& aSize)
|
||||
RotatedContentBuffer::BufferSizeOkFor(const nsIntSize& aSize)
|
||||
{
|
||||
return (aSize == mBufferRect.Size() ||
|
||||
(SizedToVisibleBounds != mBufferSizePolicy &&
|
||||
|
@ -305,7 +307,7 @@ ThebesLayerBuffer::BufferSizeOkFor(const nsIntSize& aSize)
|
|||
}
|
||||
|
||||
bool
|
||||
ThebesLayerBuffer::EnsureBuffer()
|
||||
RotatedContentBuffer::EnsureBuffer()
|
||||
{
|
||||
if (!mDTBuffer && mBufferProvider) {
|
||||
mDTBuffer = mBufferProvider->LockDrawTarget();
|
||||
|
@ -316,7 +318,7 @@ ThebesLayerBuffer::EnsureBuffer()
|
|||
}
|
||||
|
||||
bool
|
||||
ThebesLayerBuffer::EnsureBufferOnWhite()
|
||||
RotatedContentBuffer::EnsureBufferOnWhite()
|
||||
{
|
||||
if (!mDTBufferOnWhite && mBufferProviderOnWhite) {
|
||||
mDTBufferOnWhite = mBufferProviderOnWhite->LockDrawTarget();
|
||||
|
@ -327,13 +329,13 @@ ThebesLayerBuffer::EnsureBufferOnWhite()
|
|||
}
|
||||
|
||||
bool
|
||||
ThebesLayerBuffer::HaveBuffer() const
|
||||
RotatedContentBuffer::HaveBuffer() const
|
||||
{
|
||||
return mDTBuffer || mBufferProvider;
|
||||
}
|
||||
|
||||
bool
|
||||
ThebesLayerBuffer::HaveBufferOnWhite() const
|
||||
RotatedContentBuffer::HaveBufferOnWhite() const
|
||||
{
|
||||
return mDTBufferOnWhite || mBufferProviderOnWhite;
|
||||
}
|
||||
|
@ -375,9 +377,9 @@ ComputeBufferRect(const nsIntRect& aRequestedRect)
|
|||
return rect;
|
||||
}
|
||||
|
||||
ThebesLayerBuffer::PaintState
|
||||
ThebesLayerBuffer::BeginPaint(ThebesLayer* aLayer, ContentType aContentType,
|
||||
uint32_t aFlags)
|
||||
RotatedContentBuffer::PaintState
|
||||
RotatedContentBuffer::BeginPaint(ThebesLayer* aLayer, ContentType aContentType,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
PaintState result;
|
||||
// We need to disable rotation if we're going to be resampled when
|
||||
|
@ -458,7 +460,7 @@ ThebesLayerBuffer::BeginPaint(ThebesLayer* aLayer, ContentType aContentType,
|
|||
validRegion.SetEmpty();
|
||||
Clear();
|
||||
// Restart decision process with the cleared buffer. We can only go
|
||||
// around the loop one more iteration, since mBuffer is null now.
|
||||
// around the loop one more iteration, since mDTBuffer is null now.
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -485,7 +487,7 @@ ThebesLayerBuffer::BeginPaint(ThebesLayer* aLayer, ContentType aContentType,
|
|||
}
|
||||
nsIntRect keepArea;
|
||||
if (keepArea.IntersectRect(destBufferRect, mBufferRect)) {
|
||||
// Set mBufferRotation so that the pixels currently in mBuffer
|
||||
// Set mBufferRotation so that the pixels currently in mDTBuffer
|
||||
// will still be rendered in the right place when mBufferRect
|
||||
// changes to destBufferRect.
|
||||
nsIntPoint newRotation = mBufferRotation +
|
|
@ -3,8 +3,8 @@
|
|||
* 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 THEBESLAYERBUFFER_H_
|
||||
#define THEBESLAYERBUFFER_H_
|
||||
#ifndef ROTATEDBUFFER_H_
|
||||
#define ROTATEDBUFFER_H_
|
||||
|
||||
#include <stdint.h> // for uint32_t
|
||||
#include "gfxASurface.h" // for gfxASurface, etc
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
|
||||
/**
|
||||
* |BufferRect()| is the rect of device pixels that this
|
||||
* ThebesLayerBuffer covers. That is what DrawBufferWithRotation()
|
||||
* RotatedBuffer covers. That is what DrawBufferWithRotation()
|
||||
* will paint when it's called.
|
||||
*/
|
||||
const nsIntRect& BufferRect() const { return mBufferRect; }
|
||||
|
@ -140,7 +140,7 @@ protected:
|
|||
* This class encapsulates the buffer used to retain ThebesLayer contents,
|
||||
* i.e., the contents of the layer's GetVisibleRegion().
|
||||
*/
|
||||
class ThebesLayerBuffer : public RotatedBuffer {
|
||||
class RotatedContentBuffer : public RotatedBuffer {
|
||||
public:
|
||||
typedef gfxContentType ContentType;
|
||||
|
||||
|
@ -156,16 +156,16 @@ public:
|
|||
ContainsVisibleBounds
|
||||
};
|
||||
|
||||
ThebesLayerBuffer(BufferSizePolicy aBufferSizePolicy)
|
||||
RotatedContentBuffer(BufferSizePolicy aBufferSizePolicy)
|
||||
: mBufferProvider(nullptr)
|
||||
, mBufferProviderOnWhite(nullptr)
|
||||
, mBufferSizePolicy(aBufferSizePolicy)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ThebesLayerBuffer);
|
||||
MOZ_COUNT_CTOR(RotatedContentBuffer);
|
||||
}
|
||||
virtual ~ThebesLayerBuffer()
|
||||
virtual ~RotatedContentBuffer()
|
||||
{
|
||||
MOZ_COUNT_DTOR(ThebesLayerBuffer);
|
||||
MOZ_COUNT_DTOR(RotatedContentBuffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -184,7 +184,7 @@ public:
|
|||
/**
|
||||
* This is returned by BeginPaint. The caller should draw into mContext.
|
||||
* mRegionToDraw must be drawn. mRegionToInvalidate has been invalidated
|
||||
* by ThebesLayerBuffer and must be redrawn on the screen.
|
||||
* by RotatedContentBuffer and must be redrawn on the screen.
|
||||
* mRegionToInvalidate is set when the buffer has changed from
|
||||
* opaque to transparent or vice versa, since the details of rendering can
|
||||
* depend on the buffer type. mDidSelfCopy is true if we kept our buffer
|
||||
|
@ -286,7 +286,7 @@ protected:
|
|||
*
|
||||
* It's the caller's responsibility to ensure |aClient| is valid
|
||||
* for the duration of operations it requests of this
|
||||
* ThebesLayerBuffer. It's also the caller's responsibility to
|
||||
* RotatedContentBuffer. It's also the caller's responsibility to
|
||||
* unset the provider when inactive, by calling
|
||||
* SetBufferProvider(nullptr).
|
||||
*/
|
||||
|
@ -345,7 +345,7 @@ protected:
|
|||
virtual bool HaveBufferOnWhite() const;
|
||||
|
||||
/**
|
||||
* These members are only set transiently. They're used to map mBuffer
|
||||
* These members are only set transiently. They're used to map mDTBuffer
|
||||
* when we're using surfaces that require explicit map/unmap. Only one
|
||||
* may be used at a time.
|
||||
*/
|
||||
|
@ -358,4 +358,4 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* THEBESLAYERBUFFER_H_ */
|
||||
#endif /* ROTATEDBUFFER_H_ */
|
|
@ -173,16 +173,16 @@ BasicThebesLayer::Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
|||
uint32_t flags = 0;
|
||||
#ifndef MOZ_WIDGET_ANDROID
|
||||
if (BasicManager()->CompositorMightResample()) {
|
||||
flags |= ThebesLayerBuffer::PAINT_WILL_RESAMPLE;
|
||||
flags |= RotatedContentBuffer::PAINT_WILL_RESAMPLE;
|
||||
}
|
||||
if (!(flags & ThebesLayerBuffer::PAINT_WILL_RESAMPLE)) {
|
||||
if (!(flags & RotatedContentBuffer::PAINT_WILL_RESAMPLE)) {
|
||||
if (MayResample()) {
|
||||
flags |= ThebesLayerBuffer::PAINT_WILL_RESAMPLE;
|
||||
flags |= RotatedContentBuffer::PAINT_WILL_RESAMPLE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (mDrawAtomically) {
|
||||
flags |= ThebesLayerBuffer::PAINT_NO_ROTATION;
|
||||
flags |= RotatedContentBuffer::PAINT_NO_ROTATION;
|
||||
}
|
||||
PaintState state =
|
||||
mContentClient->BeginPaintBuffer(this, contentType, flags);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#define GFX_BASICTHEBESLAYER_H
|
||||
|
||||
#include "Layers.h" // for ThebesLayer, LayerManager, etc
|
||||
#include "ThebesLayerBuffer.h" // for ThebesLayerBuffer, etc
|
||||
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
||||
#include "BasicImplData.h" // for BasicImplData
|
||||
#include "BasicLayers.h" // for BasicLayerManager
|
||||
#include "gfx3DMatrix.h" // for gfx3DMatrix
|
||||
|
@ -28,8 +28,8 @@ class ReadbackProcessor;
|
|||
|
||||
class BasicThebesLayer : public ThebesLayer, public BasicImplData {
|
||||
public:
|
||||
typedef ThebesLayerBuffer::PaintState PaintState;
|
||||
typedef ThebesLayerBuffer::ContentType ContentType;
|
||||
typedef RotatedContentBuffer::PaintState PaintState;
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
BasicThebesLayer(BasicLayerManager* aLayerManager) :
|
||||
ThebesLayer(aLayerManager,
|
||||
|
|
|
@ -49,11 +49,11 @@ ClientThebesLayer::PaintThebes()
|
|||
uint32_t flags = 0;
|
||||
#ifndef MOZ_WIDGET_ANDROID
|
||||
if (ClientManager()->CompositorMightResample()) {
|
||||
flags |= ThebesLayerBuffer::PAINT_WILL_RESAMPLE;
|
||||
flags |= RotatedContentBuffer::PAINT_WILL_RESAMPLE;
|
||||
}
|
||||
if (!(flags & ThebesLayerBuffer::PAINT_WILL_RESAMPLE)) {
|
||||
if (!(flags & RotatedContentBuffer::PAINT_WILL_RESAMPLE)) {
|
||||
if (MayResample()) {
|
||||
flags |= ThebesLayerBuffer::PAINT_WILL_RESAMPLE;
|
||||
flags |= RotatedContentBuffer::PAINT_WILL_RESAMPLE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "ClientLayerManager.h" // for ClientLayerManager, etc
|
||||
#include "Layers.h" // for ThebesLayer, etc
|
||||
#include "ThebesLayerBuffer.h" // for ThebesLayerBuffer, etc
|
||||
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
||||
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "mozilla/layers/ContentClient.h" // for ContentClient
|
||||
|
@ -30,8 +30,8 @@ class SpecificLayerAttributes;
|
|||
class ClientThebesLayer : public ThebesLayer,
|
||||
public ClientLayer {
|
||||
public:
|
||||
typedef ThebesLayerBuffer::PaintState PaintState;
|
||||
typedef ThebesLayerBuffer::ContentType ContentType;
|
||||
typedef RotatedContentBuffer::PaintState PaintState;
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
ClientThebesLayer(ClientLayerManager* aLayerManager) :
|
||||
ThebesLayer(aLayerManager,
|
||||
|
|
|
@ -75,7 +75,9 @@ ContentClient::CreateContentClient(CompositableForwarder* aForwarder)
|
|||
|
||||
ContentClientBasic::ContentClientBasic(CompositableForwarder* aForwarder,
|
||||
BasicLayerManager* aManager)
|
||||
: ContentClient(aForwarder), ThebesLayerBuffer(ContainsVisibleBounds), mManager(aManager)
|
||||
: ContentClient(aForwarder)
|
||||
, RotatedContentBuffer(ContainsVisibleBounds)
|
||||
, mManager(aManager)
|
||||
{}
|
||||
|
||||
void
|
||||
|
@ -603,16 +605,16 @@ FillSurface(gfxASurface* aSurface, const nsIntRegion& aRegion,
|
|||
ctx->Paint();
|
||||
}
|
||||
|
||||
ThebesLayerBuffer::PaintState
|
||||
RotatedContentBuffer::PaintState
|
||||
ContentClientIncremental::BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
ThebesLayerBuffer::ContentType aContentType,
|
||||
RotatedContentBuffer::ContentType aContentType,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
mTextureInfo.mDeprecatedTextureHostFlags = 0;
|
||||
PaintState result;
|
||||
// We need to disable rotation if we're going to be resampled when
|
||||
// drawing, because we might sample across the rotation boundary.
|
||||
bool canHaveRotation = !(aFlags & ThebesLayerBuffer::PAINT_WILL_RESAMPLE);
|
||||
bool canHaveRotation = !(aFlags & RotatedContentBuffer::PAINT_WILL_RESAMPLE);
|
||||
|
||||
nsIntRegion validRegion = aLayer->GetValidRegion();
|
||||
|
||||
|
@ -629,7 +631,7 @@ ContentClientIncremental::BeginPaintBuffer(ThebesLayer* aLayer,
|
|||
// If we're going to resample, we need a buffer that's in clamp mode.
|
||||
canReuseBuffer = neededRegion.GetBounds().Size() <= mBufferRect.Size() &&
|
||||
mHasBuffer &&
|
||||
(!(aFlags & ThebesLayerBuffer::PAINT_WILL_RESAMPLE) ||
|
||||
(!(aFlags & RotatedContentBuffer::PAINT_WILL_RESAMPLE) ||
|
||||
!(mTextureInfo.mTextureFlags & TEXTURE_ALLOW_REPEAT));
|
||||
|
||||
if (canReuseBuffer) {
|
||||
|
@ -655,7 +657,7 @@ ContentClientIncremental::BeginPaintBuffer(ThebesLayer* aLayer,
|
|||
}
|
||||
}
|
||||
|
||||
if ((aFlags & ThebesLayerBuffer::PAINT_WILL_RESAMPLE) &&
|
||||
if ((aFlags & RotatedContentBuffer::PAINT_WILL_RESAMPLE) &&
|
||||
(!neededRegion.GetBounds().IsEqualInterior(destBufferRect) ||
|
||||
neededRegion.GetNumRects() > 1)) {
|
||||
// The area we add to neededRegion might not be painted opaquely
|
||||
|
@ -758,7 +760,7 @@ ContentClientIncremental::BeginPaintBuffer(ThebesLayer* aLayer,
|
|||
// The buffer's not big enough, so allocate a new one
|
||||
createdBuffer = true;
|
||||
}
|
||||
NS_ASSERTION(!(aFlags & ThebesLayerBuffer::PAINT_WILL_RESAMPLE) ||
|
||||
NS_ASSERTION(!(aFlags & RotatedContentBuffer::PAINT_WILL_RESAMPLE) ||
|
||||
destBufferRect == neededRegion.GetBounds(),
|
||||
"If we're resampling, we need to validate the entire buffer");
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#define MOZILLA_GFX_CONTENTCLIENT_H
|
||||
|
||||
#include <stdint.h> // for uint32_t
|
||||
#include "ThebesLayerBuffer.h" // for ThebesLayerBuffer, etc
|
||||
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
||||
#include "gfxTypes.h"
|
||||
#include "gfxPlatform.h" // for gfxPlatform
|
||||
#include "mozilla/Assertions.h" // for MOZ_CRASH
|
||||
|
@ -44,7 +44,7 @@ class ThebesLayer;
|
|||
/**
|
||||
* 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
|
||||
* optimisation work, encapsualted in ThebesLayerBuffers.
|
||||
* optimisation work, encapsualted in RotatedContentBuffers.
|
||||
*
|
||||
* 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
|
||||
|
@ -56,10 +56,10 @@ class ThebesLayer;
|
|||
* 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'
|
||||
* for the ThebesLayerBuffer (as in SetBuffer) means a gfxSurface. See the
|
||||
* comments for SetBuffer and SetBufferProvider in ThebesLayerBuffer. To keep
|
||||
* for the RotatedContentBuffer (as in SetBuffer) means a gfxSurface. See the
|
||||
* comments for SetBuffer and SetBufferProvider in RotatedContentBuffer. To keep
|
||||
* these mapped buffers alive, we store a pointer in mOldTextures if the
|
||||
* ThebesLayerBuffer's surface is not the one from our texture client, once we
|
||||
* RotatedContentBuffer's surface is not the one from our texture client, once we
|
||||
* are done painting we unmap the surface/texture client and don't need to keep
|
||||
* it alive anymore, so we clear mOldTextures.
|
||||
*
|
||||
|
@ -94,9 +94,9 @@ public:
|
|||
|
||||
|
||||
virtual void Clear() = 0;
|
||||
virtual ThebesLayerBuffer::PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
ThebesLayerBuffer::ContentType aContentType,
|
||||
uint32_t aFlags) = 0;
|
||||
virtual RotatedContentBuffer::PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
RotatedContentBuffer::ContentType aContentType,
|
||||
uint32_t aFlags) = 0;
|
||||
|
||||
// Sync front/back buffers content
|
||||
// After executing, the new back buffer has the same (interesting) pixels as
|
||||
|
@ -129,28 +129,28 @@ public:
|
|||
bool aDidSelfCopy) = 0;
|
||||
};
|
||||
|
||||
// thin wrapper around BasicThebesLayerBuffer, for on-mtc
|
||||
// thin wrapper around RotatedContentBuffer, for on-mtc
|
||||
class ContentClientBasic : public ContentClient
|
||||
, protected ThebesLayerBuffer
|
||||
, protected RotatedContentBuffer
|
||||
{
|
||||
public:
|
||||
ContentClientBasic(CompositableForwarder* aForwarder,
|
||||
BasicLayerManager* aManager);
|
||||
|
||||
typedef ThebesLayerBuffer::PaintState PaintState;
|
||||
typedef ThebesLayerBuffer::ContentType ContentType;
|
||||
typedef RotatedContentBuffer::PaintState PaintState;
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
virtual void Clear() { ThebesLayerBuffer::Clear(); }
|
||||
virtual void Clear() { RotatedContentBuffer::Clear(); }
|
||||
PaintState BeginPaintBuffer(ThebesLayer* aLayer, ContentType aContentType,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
return ThebesLayerBuffer::BeginPaint(aLayer, aContentType, aFlags);
|
||||
return RotatedContentBuffer::BeginPaint(aLayer, aContentType, aFlags);
|
||||
}
|
||||
|
||||
void DrawTo(ThebesLayer* aLayer, gfxContext* aTarget, float aOpacity,
|
||||
gfxASurface* aMask, const gfxMatrix* aMaskTransform)
|
||||
{
|
||||
ThebesLayerBuffer::DrawTo(aLayer, aTarget, aOpacity, aMask, aMaskTransform);
|
||||
RotatedContentBuffer::DrawTo(aLayer, aTarget, aOpacity, aMask, aMaskTransform);
|
||||
}
|
||||
|
||||
virtual void CreateBuffer(ContentType aType, const nsIntRect& aRect, uint32_t aFlags,
|
||||
|
@ -168,7 +168,7 @@ private:
|
|||
};
|
||||
|
||||
/**
|
||||
* A ContentClientRemote backed by a ThebesLayerBuffer.
|
||||
* A ContentClientRemote backed by a RotatedContentBuffer.
|
||||
*
|
||||
* When using a ContentClientRemote, SurfaceDescriptors are created on
|
||||
* the rendering side and destroyed on the compositing side. They are only
|
||||
|
@ -183,35 +183,35 @@ private:
|
|||
* create them.
|
||||
*/
|
||||
class ContentClientRemoteBuffer : public ContentClientRemote
|
||||
, protected ThebesLayerBuffer
|
||||
, protected RotatedContentBuffer
|
||||
{
|
||||
using ThebesLayerBuffer::BufferRect;
|
||||
using ThebesLayerBuffer::BufferRotation;
|
||||
using RotatedContentBuffer::BufferRect;
|
||||
using RotatedContentBuffer::BufferRotation;
|
||||
public:
|
||||
ContentClientRemoteBuffer(CompositableForwarder* aForwarder)
|
||||
: ContentClientRemote(aForwarder)
|
||||
, ThebesLayerBuffer(ContainsVisibleBounds)
|
||||
, RotatedContentBuffer(ContainsVisibleBounds)
|
||||
, mDeprecatedTextureClient(nullptr)
|
||||
, mIsNewBuffer(false)
|
||||
, mFrontAndBackBufferDiffer(false)
|
||||
, mContentType(GFX_CONTENT_COLOR_ALPHA)
|
||||
{}
|
||||
|
||||
typedef ThebesLayerBuffer::PaintState PaintState;
|
||||
typedef ThebesLayerBuffer::ContentType ContentType;
|
||||
typedef RotatedContentBuffer::PaintState PaintState;
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
virtual void Clear() { ThebesLayerBuffer::Clear(); }
|
||||
virtual void Clear() { RotatedContentBuffer::Clear(); }
|
||||
PaintState BeginPaintBuffer(ThebesLayer* aLayer, ContentType aContentType,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
return ThebesLayerBuffer::BeginPaint(aLayer, aContentType, aFlags);
|
||||
return RotatedContentBuffer::BeginPaint(aLayer, aContentType, aFlags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Begin/End Paint map a gfxASurface from the texture client
|
||||
* into the buffer of ThebesLayerBuffer. The surface is only
|
||||
* into the buffer of RotatedContentBuffer. The surface is only
|
||||
* valid when the texture client is locked, so is mapped out
|
||||
* of ThebesLayerBuffer when we are done painting.
|
||||
* of RotatedContentBuffer when we are done painting.
|
||||
* None of the underlying buffer attributes (rect, rotation)
|
||||
* are affected by mapping/unmapping.
|
||||
*/
|
||||
|
@ -227,11 +227,11 @@ public:
|
|||
// Expose these protected methods from the superclass.
|
||||
virtual const nsIntRect& BufferRect() const
|
||||
{
|
||||
return ThebesLayerBuffer::BufferRect();
|
||||
return RotatedContentBuffer::BufferRect();
|
||||
}
|
||||
virtual const nsIntPoint& BufferRotation() const
|
||||
{
|
||||
return ThebesLayerBuffer::BufferRotation();
|
||||
return RotatedContentBuffer::BufferRotation();
|
||||
}
|
||||
|
||||
virtual void CreateBuffer(ContentType aType, const nsIntRect& aRect, uint32_t aFlags,
|
||||
|
@ -364,8 +364,8 @@ public:
|
|||
mTextureInfo.mCompositableType = BUFFER_CONTENT_INC;
|
||||
}
|
||||
|
||||
typedef ThebesLayerBuffer::PaintState PaintState;
|
||||
typedef ThebesLayerBuffer::ContentType ContentType;
|
||||
typedef RotatedContentBuffer::PaintState PaintState;
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
virtual TextureInfo GetTextureInfo() const
|
||||
{
|
||||
|
@ -378,9 +378,9 @@ public:
|
|||
mHasBuffer = false;
|
||||
mHasBufferOnWhite = false;
|
||||
}
|
||||
virtual ThebesLayerBuffer::PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
ThebesLayerBuffer::ContentType aContentType,
|
||||
uint32_t aFlags);
|
||||
virtual RotatedContentBuffer::PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
RotatedContentBuffer::ContentType aContentType,
|
||||
uint32_t aFlags);
|
||||
|
||||
virtual void Updated(const nsIntRegion& aRegionToDraw,
|
||||
const nsIntRegion& aVisibleRegion,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <stdio.h> // for FILE
|
||||
#include "mozilla-config.h" // for MOZ_DUMP_PAINTING
|
||||
#include "CompositableHost.h" // for CompositableHost, etc
|
||||
#include "ThebesLayerBuffer.h" // for ThebesLayerBuffer, etc
|
||||
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
||||
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "mozilla/gfx/BasePoint.h" // for BasePoint
|
||||
|
@ -87,8 +87,8 @@ protected:
|
|||
class ContentHostBase : public ContentHost
|
||||
{
|
||||
public:
|
||||
typedef ThebesLayerBuffer::ContentType ContentType;
|
||||
typedef ThebesLayerBuffer::PaintState PaintState;
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
typedef RotatedContentBuffer::PaintState PaintState;
|
||||
|
||||
ContentHostBase(const TextureInfo& aTextureInfo);
|
||||
~ContentHostBase();
|
||||
|
|
|
@ -261,7 +261,7 @@ UNIFIED_SOURCES += [
|
|||
'opengl/TexturePoolOGL.cpp',
|
||||
'ReadbackProcessor.cpp',
|
||||
'RenderTrace.cpp',
|
||||
'ThebesLayerBuffer.cpp',
|
||||
'RotatedBuffer.cpp',
|
||||
'YCbCrImageDataSerializer.cpp',
|
||||
]
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче