2010-07-21 11:06:33 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2012-05-21 04:12:37 -07: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/. */
|
2010-03-03 13:37:04 -08:00
|
|
|
|
|
|
|
#ifndef THEBESLAYERBUFFER_H_
|
|
|
|
#define THEBESLAYERBUFFER_H_
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
#include <stdint.h> // for uint32_t
|
|
|
|
#include "gfxASurface.h" // for gfxASurface, etc
|
|
|
|
#include "gfxContext.h" // for gfxContext
|
|
|
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
|
|
|
#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef
|
|
|
|
#include "mozilla/gfx/2D.h" // for DrawTarget, etc
|
|
|
|
#include "mozilla/mozalloc.h" // for operator delete
|
|
|
|
#include "nsAutoPtr.h" // for nsRefPtr
|
|
|
|
#include "nsCOMPtr.h" // for already_AddRefed
|
|
|
|
#include "nsDebug.h" // for NS_RUNTIMEABORT
|
|
|
|
#include "nsISupportsImpl.h" // for gfxContext::AddRef, etc
|
|
|
|
#include "nsPoint.h" // for nsIntPoint
|
|
|
|
#include "nsRect.h" // for nsIntRect
|
|
|
|
#include "nsRegion.h" // for nsIntRegion
|
|
|
|
#include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc
|
|
|
|
|
|
|
|
struct gfxMatrix;
|
|
|
|
struct nsIntSize;
|
2010-03-03 13:37:04 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
2013-08-11 16:17:23 -07:00
|
|
|
namespace gfx {
|
|
|
|
class Matrix;
|
|
|
|
}
|
|
|
|
|
2010-03-03 13:37:04 -08:00
|
|
|
namespace layers {
|
|
|
|
|
2013-08-11 16:17:23 -07:00
|
|
|
class DeprecatedTextureClient;
|
2010-03-03 13:37:04 -08:00
|
|
|
class ThebesLayer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is a cairo/Thebes surface, but with a literal twist. Scrolling
|
|
|
|
* causes the layer's visible region to move. We want to keep
|
|
|
|
* reusing the same surface if the region size hasn't changed, but we don't
|
|
|
|
* want to keep moving the contents of the surface around in memory. So
|
|
|
|
* we use a trick.
|
|
|
|
* Consider just the vertical case, and suppose the buffer is H pixels
|
|
|
|
* high and we're scrolling down by N pixels. Instead of copying the
|
|
|
|
* buffer contents up by N pixels, we leave the buffer contents in place,
|
|
|
|
* and paint content rows H to H+N-1 into rows 0 to N-1 of the buffer.
|
|
|
|
* Then we can refresh the screen by painting rows N to H-1 of the buffer
|
|
|
|
* at row 0 on the screen, and then painting rows 0 to N-1 of the buffer
|
|
|
|
* at row H-N on the screen.
|
|
|
|
* mBufferRotation.y would be N in this example.
|
|
|
|
*/
|
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 RotatedBuffer {
|
|
|
|
public:
|
2013-09-24 13:45:13 -07:00
|
|
|
typedef gfxContentType ContentType;
|
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-21 19:40:52 -07:00
|
|
|
RotatedBuffer(gfxASurface* aBuffer, gfxASurface* aBufferOnWhite,
|
|
|
|
const nsIntRect& aBufferRect,
|
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
|
|
|
const nsIntPoint& aBufferRotation)
|
|
|
|
: mBuffer(aBuffer)
|
2013-04-21 19:40:52 -07:00
|
|
|
, mBufferOnWhite(aBufferOnWhite)
|
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
|
|
|
, mBufferRect(aBufferRect)
|
|
|
|
, mBufferRotation(aBufferRotation)
|
|
|
|
{ }
|
2013-04-21 19:40:52 -07:00
|
|
|
RotatedBuffer(gfx::DrawTarget* aDTBuffer, gfx::DrawTarget* aDTBufferOnWhite,
|
|
|
|
const nsIntRect& aBufferRect,
|
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
|
|
|
const nsIntPoint& aBufferRotation)
|
|
|
|
: mDTBuffer(aDTBuffer)
|
2013-04-21 19:40:52 -07:00
|
|
|
, mDTBufferOnWhite(aDTBufferOnWhite)
|
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
|
|
|
, mBufferRect(aBufferRect)
|
|
|
|
, mBufferRotation(aBufferRotation)
|
|
|
|
{ }
|
|
|
|
RotatedBuffer() { }
|
|
|
|
|
2013-04-21 19:40:52 -07:00
|
|
|
/*
|
|
|
|
* Which buffer should be drawn to/read from.
|
|
|
|
*/
|
|
|
|
enum ContextSource {
|
|
|
|
BUFFER_BLACK, // The normal buffer, or buffer with black background when using component alpha.
|
|
|
|
BUFFER_WHITE, // The buffer with white background, only valid with component alpha.
|
|
|
|
BUFFER_BOTH // The combined black/white buffers, only valid for writing operations, not reading.
|
|
|
|
};
|
|
|
|
void DrawBufferWithRotation(gfxContext* aTarget, ContextSource aSource,
|
|
|
|
float aOpacity = 1.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
|
|
|
gfxASurface* aMask = nullptr,
|
|
|
|
const gfxMatrix* aMaskTransform = nullptr) const;
|
|
|
|
|
2013-04-21 19:40:52 -07:00
|
|
|
void DrawBufferWithRotation(gfx::DrawTarget* aTarget, ContextSource aSource,
|
|
|
|
float aOpacity = 1.0,
|
2013-09-10 22:08:53 -07:00
|
|
|
gfx::CompositionOp aOperator = gfx::OP_OVER,
|
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
|
|
|
gfx::SourceSurface* aMask = nullptr,
|
|
|
|
const gfx::Matrix* aMaskTransform = nullptr) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* |BufferRect()| is the rect of device pixels that this
|
|
|
|
* ThebesLayerBuffer covers. That is what DrawBufferWithRotation()
|
|
|
|
* will paint when it's called.
|
|
|
|
*/
|
|
|
|
const nsIntRect& BufferRect() const { return mBufferRect; }
|
|
|
|
const nsIntPoint& BufferRotation() const { return mBufferRotation; }
|
|
|
|
|
2013-04-21 19:40:52 -07:00
|
|
|
virtual bool HaveBuffer() const { return mBuffer || mDTBuffer; }
|
|
|
|
virtual bool HaveBufferOnWhite() const { return mBufferOnWhite || mDTBufferOnWhite; }
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
enum XSide {
|
|
|
|
LEFT, RIGHT
|
|
|
|
};
|
|
|
|
enum YSide {
|
|
|
|
TOP, BOTTOM
|
|
|
|
};
|
|
|
|
nsIntRect GetQuadrantRectangle(XSide aXSide, YSide aYSide) const;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If aMask is non-null, then it is used as an alpha mask for rendering this
|
|
|
|
* buffer. aMaskTransform must be non-null if aMask is non-null, and is used
|
|
|
|
* to adjust the coordinate space of the mask.
|
|
|
|
*/
|
|
|
|
void DrawBufferQuadrant(gfxContext* aTarget, XSide aXSide, YSide aYSide,
|
2013-04-21 19:40:52 -07:00
|
|
|
ContextSource aSource,
|
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
|
|
|
float aOpacity,
|
|
|
|
gfxASurface* aMask,
|
|
|
|
const gfxMatrix* aMaskTransform) const;
|
|
|
|
void DrawBufferQuadrant(gfx::DrawTarget* aTarget, XSide aXSide, YSide aYSide,
|
2013-04-21 19:40:52 -07:00
|
|
|
ContextSource aSource,
|
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
|
|
|
float aOpacity,
|
2013-09-10 22:08:53 -07:00
|
|
|
gfx::CompositionOp aOperator,
|
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
|
|
|
gfx::SourceSurface* aMask,
|
|
|
|
const gfx::Matrix* aMaskTransform) const;
|
|
|
|
|
|
|
|
nsRefPtr<gfxASurface> mBuffer;
|
2013-04-21 19:40:52 -07:00
|
|
|
nsRefPtr<gfxASurface> mBufferOnWhite;
|
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
|
|
|
RefPtr<gfx::DrawTarget> mDTBuffer;
|
2013-04-21 19:40:52 -07:00
|
|
|
RefPtr<gfx::DrawTarget> mDTBufferOnWhite;
|
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 area of the ThebesLayer that is covered by the buffer as a whole */
|
|
|
|
nsIntRect mBufferRect;
|
|
|
|
/**
|
|
|
|
* The x and y rotation of the buffer. Conceptually the buffer
|
|
|
|
* has its origin translated to mBufferRect.TopLeft() - mBufferRotation,
|
|
|
|
* is tiled to fill the plane, and the result is clipped to mBufferRect.
|
|
|
|
* So the pixel at mBufferRotation within the buffer is what gets painted at
|
|
|
|
* mBufferRect.TopLeft().
|
|
|
|
* This is "rotation" in the sense of rotating items in a linear buffer,
|
|
|
|
* where items falling off the end of the buffer are returned to the
|
|
|
|
* buffer at the other end, not 2D rotation!
|
|
|
|
*/
|
|
|
|
nsIntPoint mBufferRotation;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class encapsulates the buffer used to retain ThebesLayer contents,
|
|
|
|
* i.e., the contents of the layer's GetVisibleRegion().
|
|
|
|
*/
|
|
|
|
class ThebesLayerBuffer : public RotatedBuffer {
|
2010-03-03 13:37:04 -08:00
|
|
|
public:
|
2013-09-24 13:45:13 -07:00
|
|
|
typedef gfxContentType ContentType;
|
2010-07-21 11:06:33 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Controls the size of the backing buffer of this.
|
|
|
|
* - SizedToVisibleBounds: the backing buffer is exactly the same
|
|
|
|
* size as the bounds of ThebesLayer's visible region
|
|
|
|
* - ContainsVisibleBounds: the backing buffer is large enough to
|
|
|
|
* fit visible bounds. May be larger.
|
|
|
|
*/
|
|
|
|
enum BufferSizePolicy {
|
|
|
|
SizedToVisibleBounds,
|
|
|
|
ContainsVisibleBounds
|
|
|
|
};
|
|
|
|
|
|
|
|
ThebesLayerBuffer(BufferSizePolicy aBufferSizePolicy)
|
2012-09-12 03:41:34 -07:00
|
|
|
: mBufferProvider(nullptr)
|
2013-04-21 19:40:52 -07:00
|
|
|
, mBufferProviderOnWhite(nullptr)
|
2010-07-21 11:06:33 -07:00
|
|
|
, mBufferSizePolicy(aBufferSizePolicy)
|
2010-03-03 13:37:04 -08:00
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(ThebesLayerBuffer);
|
|
|
|
}
|
2010-07-21 11:06:33 -07:00
|
|
|
virtual ~ThebesLayerBuffer()
|
2010-03-03 13:37:04 -08:00
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(ThebesLayerBuffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Wipe out all retained contents. Call this when the entire
|
|
|
|
* buffer becomes invalid.
|
|
|
|
*/
|
|
|
|
void Clear()
|
|
|
|
{
|
2012-07-30 07:20:58 -07:00
|
|
|
mBuffer = nullptr;
|
2013-04-21 19:40:52 -07:00
|
|
|
mBufferOnWhite = 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
|
|
|
mDTBuffer = nullptr;
|
2013-04-21 19:40:52 -07:00
|
|
|
mDTBufferOnWhite = nullptr;
|
2012-09-12 03:41:34 -07:00
|
|
|
mBufferProvider = nullptr;
|
2013-04-21 19:40:52 -07:00
|
|
|
mBufferProviderOnWhite = nullptr;
|
2011-04-18 20:07:23 -07:00
|
|
|
mBufferRect.SetEmpty();
|
2010-03-03 13:37:04 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
* mRegionToInvalidate is set when the buffer has changed from
|
|
|
|
* opaque to transparent or vice versa, since the details of rendering can
|
2011-03-11 21:22:39 -08:00
|
|
|
* depend on the buffer type. mDidSelfCopy is true if we kept our buffer
|
|
|
|
* but used MovePixels() to shift its content.
|
2010-03-03 13:37:04 -08:00
|
|
|
*/
|
|
|
|
struct PaintState {
|
2011-08-17 14:52:48 -07:00
|
|
|
PaintState()
|
2011-10-17 07:59:28 -07:00
|
|
|
: mDidSelfCopy(false)
|
2011-08-17 14:52:48 -07:00
|
|
|
{}
|
|
|
|
|
2010-03-03 13:37:04 -08:00
|
|
|
nsRefPtr<gfxContext> mContext;
|
|
|
|
nsIntRegion mRegionToDraw;
|
|
|
|
nsIntRegion mRegionToInvalidate;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mDidSelfCopy;
|
2010-03-03 13:37:04 -08:00
|
|
|
};
|
2010-07-21 11:06:33 -07:00
|
|
|
|
2011-03-01 12:30:16 -08:00
|
|
|
enum {
|
2012-03-18 17:01:47 -07:00
|
|
|
PAINT_WILL_RESAMPLE = 0x01,
|
|
|
|
PAINT_NO_ROTATION = 0x02
|
2011-03-01 12:30:16 -08:00
|
|
|
};
|
2010-03-03 13:37:04 -08:00
|
|
|
/**
|
2010-07-15 14:08:10 -07:00
|
|
|
* Start a drawing operation. This returns a PaintState describing what
|
2010-03-03 13:37:04 -08:00
|
|
|
* needs to be drawn to bring the buffer up to date in the visible region.
|
|
|
|
* This queries aLayer to get the currently valid and visible regions.
|
|
|
|
* The returned mContext may be null if mRegionToDraw is empty.
|
|
|
|
* Otherwise it must not be null.
|
|
|
|
* mRegionToInvalidate will contain mRegionToDraw.
|
2011-03-01 12:30:16 -08:00
|
|
|
* @param aFlags when PAINT_WILL_RESAMPLE is passed, this indicates that
|
|
|
|
* buffer will be resampled when rendering (i.e the effective transform
|
|
|
|
* combined with the scale for the resolution is not just an integer
|
|
|
|
* translation). This will disable buffer rotation (since we don't want
|
|
|
|
* to resample across the rotation boundary) and will ensure that we
|
|
|
|
* make the entire buffer contents valid (since we don't want to sample
|
|
|
|
* invalid pixels outside the visible region, if the visible region doesn't
|
|
|
|
* fill the buffer bounds).
|
2010-03-03 13:37:04 -08:00
|
|
|
*/
|
2010-09-03 13:10:46 -07:00
|
|
|
PaintState BeginPaint(ThebesLayer* aLayer, ContentType aContentType,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t aFlags);
|
2010-07-21 11:06:33 -07:00
|
|
|
|
2011-03-31 14:33:46 -07:00
|
|
|
enum {
|
2013-04-21 19:40:52 -07:00
|
|
|
ALLOW_REPEAT = 0x01,
|
|
|
|
BUFFER_COMPONENT_ALPHA = 0x02 // Dual buffers should be created for drawing with
|
|
|
|
// component alpha.
|
2011-03-31 14:33:46 -07:00
|
|
|
};
|
2010-03-03 13:37:04 -08:00
|
|
|
/**
|
2010-07-21 11:06:33 -07:00
|
|
|
* Return a new surface of |aSize| and |aType|.
|
2011-03-31 14:33:46 -07:00
|
|
|
* @param aFlags if ALLOW_REPEAT is set, then the buffer should be configured
|
|
|
|
* to allow repeat-mode, otherwise it should be in pad (clamp) mode
|
2013-09-11 21:53:46 -07:00
|
|
|
* If the created buffer supports azure content, then the result(s) will
|
|
|
|
* be returned in aBlackDT/aWhiteDT, otherwise aBlackSurface/aWhiteSurface
|
|
|
|
* will be used.
|
2010-03-03 13:37:04 -08:00
|
|
|
*/
|
2013-09-11 21:53:46 -07:00
|
|
|
virtual void
|
|
|
|
CreateBuffer(ContentType aType, const nsIntRect& aRect, uint32_t aFlags,
|
|
|
|
gfxASurface** aBlackSurface, gfxASurface** aWhiteSurface,
|
|
|
|
RefPtr<gfx::DrawTarget>* aBlackDT, RefPtr<gfx::DrawTarget>* aWhiteDT) = 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 bool SupportsAzureContent() const
|
|
|
|
{ return false; }
|
2010-03-03 13:37:04 -08:00
|
|
|
|
2010-07-15 14:08:10 -07:00
|
|
|
/**
|
|
|
|
* Get the underlying buffer, if any. This is useful because we can pass
|
|
|
|
* in the buffer as the default "reference surface" if there is one.
|
|
|
|
* Don't use it for anything else!
|
|
|
|
*/
|
|
|
|
gfxASurface* GetBuffer() { return mBuffer; }
|
2013-04-21 19:40:52 -07:00
|
|
|
gfxASurface* GetBufferOnWhite() { return mBufferOnWhite; }
|
2013-08-08 16:30:18 -07:00
|
|
|
gfx::DrawTarget* GetDTBuffer() { return mDTBuffer; }
|
|
|
|
gfx::DrawTarget* GetDTBufferOnWhite() { return mDTBufferOnWhite; }
|
2010-07-15 14:08:10 -07:00
|
|
|
|
2010-09-13 22:23:08 -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
|
|
|
* Complete the drawing operation. The region to draw must have been
|
|
|
|
* drawn before this is called. The contents of the buffer are drawn
|
|
|
|
* to aTarget.
|
2010-09-13 22:23:08 -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
|
|
|
void DrawTo(ThebesLayer* aLayer, gfxContext* aTarget, float aOpacity,
|
|
|
|
gfxASurface* aMask, const gfxMatrix* aMaskTransform);
|
|
|
|
|
|
|
|
protected:
|
2013-08-08 16:32:19 -07:00
|
|
|
// If this buffer is currently using Azure.
|
|
|
|
bool IsAzureBuffer();
|
2010-07-21 11:06:33 -07:00
|
|
|
|
2010-07-21 14:17:33 -07:00
|
|
|
already_AddRefed<gfxASurface>
|
2011-06-22 05:11:28 -07:00
|
|
|
SetBuffer(gfxASurface* aBuffer,
|
2010-07-21 14:17:33 -07:00
|
|
|
const nsIntRect& aBufferRect, const nsIntPoint& aBufferRotation)
|
|
|
|
{
|
2013-07-23 23:46:27 -07:00
|
|
|
MOZ_ASSERT(!SupportsAzureContent());
|
2010-09-13 22:23:08 -07:00
|
|
|
nsRefPtr<gfxASurface> tmp = mBuffer.forget();
|
2010-07-21 14:17:33 -07:00
|
|
|
mBuffer = aBuffer;
|
|
|
|
mBufferRect = aBufferRect;
|
|
|
|
mBufferRotation = aBufferRotation;
|
2010-09-13 22:23:08 -07:00
|
|
|
return tmp.forget();
|
2010-07-21 14:17:33 -07:00
|
|
|
}
|
|
|
|
|
2013-04-21 19:40:52 -07:00
|
|
|
already_AddRefed<gfxASurface>
|
|
|
|
SetBufferOnWhite(gfxASurface* aBuffer)
|
|
|
|
{
|
2013-08-08 16:30:18 -07:00
|
|
|
MOZ_ASSERT(!SupportsAzureContent());
|
2013-04-21 19:40:52 -07:00
|
|
|
nsRefPtr<gfxASurface> tmp = mBufferOnWhite.forget();
|
|
|
|
mBufferOnWhite = aBuffer;
|
|
|
|
return tmp.forget();
|
|
|
|
}
|
|
|
|
|
2013-08-08 16:30:18 -07:00
|
|
|
TemporaryRef<gfx::DrawTarget>
|
|
|
|
SetDTBuffer(gfx::DrawTarget* aBuffer,
|
|
|
|
const nsIntRect& aBufferRect, const nsIntPoint& aBufferRotation)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(SupportsAzureContent());
|
|
|
|
RefPtr<gfx::DrawTarget> tmp = mDTBuffer.forget();
|
|
|
|
mDTBuffer = aBuffer;
|
|
|
|
mBufferRect = aBufferRect;
|
|
|
|
mBufferRotation = aBufferRotation;
|
|
|
|
return tmp.forget();
|
|
|
|
}
|
|
|
|
|
|
|
|
TemporaryRef<gfx::DrawTarget>
|
|
|
|
SetDTBufferOnWhite(gfx::DrawTarget* aBuffer)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(SupportsAzureContent());
|
|
|
|
RefPtr<gfx::DrawTarget> tmp = mDTBufferOnWhite.forget();
|
|
|
|
mDTBufferOnWhite = aBuffer;
|
|
|
|
return tmp.forget();
|
|
|
|
}
|
|
|
|
|
2012-07-12 05:51:58 -07:00
|
|
|
/**
|
2013-04-21 19:40:52 -07:00
|
|
|
* Set the texture client only. This is used with surfaces that
|
|
|
|
* require explicit lock/unlock, which |aClient| is used to do on
|
2012-09-12 03:41:34 -07:00
|
|
|
* demand in this code.
|
|
|
|
*
|
2013-04-21 19:40:52 -07:00
|
|
|
* It's the caller's responsibility to ensure |aClient| is valid
|
2012-09-12 03:41:34 -07:00
|
|
|
* for the duration of operations it requests of this
|
|
|
|
* ThebesLayerBuffer. It's also the caller's responsibility to
|
|
|
|
* unset the provider when inactive, by calling
|
|
|
|
* SetBufferProvider(nullptr).
|
2012-07-12 05:51:58 -07:00
|
|
|
*/
|
2013-07-08 14:30:44 -07:00
|
|
|
void SetBufferProvider(DeprecatedTextureClient* aClient)
|
2012-07-12 05:51:58 -07:00
|
|
|
{
|
2013-04-21 19:40:52 -07:00
|
|
|
// Only this buffer provider can give us a buffer. If we
|
|
|
|
// already have one, something has gone wrong.
|
|
|
|
MOZ_ASSERT(!aClient || (!mBuffer && !mDTBuffer));
|
2012-07-12 05:51:58 -07:00
|
|
|
|
2013-04-21 19:40:52 -07:00
|
|
|
mBufferProvider = aClient;
|
|
|
|
if (!mBufferProvider) {
|
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
|
|
|
mBuffer = nullptr;
|
|
|
|
mDTBuffer = nullptr;
|
2013-04-21 19:40:52 -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
|
|
|
}
|
2013-04-21 19:40:52 -07:00
|
|
|
|
2013-07-08 14:30:44 -07:00
|
|
|
void SetBufferProviderOnWhite(DeprecatedTextureClient* aClient)
|
2013-04-21 19:40:52 -07:00
|
|
|
{
|
|
|
|
// Only this buffer provider can give us a buffer. If we
|
|
|
|
// already have one, something has gone wrong.
|
|
|
|
MOZ_ASSERT(!aClient || (!mBufferOnWhite && !mDTBufferOnWhite));
|
|
|
|
|
|
|
|
mBufferProviderOnWhite = aClient;
|
|
|
|
if (!mBufferProviderOnWhite) {
|
|
|
|
mBufferOnWhite = nullptr;
|
|
|
|
mDTBufferOnWhite = 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
|
|
|
|
2010-11-05 00:17:07 -07:00
|
|
|
/**
|
|
|
|
* Get a context at the specified resolution for updating |aBounds|,
|
|
|
|
* which must be contained within a single quadrant.
|
2013-05-09 14:02:50 -07:00
|
|
|
*
|
|
|
|
* Optionally returns the TopLeft coordinate of the quadrant being drawn to.
|
2010-11-05 00:17:07 -07:00
|
|
|
*/
|
|
|
|
already_AddRefed<gfxContext>
|
2013-05-09 14:02:50 -07:00
|
|
|
GetContextForQuadrantUpdate(const nsIntRect& aBounds, ContextSource aSource, nsIntPoint* aTopLeft = nullptr);
|
2010-11-05 00:17:07 -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
|
|
|
static bool IsClippingCheap(gfxContext* aTarget, const nsIntRegion& aRegion);
|
|
|
|
|
|
|
|
protected:
|
2012-09-12 03:41:34 -07:00
|
|
|
// Buffer helpers. Don't use mBuffer directly; instead use one of
|
|
|
|
// these helpers.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the buffer's content type. Requires a valid buffer or
|
|
|
|
* buffer provider.
|
|
|
|
*/
|
2013-09-24 13:45:13 -07:00
|
|
|
gfxContentType BufferContentType();
|
2012-09-12 03:41:34 -07:00
|
|
|
bool BufferSizeOkFor(const nsIntSize& aSize);
|
|
|
|
/**
|
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
|
|
|
* If the buffer hasn't been mapped, map it.
|
2012-09-12 03:41:34 -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
|
|
|
void EnsureBuffer();
|
2013-04-21 19:40:52 -07:00
|
|
|
void EnsureBufferOnWhite();
|
2012-09-12 03:41:34 -07:00
|
|
|
/**
|
|
|
|
* True if we have a buffer where we can get it (but not necessarily
|
|
|
|
* mapped currently).
|
|
|
|
*/
|
2013-04-21 19:40:52 -07:00
|
|
|
virtual bool HaveBuffer() const;
|
|
|
|
virtual bool HaveBufferOnWhite() const;
|
2010-07-21 11:06:33 -07:00
|
|
|
|
2012-09-12 03:41:34 -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
|
|
|
* These members are only set transiently. They're used to map mBuffer
|
|
|
|
* when we're using surfaces that require explicit map/unmap. Only one
|
|
|
|
* may be used at a time.
|
2012-09-12 03:41:34 -07:00
|
|
|
*/
|
2013-07-08 14:30:44 -07:00
|
|
|
DeprecatedTextureClient* mBufferProvider;
|
|
|
|
DeprecatedTextureClient* mBufferProviderOnWhite;
|
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
|
|
|
|
2010-07-21 11:06:33 -07:00
|
|
|
BufferSizePolicy mBufferSizePolicy;
|
2010-03-03 13:37:04 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* THEBESLAYERBUFFER_H_ */
|