mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1073103 - Rename ThebesLayer to PaintedLayer. r=roc
--HG-- rename : gfx/layers/basic/BasicThebesLayer.cpp => gfx/layers/basic/BasicPaintedLayer.cpp rename : gfx/layers/basic/BasicThebesLayer.h => gfx/layers/basic/BasicPaintedLayer.h rename : gfx/layers/client/ClientThebesLayer.cpp => gfx/layers/client/ClientPaintedLayer.cpp rename : gfx/layers/client/ClientThebesLayer.h => gfx/layers/client/ClientPaintedLayer.h rename : gfx/layers/client/ClientTiledThebesLayer.cpp => gfx/layers/client/ClientTiledPaintedLayer.cpp rename : gfx/layers/client/ClientTiledThebesLayer.h => gfx/layers/client/ClientTiledPaintedLayer.h rename : gfx/layers/composite/ThebesLayerComposite.cpp => gfx/layers/composite/PaintedLayerComposite.cpp rename : gfx/layers/composite/ThebesLayerComposite.h => gfx/layers/composite/PaintedLayerComposite.h rename : gfx/layers/d3d10/ThebesLayerD3D10.cpp => gfx/layers/d3d10/PaintedLayerD3D10.cpp rename : gfx/layers/d3d10/ThebesLayerD3D10.h => gfx/layers/d3d10/PaintedLayerD3D10.h rename : gfx/layers/d3d9/ThebesLayerD3D9.cpp => gfx/layers/d3d9/PaintedLayerD3D9.cpp rename : gfx/layers/d3d9/ThebesLayerD3D9.h => gfx/layers/d3d9/PaintedLayerD3D9.h
This commit is contained in:
parent
28cf64b8af
commit
131bfce4c5
@ -1463,7 +1463,7 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||
readonly attribute boolean mayHaveTouchEventListeners;
|
||||
|
||||
/**
|
||||
* Check if any ThebesLayer painting has been done for this element,
|
||||
* Check if any PaintedLayer painting has been done for this element,
|
||||
* clears the painted flags if they have.
|
||||
*/
|
||||
boolean checkAndClearPaintedState(in nsIDOMElement aElement);
|
||||
|
@ -1637,7 +1637,7 @@ NS_IMETHODIMP nsWebBrowser::EnsureDocShellTreeOwner()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static void DrawThebesLayer(ThebesLayer* aLayer,
|
||||
static void DrawPaintedLayer(PaintedLayer* aLayer,
|
||||
gfxContext* aContext,
|
||||
const nsIntRegion& aRegionToDraw,
|
||||
DrawRegionClip aClip,
|
||||
@ -1682,14 +1682,14 @@ bool nsWebBrowser::PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion)
|
||||
NS_ASSERTION(layerManager, "Must be in paint event");
|
||||
|
||||
layerManager->BeginTransaction();
|
||||
nsRefPtr<ThebesLayer> root = layerManager->CreateThebesLayer();
|
||||
nsRefPtr<PaintedLayer> root = layerManager->CreatePaintedLayer();
|
||||
if (root) {
|
||||
nsIntRect dirtyRect = aRegion.GetBounds();
|
||||
root->SetVisibleRegion(dirtyRect);
|
||||
layerManager->SetRoot(root);
|
||||
}
|
||||
|
||||
layerManager->EndTransaction(DrawThebesLayer, &mBackgroundColor);
|
||||
layerManager->EndTransaction(DrawPaintedLayer, &mBackgroundColor);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -162,16 +162,16 @@ MOZ_BEGIN_ENUM_CLASS(CompositableType, uint8_t)
|
||||
BUFFER_IMAGE_SINGLE, // image/canvas with a single texture, single buffered
|
||||
BUFFER_IMAGE_BUFFERED, // canvas, double buffered
|
||||
BUFFER_BRIDGE, // image bridge protocol
|
||||
BUFFER_CONTENT_INC, // thebes layer interface, only sends incremental
|
||||
BUFFER_CONTENT_INC, // painted layer interface, only sends incremental
|
||||
// updates to a texture on the compositor side.
|
||||
// somewhere in the middle
|
||||
BUFFER_TILED, // tiled thebes layer
|
||||
BUFFER_TILED, // tiled painted layer
|
||||
BUFFER_SIMPLE_TILED,
|
||||
// the new compositable types
|
||||
IMAGE, // image with single buffering
|
||||
IMAGE_OVERLAY, // image without buffer
|
||||
CONTENT_SINGLE, // thebes layer interface, single buffering
|
||||
CONTENT_DOUBLE, // thebes layer interface, double buffering
|
||||
CONTENT_SINGLE, // painted layer interface, single buffering
|
||||
CONTENT_DOUBLE, // painted layer interface, double buffering
|
||||
BUFFER_COUNT
|
||||
MOZ_END_ENUM_CLASS(CompositableType)
|
||||
|
||||
|
@ -44,8 +44,8 @@ void ImageLayer::ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSu
|
||||
}
|
||||
// Snap our local transform first, and snap the inherited transform as well.
|
||||
// This makes our snapping equivalent to what would happen if our content
|
||||
// was drawn into a ThebesLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the ThebesLayer).
|
||||
// was drawn into a PaintedLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the PaintedLayer).
|
||||
mEffectiveTransform =
|
||||
SnapTransform(local, sourceRect, nullptr) *
|
||||
SnapTransformTranslation(aTransformToSurface, nullptr);
|
||||
|
@ -36,7 +36,7 @@ MOZ_BEGIN_ENUM_CLASS(ImageFormat)
|
||||
* The CAIRO_SURFACE format creates a CairoImage. All backends should
|
||||
* support this format, because video rendering sometimes requires it.
|
||||
*
|
||||
* This format is useful even though a ThebesLayer could be used.
|
||||
* This format is useful even though a PaintedLayer could be used.
|
||||
* It makes it easy to render a cairo surface when another Image format
|
||||
* could be used. It can also avoid copying the surface data in some
|
||||
* cases.
|
||||
|
@ -77,7 +77,7 @@ namespace layers {
|
||||
* layers C1...Cn, where C1 has FrameMetrics FM1 and Cn has FrameMetrics Fn.
|
||||
* Although in this example C (in the first layer tree) and C0 (in the second
|
||||
* layer tree) are both ContainerLayers (because they have children), they
|
||||
* do not have to be. They may just be ThebesLayers or ColorLayers, for example,
|
||||
* do not have to be. They may just be PaintedLayers or ColorLayers, for example,
|
||||
* which do not have any children. However, the type of C will always be the
|
||||
* same as the type of C0.
|
||||
*
|
||||
|
@ -1151,11 +1151,11 @@ ContainerLayer::HasOpaqueAncestorLayer(Layer* aLayer)
|
||||
void
|
||||
ContainerLayer::DidRemoveChild(Layer* aLayer)
|
||||
{
|
||||
ThebesLayer* tl = aLayer->AsThebesLayer();
|
||||
PaintedLayer* tl = aLayer->AsPaintedLayer();
|
||||
if (tl && tl->UsedForReadback()) {
|
||||
for (Layer* l = mFirstChild; l; l = l->GetNextSibling()) {
|
||||
if (l->GetType() == TYPE_READBACK) {
|
||||
static_cast<ReadbackLayer*>(l)->NotifyThebesLayerRemoved(tl);
|
||||
static_cast<ReadbackLayer*>(l)->NotifyPaintedLayerRemoved(tl);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1620,7 +1620,7 @@ Layer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
PaintedLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
{
|
||||
Layer::PrintInfo(aStream, aPrefix);
|
||||
if (!mValidRegion.IsEmpty()) {
|
||||
@ -1629,13 +1629,13 @@ ThebesLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent)
|
||||
PaintedLayer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent)
|
||||
{
|
||||
Layer::DumpPacket(aPacket, aParent);
|
||||
// get this layer data
|
||||
using namespace layerscope;
|
||||
LayersPacket::Layer* layer = aPacket->mutable_layer(aPacket->layer_size()-1);
|
||||
layer->set_type(LayersPacket::Layer::ThebesLayer);
|
||||
layer->set_type(LayersPacket::Layer::PaintedLayer);
|
||||
if (!mValidRegion.IsEmpty()) {
|
||||
DumpRegion(layer->mutable_valid(), mValidRegion);
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ class ClientLayerManager;
|
||||
class CommonLayerAttributes;
|
||||
class Layer;
|
||||
class LayerMetricsWrapper;
|
||||
class ThebesLayer;
|
||||
class PaintedLayer;
|
||||
class ContainerLayer;
|
||||
class ImageLayer;
|
||||
class ColorLayer;
|
||||
@ -159,8 +159,8 @@ static void LayerManagerUserDataDestroy(void *data)
|
||||
* BeginTransaction and BeginTransactionWithTarget start a transaction in
|
||||
* the Construction phase. When the client has finished constructing the layer
|
||||
* tree, it should call EndConstruction() to enter the drawing phase.
|
||||
* 2) Drawing: ThebesLayers are rendered into in this phase, in tree
|
||||
* order. When the client has finished drawing into the ThebesLayers, it should
|
||||
* 2) Drawing: PaintedLayers are rendered into in this phase, in tree
|
||||
* order. When the client has finished drawing into the PaintedLayers, it should
|
||||
* call EndTransaction to complete the transaction.
|
||||
*
|
||||
* All layer API calls happen on the main thread.
|
||||
@ -235,7 +235,7 @@ public:
|
||||
enum EndTransactionFlags {
|
||||
END_DEFAULT = 0,
|
||||
END_NO_IMMEDIATE_REDRAW = 1 << 0, // Do not perform the drawing phase
|
||||
END_NO_COMPOSITE = 1 << 1, // Do not composite after drawing thebes layer contents.
|
||||
END_NO_COMPOSITE = 1 << 1, // Do not composite after drawing painted layer contents.
|
||||
END_NO_REMOTE_COMPOSITE = 1 << 2 // Do not schedule a composition with a remote Compositor, if one exists.
|
||||
};
|
||||
|
||||
@ -246,7 +246,7 @@ public:
|
||||
/**
|
||||
* Attempts to end an "empty transaction". There must have been no
|
||||
* changes to the layer tree since the BeginTransaction().
|
||||
* It's possible for this to fail; ThebesLayers may need to be updated
|
||||
* It's possible for this to fail; PaintedLayers may need to be updated
|
||||
* due to VRAM data being lost, for example. In such cases this method
|
||||
* returns false, and the caller must proceed with a normal layer tree
|
||||
* update and EndTransaction.
|
||||
@ -254,20 +254,20 @@ public:
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) = 0;
|
||||
|
||||
/**
|
||||
* Function called to draw the contents of each ThebesLayer.
|
||||
* Function called to draw the contents of each PaintedLayer.
|
||||
* aRegionToDraw contains the region that needs to be drawn.
|
||||
* This would normally be a subregion of the visible region.
|
||||
* The callee must draw all of aRegionToDraw. Drawing outside
|
||||
* aRegionToDraw will be clipped out or ignored.
|
||||
* The callee must draw all of aRegionToDraw.
|
||||
* This region is relative to 0,0 in the ThebesLayer.
|
||||
* This region is relative to 0,0 in the PaintedLayer.
|
||||
*
|
||||
* aRegionToInvalidate contains a region whose contents have been
|
||||
* changed by the layer manager and which must therefore be invalidated.
|
||||
* For example, this could be non-empty if a retained layer internally
|
||||
* switches from RGBA to RGB or back ... we might want to repaint it to
|
||||
* consistently use subpixel-AA or not.
|
||||
* This region is relative to 0,0 in the ThebesLayer.
|
||||
* This region is relative to 0,0 in the PaintedLayer.
|
||||
* aRegionToInvalidate may contain areas that are outside
|
||||
* aRegionToDraw; the callee must ensure that these areas are repainted
|
||||
* in the current layer manager transaction or in a later layer
|
||||
@ -277,9 +277,9 @@ public:
|
||||
* We guarantee that buffered contents in the visible
|
||||
* region are valid once drawing is complete.
|
||||
*
|
||||
* The origin of aContext is 0,0 in the ThebesLayer.
|
||||
* The origin of aContext is 0,0 in the PaintedLayer.
|
||||
*/
|
||||
typedef void (* DrawThebesLayerCallback)(ThebesLayer* aLayer,
|
||||
typedef void (* DrawPaintedLayerCallback)(PaintedLayer* aLayer,
|
||||
gfxContext* aContext,
|
||||
const nsIntRegion& aRegionToDraw,
|
||||
DrawRegionClip aClip,
|
||||
@ -289,11 +289,11 @@ public:
|
||||
/**
|
||||
* Finish the construction phase of the transaction, perform the
|
||||
* drawing phase, and end the transaction.
|
||||
* During the drawing phase, all ThebesLayers in the tree are
|
||||
* During the drawing phase, all PaintedLayers in the tree are
|
||||
* drawn in tree order, exactly once each, except for those layers
|
||||
* where it is known that the visible region is empty.
|
||||
*/
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT) = 0;
|
||||
|
||||
@ -379,29 +379,29 @@ public:
|
||||
* NONE: No hint.
|
||||
* SCROLLABLE: This layer may represent scrollable content.
|
||||
*/
|
||||
enum ThebesLayerCreationHint {
|
||||
enum PaintedLayerCreationHint {
|
||||
NONE, SCROLLABLE
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if aLayer is optimized for the given ThebesLayerCreationHint.
|
||||
* Returns true if aLayer is optimized for the given PaintedLayerCreationHint.
|
||||
*/
|
||||
virtual bool IsOptimizedFor(ThebesLayer* aLayer,
|
||||
ThebesLayerCreationHint aCreationHint)
|
||||
virtual bool IsOptimizedFor(PaintedLayer* aLayer,
|
||||
PaintedLayerCreationHint aCreationHint)
|
||||
{ return true; }
|
||||
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* Create a ThebesLayer for this manager's layer tree.
|
||||
* Create a PaintedLayer for this manager's layer tree.
|
||||
*/
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer() = 0;
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() = 0;
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* Create a ThebesLayer for this manager's layer tree, with a creation hint
|
||||
* Create a PaintedLayer for this manager's layer tree, with a creation hint
|
||||
* parameter to help optimise the type of layer created.
|
||||
*/
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayerWithHint(ThebesLayerCreationHint) {
|
||||
return CreateThebesLayer();
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayerWithHint(PaintedLayerCreationHint) {
|
||||
return CreatePaintedLayer();
|
||||
}
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
@ -791,7 +791,7 @@ public:
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* This lets layout make some promises about what will be drawn into the
|
||||
* visible region of the ThebesLayer. This enables internal quality
|
||||
* visible region of the PaintedLayer. This enables internal quality
|
||||
* and performance optimizations.
|
||||
*/
|
||||
void SetContentFlags(uint32_t aFlags)
|
||||
@ -1324,9 +1324,9 @@ public:
|
||||
|
||||
/**
|
||||
* Dynamic downcast to a Thebes layer. Returns null if this is not
|
||||
* a ThebesLayer.
|
||||
* a PaintedLayer.
|
||||
*/
|
||||
virtual ThebesLayer* AsThebesLayer() { return nullptr; }
|
||||
virtual PaintedLayer* AsPaintedLayer() { return nullptr; }
|
||||
|
||||
/**
|
||||
* Dynamic cast to a ContainerLayer. Returns null if this is not
|
||||
@ -1656,16 +1656,16 @@ protected:
|
||||
|
||||
/**
|
||||
* A Layer which we can draw into using Thebes. It is a conceptually
|
||||
* infinite surface, but each ThebesLayer has an associated "valid region"
|
||||
* of contents that it is currently storing, which is finite. ThebesLayer
|
||||
* infinite surface, but each PaintedLayer has an associated "valid region"
|
||||
* of contents that it is currently storing, which is finite. PaintedLayer
|
||||
* implementations can store content between paints.
|
||||
*
|
||||
* ThebesLayers are rendered into during the drawing phase of a transaction.
|
||||
* PaintedLayers are rendered into during the drawing phase of a transaction.
|
||||
*
|
||||
* Currently the contents of a ThebesLayer are in the device output color
|
||||
* Currently the contents of a PaintedLayer are in the device output color
|
||||
* space.
|
||||
*/
|
||||
class ThebesLayer : public Layer {
|
||||
class PaintedLayer : public Layer {
|
||||
public:
|
||||
/**
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
@ -1678,7 +1678,7 @@ public:
|
||||
* CONSTRUCTION PHASE ONLY
|
||||
* Set whether ComputeEffectiveTransforms should compute the
|
||||
* "residual translation" --- the translation that should be applied *before*
|
||||
* mEffectiveTransform to get the ideal transform for this ThebesLayer.
|
||||
* mEffectiveTransform to get the ideal transform for this PaintedLayer.
|
||||
* When this is true, ComputeEffectiveTransforms will compute the residual
|
||||
* and ensure that the layer is invalidated whenever the residual changes.
|
||||
* When it's false, a change in the residual will not trigger invalidation
|
||||
@ -1693,9 +1693,9 @@ public:
|
||||
*/
|
||||
const nsIntRegion& GetValidRegion() const { return mValidRegion; }
|
||||
|
||||
virtual ThebesLayer* AsThebesLayer() { return this; }
|
||||
virtual PaintedLayer* AsPaintedLayer() { return this; }
|
||||
|
||||
MOZ_LAYER_DECL_NAME("ThebesLayer", TYPE_THEBES)
|
||||
MOZ_LAYER_DECL_NAME("PaintedLayer", TYPE_THEBES)
|
||||
|
||||
virtual void ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSurface)
|
||||
{
|
||||
@ -1717,13 +1717,13 @@ public:
|
||||
ComputeEffectiveTransformForMaskLayer(aTransformToSurface);
|
||||
}
|
||||
|
||||
LayerManager::ThebesLayerCreationHint GetCreationHint() const { return mCreationHint; }
|
||||
LayerManager::PaintedLayerCreationHint GetCreationHint() const { return mCreationHint; }
|
||||
|
||||
bool UsedForReadback() { return mUsedForReadback; }
|
||||
void SetUsedForReadback(bool aUsed) { mUsedForReadback = aUsed; }
|
||||
/**
|
||||
* Returns the residual translation. Apply this translation when drawing
|
||||
* into the ThebesLayer so that when mEffectiveTransform is applied afterwards
|
||||
* into the PaintedLayer so that when mEffectiveTransform is applied afterwards
|
||||
* by layer compositing, the results exactly match the "ideal transform"
|
||||
* (the product of the transform of this layer and its ancestors).
|
||||
* Returns 0,0 unless SetAllowResidualTranslation(true) has been called.
|
||||
@ -1732,8 +1732,8 @@ public:
|
||||
gfxPoint GetResidualTranslation() const { return mResidualTranslation; }
|
||||
|
||||
protected:
|
||||
ThebesLayer(LayerManager* aManager, void* aImplData,
|
||||
LayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE)
|
||||
PaintedLayer(LayerManager* aManager, void* aImplData,
|
||||
LayerManager::PaintedLayerCreationHint aCreationHint = LayerManager::NONE)
|
||||
: Layer(aManager, aImplData)
|
||||
, mValidRegion()
|
||||
, mCreationHint(aCreationHint)
|
||||
@ -1757,9 +1757,9 @@ protected:
|
||||
/**
|
||||
* The creation hint that was used when constructing this layer.
|
||||
*/
|
||||
const LayerManager::ThebesLayerCreationHint mCreationHint;
|
||||
const LayerManager::PaintedLayerCreationHint mCreationHint;
|
||||
/**
|
||||
* Set when this ThebesLayer is participating in readback, i.e. some
|
||||
* Set when this PaintedLayer is participating in readback, i.e. some
|
||||
* ReadbackLayer (may) be getting its background from this layer.
|
||||
*/
|
||||
bool mUsedForReadback;
|
||||
@ -2127,8 +2127,8 @@ public:
|
||||
{
|
||||
// Snap our local transform first, and snap the inherited transform as well.
|
||||
// This makes our snapping equivalent to what would happen if our content
|
||||
// was drawn into a ThebesLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the ThebesLayer).
|
||||
// was drawn into a PaintedLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the PaintedLayer).
|
||||
mEffectiveTransform =
|
||||
SnapTransform(GetLocalTransform(), gfxRect(0, 0, mBounds.width, mBounds.height),
|
||||
nullptr)*
|
||||
|
@ -91,8 +91,8 @@ public:
|
||||
{
|
||||
// Snap our local transform first, and snap the inherited transform as well.
|
||||
// This makes our snapping equivalent to what would happen if our content
|
||||
// was drawn into a ThebesLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the ThebesLayer).
|
||||
// was drawn into a PaintedLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the PaintedLayer).
|
||||
mEffectiveTransform =
|
||||
SnapTransform(GetLocalTransform(), gfxRect(0, 0, mSize.width, mSize.height),
|
||||
nullptr)*
|
||||
@ -140,7 +140,7 @@ public:
|
||||
mSink = nullptr;
|
||||
}
|
||||
|
||||
void NotifyThebesLayerRemoved(ThebesLayer* aLayer)
|
||||
void NotifyPaintedLayerRemoved(PaintedLayer* aLayer)
|
||||
{
|
||||
if (mBackgroundLayer == aLayer) {
|
||||
mBackgroundLayer = nullptr;
|
||||
@ -182,14 +182,14 @@ protected:
|
||||
nsAutoPtr<ReadbackSink> mSink;
|
||||
nsIntSize mSize;
|
||||
|
||||
// This can refer to any (earlier) sibling ThebesLayer. That ThebesLayer
|
||||
// must have mUsedForReadback set on it. If the ThebesLayer is removed
|
||||
// for the container, this will be set to null by NotifyThebesLayerRemoved.
|
||||
// This ThebesLayer contains the contents which have previously been reported
|
||||
// to mSink. The ThebesLayer had only an integer translation transform,
|
||||
// This can refer to any (earlier) sibling PaintedLayer. That PaintedLayer
|
||||
// must have mUsedForReadback set on it. If the PaintedLayer is removed
|
||||
// for the container, this will be set to null by NotifyPaintedLayerRemoved.
|
||||
// This PaintedLayer contains the contents which have previously been reported
|
||||
// to mSink. The PaintedLayer had only an integer translation transform,
|
||||
// and it covered the entire readback area. This layer also had only an
|
||||
// integer translation transform.
|
||||
ThebesLayer* mBackgroundLayer;
|
||||
PaintedLayer* mBackgroundLayer;
|
||||
// When mBackgroundLayer is non-null, this is the offset to add to
|
||||
// convert from the coordinates of mBackgroundLayer to the coordinates
|
||||
// of this layer.
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "ReadbackProcessor.h"
|
||||
#include <sys/types.h> // for int32_t
|
||||
#include "Layers.h" // for Layer, ThebesLayer, etc
|
||||
#include "Layers.h" // for Layer, PaintedLayer, etc
|
||||
#include "ReadbackLayer.h" // for ReadbackLayer, ReadbackSink
|
||||
#include "gfxColor.h" // for gfxRGBA
|
||||
#include "gfxContext.h" // for gfxContext
|
||||
@ -119,19 +119,19 @@ ReadbackProcessor::BuildUpdatesForLayer(ReadbackLayer* aLayer)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
NS_ASSERTION(newBackground->AsThebesLayer(), "Must be ThebesLayer");
|
||||
ThebesLayer* thebesLayer = static_cast<ThebesLayer*>(newBackground);
|
||||
// updateRect is relative to the ThebesLayer
|
||||
NS_ASSERTION(newBackground->AsPaintedLayer(), "Must be PaintedLayer");
|
||||
PaintedLayer* paintedLayer = static_cast<PaintedLayer*>(newBackground);
|
||||
// updateRect is relative to the PaintedLayer
|
||||
nsIntRect updateRect = aLayer->GetRect() - offset;
|
||||
if (thebesLayer != aLayer->mBackgroundLayer ||
|
||||
if (paintedLayer != aLayer->mBackgroundLayer ||
|
||||
offset != aLayer->mBackgroundLayerOffset) {
|
||||
aLayer->mBackgroundLayer = thebesLayer;
|
||||
aLayer->mBackgroundLayer = paintedLayer;
|
||||
aLayer->mBackgroundLayerOffset = offset;
|
||||
aLayer->mBackgroundColor = gfxRGBA(0,0,0,0);
|
||||
thebesLayer->SetUsedForReadback(true);
|
||||
paintedLayer->SetUsedForReadback(true);
|
||||
} else {
|
||||
nsIntRegion invalid;
|
||||
invalid.Sub(updateRect, thebesLayer->GetValidRegion());
|
||||
invalid.Sub(updateRect, paintedLayer->GetValidRegion());
|
||||
updateRect = invalid.GetBounds();
|
||||
}
|
||||
|
||||
@ -141,11 +141,11 @@ ReadbackProcessor::BuildUpdatesForLayer(ReadbackLayer* aLayer)
|
||||
}
|
||||
|
||||
void
|
||||
ReadbackProcessor::GetThebesLayerUpdates(ThebesLayer* aLayer,
|
||||
ReadbackProcessor::GetPaintedLayerUpdates(PaintedLayer* aLayer,
|
||||
nsTArray<Update>* aUpdates,
|
||||
nsIntRegion* aUpdateRegion)
|
||||
{
|
||||
// All ThebesLayers used for readback are in mAllUpdates (some possibly
|
||||
// All PaintedLayers used for readback are in mAllUpdates (some possibly
|
||||
// with an empty update rect).
|
||||
aLayer->SetUsedForReadback(false);
|
||||
if (aUpdateRegion) {
|
||||
|
@ -17,32 +17,32 @@ namespace layers {
|
||||
|
||||
class ContainerLayer;
|
||||
class ReadbackLayer;
|
||||
class ThebesLayer;
|
||||
class PaintedLayer;
|
||||
|
||||
class ReadbackProcessor {
|
||||
public:
|
||||
/**
|
||||
* Called by the container before processing any child layers. Call this
|
||||
* if any child layer might have changed in any way (other than content-only
|
||||
* changes to layers other than ColorLayers and ThebesLayers).
|
||||
* changes to layers other than ColorLayers and PaintedLayers).
|
||||
*
|
||||
* This method recomputes the relationship between ReadbackLayers and
|
||||
* sibling layers, and dispatches changes to ReadbackLayers. Except that
|
||||
* if a ThebesLayer needs its contents sent to some ReadbackLayer, we'll
|
||||
* just record that internally and later the ThebesLayer should call
|
||||
* GetThebesLayerUpdates when it paints, to find out which rectangle needs
|
||||
* if a PaintedLayer needs its contents sent to some ReadbackLayer, we'll
|
||||
* just record that internally and later the PaintedLayer should call
|
||||
* GetPaintedLayerUpdates when it paints, to find out which rectangle needs
|
||||
* to be sent, and the ReadbackLayer it needs to be sent to.
|
||||
*/
|
||||
void BuildUpdates(ContainerLayer* aContainer);
|
||||
|
||||
struct Update {
|
||||
/**
|
||||
* The layer a ThebesLayer should send its contents to.
|
||||
* The layer a PaintedLayer should send its contents to.
|
||||
*/
|
||||
ReadbackLayer* mLayer;
|
||||
/**
|
||||
* The rectangle of content that it should send, in the ThebesLayer's
|
||||
* coordinate system. This rectangle is guaranteed to be in the ThebesLayer's
|
||||
* The rectangle of content that it should send, in the PaintedLayer's
|
||||
* coordinate system. This rectangle is guaranteed to be in the PaintedLayer's
|
||||
* visible region. Translate it to mLayer's coordinate system
|
||||
* by adding mLayer->GetBackgroundLayerOffset().
|
||||
*/
|
||||
@ -54,16 +54,16 @@ public:
|
||||
};
|
||||
/**
|
||||
* Appends any ReadbackLayers that need to be updated, and the rects that
|
||||
* need to be updated, to aUpdates. Only need to call this for ThebesLayers
|
||||
* need to be updated, to aUpdates. Only need to call this for PaintedLayers
|
||||
* that have been marked UsedForReadback().
|
||||
* Each Update's mLayer's mBackgroundLayer will have been set to aLayer.
|
||||
* If a ThebesLayer doesn't call GetThebesLayerUpdates, then all the
|
||||
* ReadbackLayers that needed data from that ThebesLayer will be marked
|
||||
* If a PaintedLayer doesn't call GetPaintedLayerUpdates, then all the
|
||||
* ReadbackLayers that needed data from that PaintedLayer will be marked
|
||||
* as having unknown backgrounds.
|
||||
* @param aUpdateRegion if non-null, this region is set to the union
|
||||
* of the mUpdateRects.
|
||||
*/
|
||||
void GetThebesLayerUpdates(ThebesLayer* aLayer,
|
||||
void GetPaintedLayerUpdates(PaintedLayer* aLayer,
|
||||
nsTArray<Update>* aUpdates,
|
||||
nsIntRegion* aUpdateRegion = nullptr);
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "BasicLayersImpl.h" // for ToData
|
||||
#include "BufferUnrotate.h" // for BufferUnrotate
|
||||
#include "GeckoProfiler.h" // for PROFILER_LABEL
|
||||
#include "Layers.h" // for ThebesLayer, Layer, etc
|
||||
#include "Layers.h" // for PaintedLayer, Layer, etc
|
||||
#include "gfxPlatform.h" // for gfxPlatform
|
||||
#include "gfxPrefs.h" // for gfxPrefs
|
||||
#include "gfxUtils.h" // for gfxUtils
|
||||
@ -203,7 +203,7 @@ RotatedContentBuffer::IsClippingCheap(DrawTarget* aTarget, const nsIntRegion& aR
|
||||
}
|
||||
|
||||
void
|
||||
RotatedContentBuffer::DrawTo(ThebesLayer* aLayer,
|
||||
RotatedContentBuffer::DrawTo(PaintedLayer* aLayer,
|
||||
DrawTarget* aTarget,
|
||||
float aOpacity,
|
||||
CompositionOp aOp,
|
||||
@ -428,7 +428,7 @@ RotatedContentBuffer::FlushBuffers()
|
||||
}
|
||||
|
||||
RotatedContentBuffer::PaintState
|
||||
RotatedContentBuffer::BeginPaint(ThebesLayer* aLayer,
|
||||
RotatedContentBuffer::BeginPaint(PaintedLayer* aLayer,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
PaintState result;
|
||||
|
@ -31,7 +31,7 @@ class Matrix;
|
||||
namespace layers {
|
||||
|
||||
class TextureClient;
|
||||
class ThebesLayer;
|
||||
class PaintedLayer;
|
||||
|
||||
/**
|
||||
* This is a cairo/Thebes surface, but with a literal twist. Scrolling
|
||||
@ -115,7 +115,7 @@ protected:
|
||||
gfx::SourceSurface* aMask,
|
||||
const gfx::Matrix* aMaskTransform) const;
|
||||
|
||||
/** The area of the ThebesLayer that is covered by the buffer as a whole */
|
||||
/** The area of the PaintedLayer that is covered by the buffer as a whole */
|
||||
nsIntRect mBufferRect;
|
||||
/**
|
||||
* The x and y rotation of the buffer. Conceptually the buffer
|
||||
@ -169,7 +169,7 @@ protected:
|
||||
};
|
||||
|
||||
/**
|
||||
* This class encapsulates the buffer used to retain ThebesLayer contents,
|
||||
* This class encapsulates the buffer used to retain PaintedLayer contents,
|
||||
* i.e., the contents of the layer's GetVisibleRegion().
|
||||
*/
|
||||
class RotatedContentBuffer : public RotatedBuffer
|
||||
@ -181,7 +181,7 @@ public:
|
||||
/**
|
||||
* 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
|
||||
* size as the bounds of PaintedLayer's visible region
|
||||
* - ContainsVisibleBounds: the backing buffer is large enough to
|
||||
* fit visible bounds. May be larger.
|
||||
*/
|
||||
@ -267,7 +267,7 @@ public:
|
||||
* will need to call BorrowDrawTargetForPainting multiple times to achieve
|
||||
* this.
|
||||
*/
|
||||
PaintState BeginPaint(ThebesLayer* aLayer,
|
||||
PaintState BeginPaint(PaintedLayer* aLayer,
|
||||
uint32_t aFlags);
|
||||
|
||||
struct DrawIterator {
|
||||
@ -333,7 +333,7 @@ public:
|
||||
* drawn before this is called. The contents of the buffer are drawn
|
||||
* to aTarget.
|
||||
*/
|
||||
void DrawTo(ThebesLayer* aLayer,
|
||||
void DrawTo(PaintedLayer* aLayer,
|
||||
gfx::DrawTarget* aTarget,
|
||||
float aOpacity,
|
||||
gfx::CompositionOp aOp,
|
||||
|
@ -115,7 +115,7 @@ BasicContainerLayer::ChildrenPartitionVisibleRegion(const nsIntRect& aInRect)
|
||||
}
|
||||
|
||||
void
|
||||
BasicContainerLayer::Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
BasicContainerLayer::Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback)
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
|
||||
void SetSupportsComponentAlphaChildren(bool aSupports) { mSupportsComponentAlphaChildren = aSupports; }
|
||||
|
||||
virtual void Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
virtual void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback) MOZ_OVERRIDE;
|
||||
|
||||
|
@ -31,9 +31,9 @@ class SurfaceDescriptor;
|
||||
* | | | | |
|
||||
* | +-> BasicContainerLayer <--+ | |
|
||||
* | | |
|
||||
* +-> ThebesLayer | |
|
||||
* +-> PaintedLayer | |
|
||||
* | | | |
|
||||
* | +-> BasicThebesLayer <---------+ |
|
||||
* | +-> BasicPaintedLayer <---------+ |
|
||||
* | |
|
||||
* +-> ImageLayer |
|
||||
* | |
|
||||
@ -64,17 +64,17 @@ public:
|
||||
Layer* aMaskLayer) {}
|
||||
|
||||
/**
|
||||
* Like Paint() but called for ThebesLayers with the additional parameters
|
||||
* Like Paint() but called for PaintedLayers with the additional parameters
|
||||
* they need.
|
||||
* If mClipToVisibleRegion is set, then the layer must clip to its
|
||||
* effective visible region (snapped or unsnapped, it doesn't matter).
|
||||
*/
|
||||
virtual void PaintThebes(gfxContext* aContext,
|
||||
Layer* aMasklayer,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData) {}
|
||||
|
||||
virtual void Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
virtual void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback) {}
|
||||
|
||||
|
@ -126,7 +126,7 @@ ToInsideIntRect(const gfxRect& aRect)
|
||||
class PaintLayerContext {
|
||||
public:
|
||||
PaintLayerContext(gfxContext* aTarget, Layer* aLayer,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
: mTarget(aTarget)
|
||||
, mTargetMatrixSR(aTarget)
|
||||
@ -196,7 +196,7 @@ public:
|
||||
gfxContext* mTarget;
|
||||
gfxContextMatrixAutoSaveRestore mTargetMatrixSR;
|
||||
Layer* mLayer;
|
||||
LayerManager::DrawThebesLayerCallback mCallback;
|
||||
LayerManager::DrawPaintedLayerCallback mCallback;
|
||||
void* mCallbackData;
|
||||
Matrix mTransform;
|
||||
bool mPushedOpaqueRect;
|
||||
@ -445,7 +445,7 @@ ApplyDoubleBuffering(Layer* aLayer, const nsIntRect& aVisibleRect)
|
||||
}
|
||||
|
||||
void
|
||||
BasicLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
BasicLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
@ -464,7 +464,7 @@ BasicLayerManager::AbortTransaction()
|
||||
}
|
||||
|
||||
bool
|
||||
BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
BasicLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
@ -727,7 +727,7 @@ BasicLayerManager::PaintSelfOrChildren(PaintLayerContext& aPaintContext,
|
||||
/* Only paint ourself, or our children - This optimization relies on this! */
|
||||
Layer* child = aPaintContext.mLayer->GetFirstChild();
|
||||
if (!child) {
|
||||
if (aPaintContext.mLayer->AsThebesLayer()) {
|
||||
if (aPaintContext.mLayer->AsPaintedLayer()) {
|
||||
data->PaintThebes(aGroupTarget, aPaintContext.mLayer->GetMaskLayer(),
|
||||
aPaintContext.mCallback, aPaintContext.mCallbackData);
|
||||
} else {
|
||||
@ -778,7 +778,7 @@ BasicLayerManager::FlushGroup(PaintLayerContext& aPaintContext, bool aNeedsClipT
|
||||
void
|
||||
BasicLayerManager::PaintLayer(gfxContext* aTarget,
|
||||
Layer* aLayer,
|
||||
DrawThebesLayerCallback aCallback,
|
||||
DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
PROFILER_LABEL("BasicLayerManager", "PaintLayer",
|
||||
@ -802,7 +802,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget,
|
||||
container->UseIntermediateSurface();
|
||||
BasicImplData* data = ToData(aLayer);
|
||||
bool needsClipToVisibleRegion =
|
||||
data->GetClipToVisibleRegion() && !aLayer->AsThebesLayer();
|
||||
data->GetClipToVisibleRegion() && !aLayer->AsPaintedLayer();
|
||||
NS_ASSERTION(needsGroup || !aLayer->GetFirstChild() ||
|
||||
container->GetOperator() == CompositionOp::OP_OVER,
|
||||
"non-OVER operator should have forced UseIntermediateSurface");
|
||||
|
@ -37,7 +37,7 @@ class ReadbackProcessor;
|
||||
* This is a cairo/Thebes-only, main-thread-only implementation of layers.
|
||||
*
|
||||
* In each transaction, the client sets up the layer tree and then during
|
||||
* the drawing phase, each ThebesLayer is painted directly into the target
|
||||
* the drawing phase, each PaintedLayer is painted directly into the target
|
||||
* context (with appropriate clipping and Push/PopGroups performed
|
||||
* between layers).
|
||||
*/
|
||||
@ -53,16 +53,16 @@ public:
|
||||
/**
|
||||
* Construct a BasicLayerManager which will have no default
|
||||
* target context. SetDefaultTarget or BeginTransactionWithTarget
|
||||
* must be called for any rendering to happen. ThebesLayers will not
|
||||
* must be called for any rendering to happen. PaintedLayers will not
|
||||
* be retained.
|
||||
*/
|
||||
explicit BasicLayerManager(BasicLayerManagerType aType);
|
||||
/**
|
||||
* Construct a BasicLayerManager which will have no default
|
||||
* target context. SetDefaultTarget or BeginTransactionWithTarget
|
||||
* must be called for any rendering to happen. ThebesLayers will be
|
||||
* must be called for any rendering to happen. PaintedLayers will be
|
||||
* retained; that is, we will try to retain the visible contents of
|
||||
* ThebesLayers as cairo surfaces. We create ThebesLayer buffers by
|
||||
* PaintedLayers as cairo surfaces. We create PaintedLayer buffers by
|
||||
* creating similar surfaces to the default target context, or to
|
||||
* aWidget's GetThebesSurface if there is no default target context, or
|
||||
* to the passed-in context if there is no widget and no default
|
||||
@ -102,7 +102,7 @@ public:
|
||||
virtual void BeginTransaction();
|
||||
virtual void BeginTransactionWithTarget(gfxContext* aTarget);
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
virtual bool ShouldAvoidComponentAlphaLayers() { return IsWidgetLayerManager(); }
|
||||
@ -111,7 +111,7 @@ public:
|
||||
|
||||
virtual void SetRoot(Layer* aLayer);
|
||||
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer();
|
||||
virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
|
||||
virtual already_AddRefed<ImageLayer> CreateImageLayer();
|
||||
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer();
|
||||
@ -169,19 +169,19 @@ protected:
|
||||
// Paints aLayer to mTarget.
|
||||
void PaintLayer(gfxContext* aTarget,
|
||||
Layer* aLayer,
|
||||
DrawThebesLayerCallback aCallback,
|
||||
DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
// Clear the contents of a layer
|
||||
void ClearLayer(Layer* aLayer);
|
||||
|
||||
bool EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
bool EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
void FlashWidgetUpdateArea(gfxContext* aContext);
|
||||
|
||||
// Widget whose surface should be used as the basis for ThebesLayer
|
||||
// Widget whose surface should be used as the basis for PaintedLayer
|
||||
// buffers.
|
||||
nsIWidget* mWidget;
|
||||
// The default context for BeginTransaction.
|
||||
|
@ -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 "BasicThebesLayer.h"
|
||||
#include "BasicPaintedLayer.h"
|
||||
#include <stdint.h> // for uint32_t
|
||||
#include "GeckoProfiler.h" // for PROFILER_LABEL
|
||||
#include "ReadbackLayer.h" // for ReadbackLayer, ReadbackSink
|
||||
@ -45,12 +45,12 @@ IntersectWithClip(const nsIntRegion& aRegion, gfxContext* aContext)
|
||||
}
|
||||
|
||||
void
|
||||
BasicThebesLayer::PaintThebes(gfxContext* aContext,
|
||||
BasicPaintedLayer::PaintThebes(gfxContext* aContext,
|
||||
Layer* aMaskLayer,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
PROFILER_LABEL("BasicThebesLayer", "PaintThebes",
|
||||
PROFILER_LABEL("BasicPaintedLayer", "PaintThebes",
|
||||
js::ProfileEntry::Category::GRAPHICS);
|
||||
|
||||
NS_ASSERTION(BasicManager()->InDrawing(),
|
||||
@ -132,7 +132,7 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
|
||||
}
|
||||
|
||||
void
|
||||
BasicThebesLayer::Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
BasicPaintedLayer::Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback)
|
||||
{
|
||||
@ -148,7 +148,7 @@ BasicThebesLayer::Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
|
||||
nsTArray<ReadbackProcessor::Update> readbackUpdates;
|
||||
if (aReadback && UsedForReadback()) {
|
||||
aReadback->GetThebesLayerUpdates(this, &readbackUpdates);
|
||||
aReadback->GetPaintedLayerUpdates(this, &readbackUpdates);
|
||||
}
|
||||
|
||||
uint32_t flags = 0;
|
||||
@ -218,11 +218,11 @@ BasicThebesLayer::Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
}
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
BasicLayerManager::CreateThebesLayer()
|
||||
already_AddRefed<PaintedLayer>
|
||||
BasicLayerManager::CreatePaintedLayer()
|
||||
{
|
||||
NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
|
||||
nsRefPtr<ThebesLayer> layer = new BasicThebesLayer(this);
|
||||
nsRefPtr<PaintedLayer> layer = new BasicPaintedLayer(this);
|
||||
return layer.forget();
|
||||
}
|
||||
|
@ -3,10 +3,10 @@
|
||||
* 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_BASICTHEBESLAYER_H
|
||||
#define GFX_BASICTHEBESLAYER_H
|
||||
#ifndef GFX_BASICPAINTEDLAYER_H
|
||||
#define GFX_BASICPAINTEDLAYER_H
|
||||
|
||||
#include "Layers.h" // for ThebesLayer, LayerManager, etc
|
||||
#include "Layers.h" // for PaintedLayer, LayerManager, etc
|
||||
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
||||
#include "BasicImplData.h" // for BasicImplData
|
||||
#include "BasicLayers.h" // for BasicLayerManager
|
||||
@ -25,23 +25,23 @@ namespace layers {
|
||||
|
||||
class ReadbackProcessor;
|
||||
|
||||
class BasicThebesLayer : public ThebesLayer, public BasicImplData {
|
||||
class BasicPaintedLayer : public PaintedLayer, public BasicImplData {
|
||||
public:
|
||||
typedef RotatedContentBuffer::PaintState PaintState;
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
explicit BasicThebesLayer(BasicLayerManager* aLayerManager) :
|
||||
ThebesLayer(aLayerManager,
|
||||
explicit BasicPaintedLayer(BasicLayerManager* aLayerManager) :
|
||||
PaintedLayer(aLayerManager,
|
||||
static_cast<BasicImplData*>(MOZ_THIS_IN_INITIALIZER_LIST())),
|
||||
mContentClient(nullptr)
|
||||
{
|
||||
MOZ_COUNT_CTOR(BasicThebesLayer);
|
||||
MOZ_COUNT_CTOR(BasicPaintedLayer);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~BasicThebesLayer()
|
||||
virtual ~BasicPaintedLayer()
|
||||
{
|
||||
MOZ_COUNT_DTOR(BasicThebesLayer);
|
||||
MOZ_COUNT_DTOR(BasicPaintedLayer);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -49,7 +49,7 @@ public:
|
||||
{
|
||||
NS_ASSERTION(BasicManager()->InConstruction(),
|
||||
"Can only set properties in construction phase");
|
||||
ThebesLayer::SetVisibleRegion(aRegion);
|
||||
PaintedLayer::SetVisibleRegion(aRegion);
|
||||
}
|
||||
virtual void InvalidateRegion(const nsIntRegion& aRegion)
|
||||
{
|
||||
@ -62,10 +62,10 @@ public:
|
||||
|
||||
virtual void PaintThebes(gfxContext* aContext,
|
||||
Layer* aMaskLayer,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
virtual void Validate(LayerManager::DrawThebesLayerCallback aCallback,
|
||||
virtual void Validate(LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback) MOZ_OVERRIDE;
|
||||
|
||||
@ -90,7 +90,7 @@ public:
|
||||
ComputeEffectiveTransformForMaskLayer(aTransformToSurface);
|
||||
return;
|
||||
}
|
||||
ThebesLayer::ComputeEffectiveTransforms(aTransformToSurface);
|
||||
PaintedLayer::ComputeEffectiveTransforms(aTransformToSurface);
|
||||
}
|
||||
|
||||
BasicLayerManager* BasicManager()
|
||||
@ -106,7 +106,7 @@ protected:
|
||||
const nsIntRegion& aRegionToInvalidate,
|
||||
bool aDidSelfCopy,
|
||||
DrawRegionClip aClip,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
if (!aCallback) {
|
@ -16,7 +16,7 @@
|
||||
#include "nsRegion.h" // for nsIntRegion
|
||||
#include "nsTArray.h" // for nsAutoTArray
|
||||
#include "ReadbackProcessor.h"
|
||||
#include "ClientThebesLayer.h"
|
||||
#include "ClientPaintedLayer.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
@ -203,7 +203,7 @@ ClientLayerManager::BeginTransactionWithTarget(gfxContext* aTarget)
|
||||
mForwarder->BeginTransaction(targetBounds, mTargetRotation, orientation);
|
||||
|
||||
// If we're drawing on behalf of a context with async pan/zoom
|
||||
// enabled, then the entire buffer of thebes layers might be
|
||||
// enabled, then the entire buffer of painted layers might be
|
||||
// composited (including resampling) asynchronously before we get
|
||||
// a chance to repaint, so we have to ensure that it's all valid
|
||||
// and not rotated.
|
||||
@ -233,7 +233,7 @@ ClientLayerManager::BeginTransaction()
|
||||
}
|
||||
|
||||
bool
|
||||
ClientLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
ClientLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags)
|
||||
{
|
||||
@ -257,8 +257,8 @@ ClientLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
// properties.
|
||||
GetRoot()->ApplyPendingUpdatesToSubtree();
|
||||
|
||||
mThebesLayerCallback = aCallback;
|
||||
mThebesLayerCallbackData = aCallbackData;
|
||||
mPaintedLayerCallback = aCallback;
|
||||
mPaintedLayerCallbackData = aCallbackData;
|
||||
|
||||
GetRoot()->ComputeEffectiveTransforms(Matrix4x4());
|
||||
|
||||
@ -267,8 +267,8 @@ ClientLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
GetRoot()->Mutated();
|
||||
}
|
||||
|
||||
mThebesLayerCallback = nullptr;
|
||||
mThebesLayerCallbackData = nullptr;
|
||||
mPaintedLayerCallback = nullptr;
|
||||
mPaintedLayerCallbackData = nullptr;
|
||||
|
||||
// Go back to the construction phase if the transaction isn't complete.
|
||||
// Layout will update the layer tree and call EndTransaction().
|
||||
@ -285,7 +285,7 @@ ClientLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
}
|
||||
|
||||
void
|
||||
ClientLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
ClientLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ class nsIWidget;
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class ClientThebesLayer;
|
||||
class ClientPaintedLayer;
|
||||
class CompositorChild;
|
||||
class ImageLayer;
|
||||
class PLayerChild;
|
||||
@ -71,7 +71,7 @@ public:
|
||||
virtual void BeginTransactionWithTarget(gfxContext* aTarget);
|
||||
virtual void BeginTransaction();
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
@ -87,10 +87,10 @@ public:
|
||||
|
||||
virtual void Mutated(Layer* aLayer);
|
||||
|
||||
virtual bool IsOptimizedFor(ThebesLayer* aLayer, ThebesLayerCreationHint aHint);
|
||||
virtual bool IsOptimizedFor(PaintedLayer* aLayer, PaintedLayerCreationHint aHint);
|
||||
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayerWithHint(ThebesLayerCreationHint aHint);
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer();
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayerWithHint(PaintedLayerCreationHint aHint);
|
||||
virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
|
||||
virtual already_AddRefed<ImageLayer> CreateImageLayer();
|
||||
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer();
|
||||
@ -148,11 +148,11 @@ public:
|
||||
|
||||
bool CompositorMightResample() { return mCompositorMightResample; }
|
||||
|
||||
DrawThebesLayerCallback GetThebesLayerCallback() const
|
||||
{ return mThebesLayerCallback; }
|
||||
DrawPaintedLayerCallback GetPaintedLayerCallback() const
|
||||
{ return mPaintedLayerCallback; }
|
||||
|
||||
void* GetThebesLayerCallbackData() const
|
||||
{ return mThebesLayerCallbackData; }
|
||||
void* GetPaintedLayerCallbackData() const
|
||||
{ return mPaintedLayerCallbackData; }
|
||||
|
||||
CompositorChild* GetRemoteRenderer();
|
||||
|
||||
@ -284,7 +284,7 @@ private:
|
||||
|
||||
void ClearLayer(Layer* aLayer);
|
||||
|
||||
bool EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
bool EndTransactionInternal(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags);
|
||||
|
||||
@ -294,8 +294,8 @@ private:
|
||||
|
||||
/* Thebes layer callbacks; valid at the end of a transaciton,
|
||||
* while rendering */
|
||||
DrawThebesLayerCallback mThebesLayerCallback;
|
||||
void *mThebesLayerCallbackData;
|
||||
DrawPaintedLayerCallback mPaintedLayerCallback;
|
||||
void *mPaintedLayerCallbackData;
|
||||
|
||||
// When we're doing a transaction in order to draw to a non-default
|
||||
// target, the layers transaction is only performed in order to send
|
||||
@ -369,7 +369,7 @@ public:
|
||||
virtual void RenderLayer() = 0;
|
||||
virtual void RenderLayerWithReadback(ReadbackProcessor *aReadback) { RenderLayer(); }
|
||||
|
||||
virtual ClientThebesLayer* AsThebes() { return nullptr; }
|
||||
virtual ClientPaintedLayer* AsThebes() { return nullptr; }
|
||||
|
||||
static inline ClientLayer *
|
||||
ToClientLayer(Layer* aLayer)
|
||||
|
@ -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/. */
|
||||
|
||||
#include "ClientThebesLayer.h"
|
||||
#include "ClientTiledThebesLayer.h" // for ClientTiledThebesLayer
|
||||
#include "ClientPaintedLayer.h"
|
||||
#include "ClientTiledPaintedLayer.h" // for ClientTiledPaintedLayer
|
||||
#include <stdint.h> // for uint32_t
|
||||
#include "GeckoProfiler.h" // for PROFILER_LABEL
|
||||
#include "client/ClientLayerManager.h" // for ClientLayerManager, etc
|
||||
@ -31,9 +31,9 @@ namespace layers {
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
void
|
||||
ClientThebesLayer::PaintThebes()
|
||||
ClientPaintedLayer::PaintThebes()
|
||||
{
|
||||
PROFILER_LABEL("ClientThebesLayer", "PaintThebes",
|
||||
PROFILER_LABEL("ClientPaintedLayer", "PaintThebes",
|
||||
js::ProfileEntry::Category::GRAPHICS);
|
||||
|
||||
NS_ASSERTION(ClientManager()->InDrawing(),
|
||||
@ -54,7 +54,7 @@ ClientThebesLayer::PaintThebes()
|
||||
mContentClient->BeginPaintBuffer(this, flags);
|
||||
mValidRegion.Sub(mValidRegion, state.mRegionToInvalidate);
|
||||
|
||||
if (!state.mRegionToDraw.IsEmpty() && !ClientManager()->GetThebesLayerCallback()) {
|
||||
if (!state.mRegionToDraw.IsEmpty() && !ClientManager()->GetPaintedLayerCallback()) {
|
||||
ClientManager()->SetTransactionIncomplete();
|
||||
return;
|
||||
}
|
||||
@ -73,12 +73,12 @@ ClientThebesLayer::PaintThebes()
|
||||
|
||||
nsRefPtr<gfxContext> ctx = gfxContext::ContextForDrawTarget(target);
|
||||
|
||||
ClientManager()->GetThebesLayerCallback()(this,
|
||||
ClientManager()->GetPaintedLayerCallback()(this,
|
||||
ctx,
|
||||
iter.mDrawRegion,
|
||||
state.mClip,
|
||||
state.mRegionToInvalidate,
|
||||
ClientManager()->GetThebesLayerCallbackData());
|
||||
ClientManager()->GetPaintedLayerCallbackData());
|
||||
|
||||
ctx = nullptr;
|
||||
mContentClient->ReturnDrawTargetToBuffer(target);
|
||||
@ -104,7 +104,7 @@ ClientThebesLayer::PaintThebes()
|
||||
}
|
||||
|
||||
void
|
||||
ClientThebesLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
|
||||
ClientPaintedLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
|
||||
{
|
||||
if (GetMaskLayer()) {
|
||||
ToClientLayer(GetMaskLayer())->RenderLayer();
|
||||
@ -123,7 +123,7 @@ ClientThebesLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
|
||||
nsTArray<ReadbackProcessor::Update> readbackUpdates;
|
||||
nsIntRegion readbackRegion;
|
||||
if (aReadback && UsedForReadback()) {
|
||||
aReadback->GetThebesLayerUpdates(this, &readbackUpdates);
|
||||
aReadback->GetPaintedLayerUpdates(this, &readbackUpdates);
|
||||
}
|
||||
|
||||
IntPoint origin(mVisibleRegion.GetBounds().x, mVisibleRegion.GetBounds().y);
|
||||
@ -133,7 +133,7 @@ ClientThebesLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
|
||||
}
|
||||
|
||||
bool
|
||||
ClientLayerManager::IsOptimizedFor(ThebesLayer* aLayer, ThebesLayerCreationHint aHint)
|
||||
ClientLayerManager::IsOptimizedFor(PaintedLayer* aLayer, PaintedLayerCreationHint aHint)
|
||||
{
|
||||
#ifdef MOZ_B2G
|
||||
// The only creation hint is whether the layer is scrollable or not, and this
|
||||
@ -148,14 +148,14 @@ ClientLayerManager::IsOptimizedFor(ThebesLayer* aLayer, ThebesLayerCreationHint
|
||||
#endif
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
ClientLayerManager::CreateThebesLayer()
|
||||
already_AddRefed<PaintedLayer>
|
||||
ClientLayerManager::CreatePaintedLayer()
|
||||
{
|
||||
return CreateThebesLayerWithHint(NONE);
|
||||
return CreatePaintedLayerWithHint(NONE);
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
ClientLayerManager::CreateThebesLayerWithHint(ThebesLayerCreationHint aHint)
|
||||
already_AddRefed<PaintedLayer>
|
||||
ClientLayerManager::CreatePaintedLayerWithHint(PaintedLayerCreationHint aHint)
|
||||
{
|
||||
NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
|
||||
if (
|
||||
@ -166,11 +166,11 @@ ClientLayerManager::CreateThebesLayerWithHint(ThebesLayerCreationHint aHint)
|
||||
(AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_OPENGL ||
|
||||
AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_D3D9 ||
|
||||
AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_D3D11)) {
|
||||
nsRefPtr<ClientTiledThebesLayer> layer = new ClientTiledThebesLayer(this, aHint);
|
||||
nsRefPtr<ClientTiledPaintedLayer> layer = new ClientTiledPaintedLayer(this, aHint);
|
||||
CREATE_SHADOW(Thebes);
|
||||
return layer.forget();
|
||||
} else {
|
||||
nsRefPtr<ClientThebesLayer> layer = new ClientThebesLayer(this, aHint);
|
||||
nsRefPtr<ClientPaintedLayer> layer = new ClientPaintedLayer(this, aHint);
|
||||
CREATE_SHADOW(Thebes);
|
||||
return layer.forget();
|
||||
}
|
@ -3,11 +3,11 @@
|
||||
* 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_CLIENTTHEBESLAYER_H
|
||||
#define GFX_CLIENTTHEBESLAYER_H
|
||||
#ifndef GFX_CLIENTPAINTEDLAYER_H
|
||||
#define GFX_CLIENTPAINTEDLAYER_H
|
||||
|
||||
#include "ClientLayerManager.h" // for ClientLayerManager, etc
|
||||
#include "Layers.h" // for ThebesLayer, etc
|
||||
#include "Layers.h" // for PaintedLayer, etc
|
||||
#include "RotatedBuffer.h" // for RotatedContentBuffer, etc
|
||||
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
@ -16,7 +16,7 @@
|
||||
#include "nsDebug.h" // for NS_ASSERTION
|
||||
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
|
||||
#include "nsRegion.h" // for nsIntRegion
|
||||
#include "mozilla/layers/PLayerTransaction.h" // for ThebesLayerAttributes
|
||||
#include "mozilla/layers/PLayerTransaction.h" // for PaintedLayerAttributes
|
||||
|
||||
class gfxContext;
|
||||
|
||||
@ -27,30 +27,30 @@ class CompositableClient;
|
||||
class ShadowableLayer;
|
||||
class SpecificLayerAttributes;
|
||||
|
||||
class ClientThebesLayer : public ThebesLayer,
|
||||
class ClientPaintedLayer : public PaintedLayer,
|
||||
public ClientLayer {
|
||||
public:
|
||||
typedef RotatedContentBuffer::PaintState PaintState;
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
explicit ClientThebesLayer(ClientLayerManager* aLayerManager,
|
||||
LayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE) :
|
||||
ThebesLayer(aLayerManager,
|
||||
explicit ClientPaintedLayer(ClientLayerManager* aLayerManager,
|
||||
LayerManager::PaintedLayerCreationHint aCreationHint = LayerManager::NONE) :
|
||||
PaintedLayer(aLayerManager,
|
||||
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()),
|
||||
aCreationHint),
|
||||
mContentClient(nullptr)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ClientThebesLayer);
|
||||
MOZ_COUNT_CTOR(ClientPaintedLayer);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~ClientThebesLayer()
|
||||
virtual ~ClientPaintedLayer()
|
||||
{
|
||||
if (mContentClient) {
|
||||
mContentClient->OnDetach();
|
||||
mContentClient = nullptr;
|
||||
}
|
||||
MOZ_COUNT_DTOR(ClientThebesLayer);
|
||||
MOZ_COUNT_DTOR(ClientPaintedLayer);
|
||||
}
|
||||
|
||||
public:
|
||||
@ -58,7 +58,7 @@ public:
|
||||
{
|
||||
NS_ASSERTION(ClientManager()->InConstruction(),
|
||||
"Can only set properties in construction phase");
|
||||
ThebesLayer::SetVisibleRegion(aRegion);
|
||||
PaintedLayer::SetVisibleRegion(aRegion);
|
||||
}
|
||||
virtual void InvalidateRegion(const nsIntRegion& aRegion)
|
||||
{
|
||||
@ -84,7 +84,7 @@ public:
|
||||
|
||||
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||
{
|
||||
aAttrs = ThebesLayerAttributes(GetValidRegion());
|
||||
aAttrs = PaintedLayerAttributes(GetValidRegion());
|
||||
}
|
||||
|
||||
ClientLayerManager* ClientManager()
|
@ -2,7 +2,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 "ClientTiledThebesLayer.h"
|
||||
#include "ClientTiledPaintedLayer.h"
|
||||
#include "FrameMetrics.h" // for FrameMetrics
|
||||
#include "Units.h" // for ScreenIntRect, CSSPoint, etc
|
||||
#include "UnitTransforms.h" // for TransformTo
|
||||
@ -24,25 +24,25 @@ namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
|
||||
ClientTiledThebesLayer::ClientTiledThebesLayer(ClientLayerManager* const aManager,
|
||||
ClientLayerManager::ThebesLayerCreationHint aCreationHint)
|
||||
: ThebesLayer(aManager,
|
||||
ClientTiledPaintedLayer::ClientTiledPaintedLayer(ClientLayerManager* const aManager,
|
||||
ClientLayerManager::PaintedLayerCreationHint aCreationHint)
|
||||
: PaintedLayer(aManager,
|
||||
static_cast<ClientLayer*>(MOZ_THIS_IN_INITIALIZER_LIST()),
|
||||
aCreationHint)
|
||||
, mContentClient()
|
||||
{
|
||||
MOZ_COUNT_CTOR(ClientTiledThebesLayer);
|
||||
MOZ_COUNT_CTOR(ClientTiledPaintedLayer);
|
||||
mPaintData.mLastScrollOffset = ParentLayerPoint(0, 0);
|
||||
mPaintData.mFirstPaint = true;
|
||||
}
|
||||
|
||||
ClientTiledThebesLayer::~ClientTiledThebesLayer()
|
||||
ClientTiledPaintedLayer::~ClientTiledPaintedLayer()
|
||||
{
|
||||
MOZ_COUNT_DTOR(ClientTiledThebesLayer);
|
||||
MOZ_COUNT_DTOR(ClientTiledPaintedLayer);
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::ClearCachedResources()
|
||||
ClientTiledPaintedLayer::ClearCachedResources()
|
||||
{
|
||||
if (mContentClient) {
|
||||
mContentClient->ClearCachedResources();
|
||||
@ -52,9 +52,9 @@ ClientTiledThebesLayer::ClearCachedResources()
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||
ClientTiledPaintedLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||
{
|
||||
aAttrs = ThebesLayerAttributes(GetValidRegion());
|
||||
aAttrs = PaintedLayerAttributes(GetValidRegion());
|
||||
}
|
||||
|
||||
static LayerRect
|
||||
@ -81,7 +81,7 @@ GetTransformToAncestorsParentLayer(Layer* aStart, const LayerMetricsWrapper& aAn
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::GetAncestorLayers(LayerMetricsWrapper* aOutScrollAncestor,
|
||||
ClientTiledPaintedLayer::GetAncestorLayers(LayerMetricsWrapper* aOutScrollAncestor,
|
||||
LayerMetricsWrapper* aOutDisplayPortAncestor)
|
||||
{
|
||||
LayerMetricsWrapper scrollAncestor;
|
||||
@ -107,7 +107,7 @@ ClientTiledThebesLayer::GetAncestorLayers(LayerMetricsWrapper* aOutScrollAncesto
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::BeginPaint()
|
||||
ClientTiledPaintedLayer::BeginPaint()
|
||||
{
|
||||
mPaintData.mLowPrecisionPaintCount = 0;
|
||||
mPaintData.mPaintFinished = false;
|
||||
@ -184,7 +184,7 @@ ClientTiledThebesLayer::BeginPaint()
|
||||
}
|
||||
|
||||
bool
|
||||
ClientTiledThebesLayer::UseFastPath()
|
||||
ClientTiledPaintedLayer::UseFastPath()
|
||||
{
|
||||
LayerMetricsWrapper scrollAncestor;
|
||||
GetAncestorLayers(&scrollAncestor, nullptr);
|
||||
@ -201,9 +201,9 @@ ClientTiledThebesLayer::UseFastPath()
|
||||
}
|
||||
|
||||
bool
|
||||
ClientTiledThebesLayer::RenderHighPrecision(nsIntRegion& aInvalidRegion,
|
||||
ClientTiledPaintedLayer::RenderHighPrecision(nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aVisibleRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
// If we have no high-precision stuff to draw, or we have started drawing low-precision
|
||||
@ -248,9 +248,9 @@ ClientTiledThebesLayer::RenderHighPrecision(nsIntRegion& aInvalidRegion,
|
||||
}
|
||||
|
||||
bool
|
||||
ClientTiledThebesLayer::RenderLowPrecision(nsIntRegion& aInvalidRegion,
|
||||
ClientTiledPaintedLayer::RenderLowPrecision(nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aVisibleRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
// Render the low precision buffer, if the visible region is larger than the
|
||||
@ -310,7 +310,7 @@ ClientTiledThebesLayer::RenderLowPrecision(nsIntRegion& aInvalidRegion,
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::EndPaint()
|
||||
ClientTiledPaintedLayer::EndPaint()
|
||||
{
|
||||
mPaintData.mLastScrollOffset = mPaintData.mScrollOffset;
|
||||
mPaintData.mPaintFinished = true;
|
||||
@ -319,11 +319,11 @@ ClientTiledThebesLayer::EndPaint()
|
||||
}
|
||||
|
||||
void
|
||||
ClientTiledThebesLayer::RenderLayer()
|
||||
ClientTiledPaintedLayer::RenderLayer()
|
||||
{
|
||||
LayerManager::DrawThebesLayerCallback callback =
|
||||
ClientManager()->GetThebesLayerCallback();
|
||||
void *data = ClientManager()->GetThebesLayerCallbackData();
|
||||
LayerManager::DrawPaintedLayerCallback callback =
|
||||
ClientManager()->GetPaintedLayerCallback();
|
||||
void *data = ClientManager()->GetPaintedLayerCallbackData();
|
||||
if (!callback) {
|
||||
ClientManager()->SetTransactionIncomplete();
|
||||
return;
|
@ -2,11 +2,11 @@
|
||||
* 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_CLIENTTILEDTHEBESLAYER_H
|
||||
#define GFX_CLIENTTILEDTHEBESLAYER_H
|
||||
#ifndef GFX_CLIENTTILEDPAINTEDLAYER_H
|
||||
#define GFX_CLIENTTILEDPAINTEDLAYER_H
|
||||
|
||||
#include "ClientLayerManager.h" // for ClientLayer, etc
|
||||
#include "Layers.h" // for ThebesLayer, etc
|
||||
#include "Layers.h" // for PaintedLayer, etc
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "mozilla/layers/TiledContentClient.h"
|
||||
#include "nsDebug.h" // for NS_RUNTIMEABORT
|
||||
@ -21,8 +21,8 @@ class ShadowableLayer;
|
||||
class SpecificLayerAttributes;
|
||||
|
||||
/**
|
||||
* An implementation of ThebesLayer that ONLY supports remote
|
||||
* composition that is backed by tiles. This thebes layer implementation
|
||||
* An implementation of PaintedLayer that ONLY supports remote
|
||||
* composition that is backed by tiles. This painted layer implementation
|
||||
* is better suited to mobile hardware to work around slow implementation
|
||||
* of glTexImage2D (for OGL compositors), and restrait memory bandwidth.
|
||||
*
|
||||
@ -35,21 +35,21 @@ class SpecificLayerAttributes;
|
||||
*
|
||||
* There is no ContentClient for tiled layers. There is a ContentHost, however.
|
||||
*/
|
||||
class ClientTiledThebesLayer : public ThebesLayer,
|
||||
class ClientTiledPaintedLayer : public PaintedLayer,
|
||||
public ClientLayer
|
||||
{
|
||||
typedef ThebesLayer Base;
|
||||
typedef PaintedLayer Base;
|
||||
|
||||
public:
|
||||
explicit ClientTiledThebesLayer(ClientLayerManager* const aManager,
|
||||
ClientLayerManager::ThebesLayerCreationHint aCreationHint = LayerManager::NONE);
|
||||
explicit ClientTiledPaintedLayer(ClientLayerManager* const aManager,
|
||||
ClientLayerManager::PaintedLayerCreationHint aCreationHint = LayerManager::NONE);
|
||||
|
||||
protected:
|
||||
~ClientTiledThebesLayer();
|
||||
~ClientTiledPaintedLayer();
|
||||
|
||||
public:
|
||||
// Override name to distinguish it from ClientThebesLayer in layer dumps
|
||||
virtual const char* Name() const { return "TiledThebesLayer"; }
|
||||
// Override name to distinguish it from ClientPaintedLayer in layer dumps
|
||||
virtual const char* Name() const { return "TiledPaintedLayer"; }
|
||||
|
||||
// Thebes Layer
|
||||
virtual Layer* AsLayer() { return this; }
|
||||
@ -104,7 +104,7 @@ private:
|
||||
*/
|
||||
bool RenderHighPrecision(nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aVisibleRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
/**
|
||||
@ -113,7 +113,7 @@ private:
|
||||
*/
|
||||
bool RenderLowPrecision(nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aVisibleRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
/**
|
@ -676,7 +676,7 @@ ContentClientIncremental::NotifyBufferCreated(ContentType aType, TextureFlags aF
|
||||
}
|
||||
|
||||
RotatedContentBuffer::PaintState
|
||||
ContentClientIncremental::BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
ContentClientIncremental::BeginPaintBuffer(PaintedLayer* aLayer,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
mTextureInfo.mDeprecatedTextureHostFlags = DeprecatedTextureHostFlags::DEFAULT;
|
||||
|
@ -38,7 +38,7 @@ class DrawTarget;
|
||||
namespace layers {
|
||||
|
||||
class BasicLayerManager;
|
||||
class ThebesLayer;
|
||||
class PaintedLayer;
|
||||
|
||||
/**
|
||||
* A compositable client for Thebes layers. These are different to Image/Canvas
|
||||
@ -46,12 +46,12 @@ class ThebesLayer;
|
||||
* 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
|
||||
* BasicPaintedLayer has only one interface to deal with. We support single and
|
||||
* double buffered flavours. For tiled layers, we do not use a ContentClient
|
||||
* although we do have a ContentHost, and we do use texture clients and texture
|
||||
* hosts.
|
||||
*
|
||||
* The interface presented by ContentClient is used by the BasicThebesLayer
|
||||
* The interface presented by ContentClient is used by the BasicPaintedLayer
|
||||
* 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'
|
||||
@ -91,7 +91,7 @@ public:
|
||||
|
||||
|
||||
virtual void Clear() = 0;
|
||||
virtual RotatedContentBuffer::PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
virtual RotatedContentBuffer::PaintState BeginPaintBuffer(PaintedLayer* aLayer,
|
||||
uint32_t aFlags) = 0;
|
||||
virtual gfx::DrawTarget* BorrowDrawTargetForPainting(RotatedContentBuffer::PaintState& aPaintState,
|
||||
RotatedContentBuffer::DrawIterator* aIter = nullptr) = 0;
|
||||
@ -133,7 +133,7 @@ public:
|
||||
typedef RotatedContentBuffer::ContentType ContentType;
|
||||
|
||||
virtual void Clear() { RotatedContentBuffer::Clear(); }
|
||||
virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
virtual PaintState BeginPaintBuffer(PaintedLayer* aLayer,
|
||||
uint32_t aFlags) MOZ_OVERRIDE
|
||||
{
|
||||
return RotatedContentBuffer::BeginPaint(aLayer, aFlags);
|
||||
@ -148,7 +148,7 @@ public:
|
||||
BorrowDrawTarget::ReturnDrawTarget(aReturned);
|
||||
}
|
||||
|
||||
void DrawTo(ThebesLayer* aLayer,
|
||||
void DrawTo(PaintedLayer* aLayer,
|
||||
gfx::DrawTarget* aTarget,
|
||||
float aOpacity,
|
||||
gfx::CompositionOp aOp,
|
||||
@ -208,7 +208,7 @@ public:
|
||||
mTextureClientOnWhite = nullptr;
|
||||
}
|
||||
|
||||
virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
virtual PaintState BeginPaintBuffer(PaintedLayer* aLayer,
|
||||
uint32_t aFlags) MOZ_OVERRIDE
|
||||
{
|
||||
return RotatedContentBuffer::BeginPaint(aLayer, aFlags);
|
||||
@ -418,7 +418,7 @@ public:
|
||||
mHasBufferOnWhite = false;
|
||||
}
|
||||
|
||||
virtual PaintState BeginPaintBuffer(ThebesLayer* aLayer,
|
||||
virtual PaintState BeginPaintBuffer(PaintedLayer* aLayer,
|
||||
uint32_t aFlags) MOZ_OVERRIDE;
|
||||
virtual gfx::DrawTarget* BorrowDrawTargetForPainting(PaintState& aPaintState,
|
||||
RotatedContentBuffer::DrawIterator* aIter = nullptr) MOZ_OVERRIDE;
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "mozilla/layers/TiledContentClient.h"
|
||||
#include <math.h> // for ceil, ceilf, floor
|
||||
#include <algorithm>
|
||||
#include "ClientTiledThebesLayer.h" // for ClientTiledThebesLayer
|
||||
#include "ClientTiledPaintedLayer.h" // for ClientTiledPaintedLayer
|
||||
#include "GeckoProfiler.h" // for PROFILER_LABEL
|
||||
#include "ClientLayerManager.h" // for ClientLayerManager
|
||||
#include "CompositorChild.h" // for CompositorChild
|
||||
@ -89,15 +89,15 @@ using namespace gfx;
|
||||
namespace layers {
|
||||
|
||||
|
||||
TiledContentClient::TiledContentClient(ClientTiledThebesLayer* aThebesLayer,
|
||||
TiledContentClient::TiledContentClient(ClientTiledPaintedLayer* aPaintedLayer,
|
||||
ClientLayerManager* aManager)
|
||||
: CompositableClient(aManager->AsShadowForwarder())
|
||||
{
|
||||
MOZ_COUNT_CTOR(TiledContentClient);
|
||||
|
||||
mTiledBuffer = ClientTiledLayerBuffer(aThebesLayer, this, aManager,
|
||||
mTiledBuffer = ClientTiledLayerBuffer(aPaintedLayer, this, aManager,
|
||||
&mSharedFrameMetricsHelper);
|
||||
mLowPrecisionTiledBuffer = ClientTiledLayerBuffer(aThebesLayer, this, aManager,
|
||||
mLowPrecisionTiledBuffer = ClientTiledLayerBuffer(aPaintedLayer, this, aManager,
|
||||
&mSharedFrameMetricsHelper);
|
||||
|
||||
mLowPrecisionTiledBuffer.SetResolution(gfxPrefs::LowPrecisionResolution());
|
||||
@ -286,11 +286,11 @@ SharedFrameMetricsHelper::AboutToCheckerboard(const FrameMetrics& aContentMetric
|
||||
return false;
|
||||
}
|
||||
|
||||
ClientTiledLayerBuffer::ClientTiledLayerBuffer(ClientTiledThebesLayer* aThebesLayer,
|
||||
ClientTiledLayerBuffer::ClientTiledLayerBuffer(ClientTiledPaintedLayer* aPaintedLayer,
|
||||
CompositableClient* aCompositableClient,
|
||||
ClientLayerManager* aManager,
|
||||
SharedFrameMetricsHelper* aHelper)
|
||||
: mThebesLayer(aThebesLayer)
|
||||
: mPaintedLayer(aPaintedLayer)
|
||||
, mCompositableClient(aCompositableClient)
|
||||
, mManager(aManager)
|
||||
, mLastPaintContentType(gfxContentType::COLOR)
|
||||
@ -313,24 +313,24 @@ gfxContentType
|
||||
ClientTiledLayerBuffer::GetContentType(SurfaceMode* aMode) const
|
||||
{
|
||||
gfxContentType content =
|
||||
mThebesLayer->CanUseOpaqueSurface() ? gfxContentType::COLOR :
|
||||
mPaintedLayer->CanUseOpaqueSurface() ? gfxContentType::COLOR :
|
||||
gfxContentType::COLOR_ALPHA;
|
||||
SurfaceMode mode = mThebesLayer->GetSurfaceMode();
|
||||
SurfaceMode mode = mPaintedLayer->GetSurfaceMode();
|
||||
|
||||
if (mode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
|
||||
#if defined(MOZ_GFX_OPTIMIZE_MOBILE) || defined(MOZ_WIDGET_GONK)
|
||||
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
|
||||
}
|
||||
#else
|
||||
if (!mThebesLayer->GetParent() ||
|
||||
!mThebesLayer->GetParent()->SupportsComponentAlphaChildren() ||
|
||||
if (!mPaintedLayer->GetParent() ||
|
||||
!mPaintedLayer->GetParent()->SupportsComponentAlphaChildren() ||
|
||||
!gfxPrefs::TiledDrawTargetEnabled()) {
|
||||
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
|
||||
} else {
|
||||
content = gfxContentType::COLOR;
|
||||
}
|
||||
} else if (mode == SurfaceMode::SURFACE_OPAQUE) {
|
||||
if (mThebesLayer->MayResample()) {
|
||||
if (mPaintedLayer->MayResample()) {
|
||||
mode = SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA;
|
||||
content = gfxContentType::COLOR_ALPHA;
|
||||
}
|
||||
@ -887,11 +887,11 @@ ClientTiledLayerBuffer::GetSurfaceDescriptorTiles()
|
||||
void
|
||||
ClientTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion,
|
||||
const nsIntRegion& aPaintRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
TILING_LOG("TILING %p: PaintThebes painting region %s\n", mThebesLayer, Stringify(aPaintRegion).c_str());
|
||||
TILING_LOG("TILING %p: PaintThebes new valid region %s\n", mThebesLayer, Stringify(aNewValidRegion).c_str());
|
||||
TILING_LOG("TILING %p: PaintThebes painting region %s\n", mPaintedLayer, Stringify(aPaintRegion).c_str());
|
||||
TILING_LOG("TILING %p: PaintThebes new valid region %s\n", mPaintedLayer, Stringify(aNewValidRegion).c_str());
|
||||
|
||||
mCallback = aCallback;
|
||||
mCallbackData = aCallbackData;
|
||||
@ -955,7 +955,7 @@ ClientTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion,
|
||||
PROFILER_LABEL("ClientTiledLayerBuffer", "PaintThebesSingleBufferDraw",
|
||||
js::ProfileEntry::Category::GRAPHICS);
|
||||
|
||||
mCallback(mThebesLayer, ctxt, aPaintRegion, DrawRegionClip::CLIP_NONE, nsIntRegion(), mCallbackData);
|
||||
mCallback(mPaintedLayer, ctxt, aPaintRegion, DrawRegionClip::CLIP_NONE, nsIntRegion(), mCallbackData);
|
||||
}
|
||||
|
||||
#ifdef GFX_TILEDLAYER_PREF_WARNINGS
|
||||
@ -1068,7 +1068,7 @@ ClientTiledLayerBuffer::PostValidate(const nsIntRegion& aPaintRegion)
|
||||
ctx->SetMatrix(
|
||||
ctx->CurrentMatrix().Scale(mResolution, mResolution));
|
||||
|
||||
mCallback(mThebesLayer, ctx, aPaintRegion, DrawRegionClip::DRAW, nsIntRegion(), mCallbackData);
|
||||
mCallback(mPaintedLayer, ctx, aPaintRegion, DrawRegionClip::DRAW, nsIntRegion(), mCallbackData);
|
||||
mMoz2DTiles.clear();
|
||||
}
|
||||
}
|
||||
@ -1323,7 +1323,7 @@ ClientTiledLayerBuffer::ValidateTile(TileClient aTile,
|
||||
ctxt->CurrentMatrix().Translate(-unscaledTileOrigin.x,
|
||||
-unscaledTileOrigin.y).
|
||||
Scale(mResolution, mResolution));
|
||||
mCallback(mThebesLayer, ctxt,
|
||||
mCallback(mPaintedLayer, ctxt,
|
||||
tileRegion.GetBounds(),
|
||||
DrawRegionClip::CLIP_NONE,
|
||||
nsIntRegion(), mCallbackData);
|
||||
@ -1379,7 +1379,7 @@ ClientTiledLayerBuffer::ValidateTile(TileClient aTile,
|
||||
* basically replaces the nontransient async transform that was injected
|
||||
* in GetTransformToAncestorsParentLayer with the complete async transform.
|
||||
* This function then returns the scroll ancestor's composition bounds,
|
||||
* transformed into the thebes layer's LayerPixel coordinates, accounting
|
||||
* transformed into the painted layer's LayerPixel coordinates, accounting
|
||||
* for the compositor state.
|
||||
*/
|
||||
static LayerRect
|
||||
@ -1432,10 +1432,10 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
nsIntRegion staleRegion;
|
||||
staleRegion.And(aInvalidRegion, aOldValidRegion);
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update stale region %s\n", mThebesLayer, Stringify(staleRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update stale region %s\n", mPaintedLayer, Stringify(staleRegion).c_str());
|
||||
|
||||
LayerMetricsWrapper scrollAncestor;
|
||||
mThebesLayer->GetAncestorLayers(&scrollAncestor, nullptr);
|
||||
mPaintedLayer->GetAncestorLayers(&scrollAncestor, nullptr);
|
||||
|
||||
// Find out the current view transform to determine which tiles to draw
|
||||
// first, and see if we should just abort this paint. Aborting is usually
|
||||
@ -1467,7 +1467,7 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
#endif
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update view transform %s zoom %f abort %d\n",
|
||||
mThebesLayer, ToString(viewTransform.mTranslation).c_str(), viewTransform.mScale.scale, abortPaint);
|
||||
mPaintedLayer, ToString(viewTransform.mTranslation).c_str(), viewTransform.mScale.scale, abortPaint);
|
||||
|
||||
if (abortPaint) {
|
||||
// We ignore if front-end wants to abort if this is the first,
|
||||
@ -1487,7 +1487,7 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
aPaintData->mTransformToCompBounds,
|
||||
viewTransform);
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update transformed compositor bounds %s\n", mThebesLayer, Stringify(transformedCompositionBounds).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update transformed compositor bounds %s\n", mPaintedLayer, Stringify(transformedCompositionBounds).c_str());
|
||||
|
||||
// Compute a "coherent update rect" that we should paint all at once in a
|
||||
// single transaction. This is to avoid rendering glitches on animated
|
||||
@ -1506,7 +1506,7 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
#endif
|
||||
)));
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update final coherency rect %s\n", mThebesLayer, Stringify(coherentUpdateRect).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update final coherency rect %s\n", mPaintedLayer, Stringify(coherentUpdateRect).c_str());
|
||||
|
||||
aRegionToPaint.And(aInvalidRegion, coherentUpdateRect);
|
||||
aRegionToPaint.Or(aRegionToPaint, staleRegion);
|
||||
@ -1522,14 +1522,14 @@ ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInval
|
||||
paintingVisible = true;
|
||||
}
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update final paint region %s\n", mThebesLayer, Stringify(aRegionToPaint).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update final paint region %s\n", mPaintedLayer, Stringify(aRegionToPaint).c_str());
|
||||
|
||||
// Paint area that's visible and overlaps previously valid content to avoid
|
||||
// visible glitches in animated elements, such as gifs.
|
||||
bool paintInSingleTransaction = paintingVisible && (drawingStale || aPaintData->mFirstPaint);
|
||||
|
||||
TILING_LOG("TILING %p: paintingVisible %d drawingStale %d firstPaint %d singleTransaction %d\n",
|
||||
mThebesLayer, paintingVisible, drawingStale, aPaintData->mFirstPaint, paintInSingleTransaction);
|
||||
mPaintedLayer, paintingVisible, drawingStale, aPaintData->mFirstPaint, paintInSingleTransaction);
|
||||
|
||||
// The following code decides what order to draw tiles in, based on the
|
||||
// current scroll direction of the primary scrollable layer.
|
||||
@ -1599,12 +1599,12 @@ ClientTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aOldValidRegion,
|
||||
BasicTiledLayerPaintData* aPaintData,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData)
|
||||
{
|
||||
TILING_LOG("TILING %p: Progressive update valid region %s\n", mThebesLayer, Stringify(aValidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update invalid region %s\n", mThebesLayer, Stringify(aInvalidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update old valid region %s\n", mThebesLayer, Stringify(aOldValidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update valid region %s\n", mPaintedLayer, Stringify(aValidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update invalid region %s\n", mPaintedLayer, Stringify(aInvalidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update old valid region %s\n", mPaintedLayer, Stringify(aOldValidRegion).c_str());
|
||||
|
||||
bool repeat = false;
|
||||
bool isBufferChanged = false;
|
||||
@ -1618,7 +1618,7 @@ ClientTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
aPaintData,
|
||||
repeat);
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update computed paint region %s repeat %d\n", mThebesLayer, Stringify(regionToPaint).c_str(), repeat);
|
||||
TILING_LOG("TILING %p: Progressive update computed paint region %s repeat %d\n", mPaintedLayer, Stringify(regionToPaint).c_str(), repeat);
|
||||
|
||||
// There's no further work to be done.
|
||||
if (regionToPaint.IsEmpty()) {
|
||||
@ -1641,8 +1641,8 @@ ClientTiledLayerBuffer::ProgressiveUpdate(nsIntRegion& aValidRegion,
|
||||
aInvalidRegion.Sub(aInvalidRegion, regionToPaint);
|
||||
} while (repeat);
|
||||
|
||||
TILING_LOG("TILING %p: Progressive update final valid region %s buffer changed %d\n", mThebesLayer, Stringify(aValidRegion).c_str(), isBufferChanged);
|
||||
TILING_LOG("TILING %p: Progressive update final invalid region %s\n", mThebesLayer, Stringify(aInvalidRegion).c_str());
|
||||
TILING_LOG("TILING %p: Progressive update final valid region %s buffer changed %d\n", mPaintedLayer, Stringify(aValidRegion).c_str(), isBufferChanged);
|
||||
TILING_LOG("TILING %p: Progressive update final invalid region %s\n", mPaintedLayer, Stringify(aInvalidRegion).c_str());
|
||||
|
||||
// Return false if nothing has been drawn, or give what has been drawn
|
||||
// to the shadow layer to upload.
|
||||
|
@ -41,7 +41,7 @@ namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class BasicTileDescriptor;
|
||||
class ClientTiledThebesLayer;
|
||||
class ClientTiledPaintedLayer;
|
||||
class ClientLayerManager;
|
||||
|
||||
|
||||
@ -388,12 +388,12 @@ class ClientTiledLayerBuffer
|
||||
friend class TiledLayerBuffer<ClientTiledLayerBuffer, TileClient>;
|
||||
|
||||
public:
|
||||
ClientTiledLayerBuffer(ClientTiledThebesLayer* aThebesLayer,
|
||||
ClientTiledLayerBuffer(ClientTiledPaintedLayer* aPaintedLayer,
|
||||
CompositableClient* aCompositableClient,
|
||||
ClientLayerManager* aManager,
|
||||
SharedFrameMetricsHelper* aHelper);
|
||||
ClientTiledLayerBuffer()
|
||||
: mThebesLayer(nullptr)
|
||||
: mPaintedLayer(nullptr)
|
||||
, mCompositableClient(nullptr)
|
||||
, mManager(nullptr)
|
||||
, mLastPaintContentType(gfxContentType::COLOR)
|
||||
@ -403,7 +403,7 @@ public:
|
||||
|
||||
void PaintThebes(const nsIntRegion& aNewValidRegion,
|
||||
const nsIntRegion& aPaintRegion,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
void ReadUnlock();
|
||||
@ -428,7 +428,7 @@ public:
|
||||
nsIntRegion& aInvalidRegion,
|
||||
const nsIntRegion& aOldValidRegion,
|
||||
BasicTiledLayerPaintData* aPaintData,
|
||||
LayerManager::DrawThebesLayerCallback aCallback,
|
||||
LayerManager::DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData);
|
||||
|
||||
SurfaceDescriptorTiles GetSurfaceDescriptorTiles();
|
||||
@ -456,10 +456,10 @@ protected:
|
||||
|
||||
private:
|
||||
gfxContentType GetContentType(SurfaceMode* aMode = nullptr) const;
|
||||
ClientTiledThebesLayer* mThebesLayer;
|
||||
ClientTiledPaintedLayer* mPaintedLayer;
|
||||
CompositableClient* mCompositableClient;
|
||||
ClientLayerManager* mManager;
|
||||
LayerManager::DrawThebesLayerCallback mCallback;
|
||||
LayerManager::DrawPaintedLayerCallback mCallback;
|
||||
void* mCallbackData;
|
||||
CSSToParentLayerScale mFrameResolution;
|
||||
gfxContentType mLastPaintContentType;
|
||||
@ -504,11 +504,11 @@ class TiledContentClient : public CompositableClient
|
||||
// XXX: for now the layer which owns us interacts directly with our buffers.
|
||||
// We should have a content client for each tiled buffer which manages its
|
||||
// own valid region, resolution, etc. Then we could have a much cleaner
|
||||
// interface and tidy up BasicTiledThebesLayer::PaintThebes (bug 862547).
|
||||
friend class ClientTiledThebesLayer;
|
||||
// interface and tidy up BasicTiledPaintedLayer::PaintThebes (bug 862547).
|
||||
friend class ClientTiledPaintedLayer;
|
||||
|
||||
public:
|
||||
TiledContentClient(ClientTiledThebesLayer* aThebesLayer,
|
||||
TiledContentClient(ClientTiledPaintedLayer* aPaintedLayer,
|
||||
ClientLayerManager* aManager);
|
||||
|
||||
protected:
|
||||
|
@ -297,7 +297,7 @@ RenderLayers(ContainerT* aContainer,
|
||||
if (LayerHasCheckerboardingAPZC(layer, &color)) {
|
||||
// Ideally we would want to intersect the checkerboard region from the APZ with the layer bounds
|
||||
// and only fill in that area. However the layer bounds takes into account the base translation
|
||||
// for the thebes layer whereas the checkerboard region does not. One does not simply
|
||||
// for the painted layer whereas the checkerboard region does not. One does not simply
|
||||
// intersect areas in different coordinate spaces. So we do this a little more permissively
|
||||
// and only fill in the background when we know there is checkerboard, which in theory
|
||||
// should only occur transiently.
|
||||
|
@ -135,8 +135,8 @@ ImageLayerComposite::ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransform
|
||||
}
|
||||
// Snap our local transform first, and snap the inherited transform as well.
|
||||
// This makes our snapping equivalent to what would happen if our content
|
||||
// was drawn into a ThebesLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the ThebesLayer).
|
||||
// was drawn into a PaintedLayer (gfxContext would snap using the local
|
||||
// transform, then we'd snap again when compositing the PaintedLayer).
|
||||
mEffectiveTransform =
|
||||
SnapTransform(local, sourceRect, nullptr) *
|
||||
SnapTransformTranslation(aTransformToSurface, nullptr);
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "Layers.h" // for Layer, ContainerLayer, etc
|
||||
#include "LayerScope.h" // for LayerScope Tool
|
||||
#include "protobuf/LayerScopePacket.pb.h" // for protobuf (LayerScope)
|
||||
#include "ThebesLayerComposite.h" // for ThebesLayerComposite
|
||||
#include "PaintedLayerComposite.h" // for PaintedLayerComposite
|
||||
#include "TiledLayerBuffer.h" // for TiledLayerComposer
|
||||
#include "Units.h" // for ScreenIntRect
|
||||
#include "gfx2DGlue.h" // for ToMatrix4x4
|
||||
@ -212,7 +212,7 @@ LayerManagerComposite::EndEmptyTransaction(EndTransactionFlags aFlags)
|
||||
}
|
||||
|
||||
void
|
||||
LayerManagerComposite::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
LayerManagerComposite::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
@ -280,8 +280,8 @@ LayerManagerComposite::CreateOptimalMaskDrawTarget(const IntSize &aSize)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
LayerManagerComposite::CreateThebesLayer()
|
||||
already_AddRefed<PaintedLayer>
|
||||
LayerManagerComposite::CreatePaintedLayer()
|
||||
{
|
||||
NS_RUNTIMEABORT("Should only be called on the drawing side");
|
||||
return nullptr;
|
||||
@ -757,15 +757,15 @@ LayerManagerComposite::ComputeRenderIntegrityInternal(Layer* aLayer,
|
||||
return;
|
||||
}
|
||||
|
||||
// Only thebes layers can be incomplete
|
||||
ThebesLayer* thebesLayer = aLayer->AsThebesLayer();
|
||||
if (!thebesLayer) {
|
||||
// Only painted layers can be incomplete
|
||||
PaintedLayer* paintedLayer = aLayer->AsPaintedLayer();
|
||||
if (!paintedLayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
// See if there's any incomplete rendering
|
||||
nsIntRegion incompleteRegion = aLayer->GetEffectiveVisibleRegion();
|
||||
incompleteRegion.Sub(incompleteRegion, thebesLayer->GetValidRegion());
|
||||
incompleteRegion.Sub(incompleteRegion, paintedLayer->GetValidRegion());
|
||||
|
||||
if (!incompleteRegion.IsEmpty()) {
|
||||
// Calculate the transform to get between screen and layer space
|
||||
@ -922,14 +922,14 @@ LayerManagerComposite::ComputeRenderIntegrity()
|
||||
return 1.f;
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayerComposite>
|
||||
LayerManagerComposite::CreateThebesLayerComposite()
|
||||
already_AddRefed<PaintedLayerComposite>
|
||||
LayerManagerComposite::CreatePaintedLayerComposite()
|
||||
{
|
||||
if (mDestroyed) {
|
||||
NS_WARNING("Call on destroyed layer manager");
|
||||
return nullptr;
|
||||
}
|
||||
return nsRefPtr<ThebesLayerComposite>(new ThebesLayerComposite(this)).forget();
|
||||
return nsRefPtr<PaintedLayerComposite>(new PaintedLayerComposite(this)).forget();
|
||||
}
|
||||
|
||||
already_AddRefed<ContainerLayerComposite>
|
||||
|
@ -61,7 +61,7 @@ class ImageLayerComposite;
|
||||
class LayerComposite;
|
||||
class RefLayerComposite;
|
||||
class SurfaceDescriptor;
|
||||
class ThebesLayerComposite;
|
||||
class PaintedLayerComposite;
|
||||
class TiledLayerComposer;
|
||||
class TextRenderer;
|
||||
class CompositingRenderTarget;
|
||||
@ -120,7 +120,7 @@ public:
|
||||
void BeginTransactionWithDrawTarget(gfx::DrawTarget* aTarget, const nsIntRect& aRect);
|
||||
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) MOZ_OVERRIDE;
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT) MOZ_OVERRIDE;
|
||||
|
||||
@ -137,12 +137,12 @@ public:
|
||||
|
||||
virtual void ClearCachedResources(Layer* aSubtree = nullptr) MOZ_OVERRIDE;
|
||||
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<ContainerLayer> CreateContainerLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<ImageLayer> CreateImageLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<ColorLayer> CreateColorLayer() MOZ_OVERRIDE;
|
||||
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() MOZ_OVERRIDE;
|
||||
already_AddRefed<ThebesLayerComposite> CreateThebesLayerComposite();
|
||||
already_AddRefed<PaintedLayerComposite> CreatePaintedLayerComposite();
|
||||
already_AddRefed<ContainerLayerComposite> CreateContainerLayerComposite();
|
||||
already_AddRefed<ImageLayerComposite> CreateImageLayerComposite();
|
||||
already_AddRefed<ColorLayerComposite> CreateColorLayerComposite();
|
||||
|
@ -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 "ThebesLayerComposite.h"
|
||||
#include "PaintedLayerComposite.h"
|
||||
#include "CompositableHost.h" // for TiledLayerProperties, etc
|
||||
#include "FrameMetrics.h" // for FrameMetrics
|
||||
#include "Units.h" // for CSSRect, LayerPixel, etc
|
||||
@ -34,23 +34,23 @@ namespace layers {
|
||||
|
||||
class TiledLayerComposer;
|
||||
|
||||
ThebesLayerComposite::ThebesLayerComposite(LayerManagerComposite *aManager)
|
||||
: ThebesLayer(aManager, nullptr)
|
||||
PaintedLayerComposite::PaintedLayerComposite(LayerManagerComposite *aManager)
|
||||
: PaintedLayer(aManager, nullptr)
|
||||
, LayerComposite(aManager)
|
||||
, mBuffer(nullptr)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ThebesLayerComposite);
|
||||
MOZ_COUNT_CTOR(PaintedLayerComposite);
|
||||
mImplData = static_cast<LayerComposite*>(this);
|
||||
}
|
||||
|
||||
ThebesLayerComposite::~ThebesLayerComposite()
|
||||
PaintedLayerComposite::~PaintedLayerComposite()
|
||||
{
|
||||
MOZ_COUNT_DTOR(ThebesLayerComposite);
|
||||
MOZ_COUNT_DTOR(PaintedLayerComposite);
|
||||
CleanupResources();
|
||||
}
|
||||
|
||||
bool
|
||||
ThebesLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
||||
PaintedLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
||||
{
|
||||
switch (aHost->GetType()) {
|
||||
case CompositableType::BUFFER_CONTENT_INC:
|
||||
@ -65,13 +65,13 @@ ThebesLayerComposite::SetCompositableHost(CompositableHost* aHost)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::Disconnect()
|
||||
PaintedLayerComposite::Disconnect()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::Destroy()
|
||||
PaintedLayerComposite::Destroy()
|
||||
{
|
||||
if (!mDestroyed) {
|
||||
CleanupResources();
|
||||
@ -80,13 +80,13 @@ ThebesLayerComposite::Destroy()
|
||||
}
|
||||
|
||||
Layer*
|
||||
ThebesLayerComposite::GetLayer()
|
||||
PaintedLayerComposite::GetLayer()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
TiledLayerComposer*
|
||||
ThebesLayerComposite::GetTiledLayerComposer()
|
||||
PaintedLayerComposite::GetTiledLayerComposer()
|
||||
{
|
||||
if (!mBuffer) {
|
||||
return nullptr;
|
||||
@ -96,7 +96,7 @@ ThebesLayerComposite::GetTiledLayerComposer()
|
||||
}
|
||||
|
||||
LayerRenderState
|
||||
ThebesLayerComposite::GetRenderState()
|
||||
PaintedLayerComposite::GetRenderState()
|
||||
{
|
||||
if (!mBuffer || !mBuffer->IsAttached() || mDestroyed) {
|
||||
return LayerRenderState();
|
||||
@ -105,12 +105,12 @@ ThebesLayerComposite::GetRenderState()
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::RenderLayer(const nsIntRect& aClipRect)
|
||||
PaintedLayerComposite::RenderLayer(const nsIntRect& aClipRect)
|
||||
{
|
||||
if (!mBuffer || !mBuffer->IsAttached()) {
|
||||
return;
|
||||
}
|
||||
PROFILER_LABEL("ThebesLayerComposite", "RenderLayer",
|
||||
PROFILER_LABEL("PaintedLayerComposite", "RenderLayer",
|
||||
js::ProfileEntry::Category::GRAPHICS);
|
||||
|
||||
MOZ_ASSERT(mBuffer->GetCompositor() == mCompositeManager->GetCompositor() &&
|
||||
@ -147,7 +147,7 @@ ThebesLayerComposite::RenderLayer(const nsIntRect& aClipRect)
|
||||
}
|
||||
|
||||
CompositableHost*
|
||||
ThebesLayerComposite::GetCompositableHost()
|
||||
PaintedLayerComposite::GetCompositableHost()
|
||||
{
|
||||
if (mBuffer && mBuffer->IsAttached()) {
|
||||
return mBuffer.get();
|
||||
@ -157,7 +157,7 @@ ThebesLayerComposite::GetCompositableHost()
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::CleanupResources()
|
||||
PaintedLayerComposite::CleanupResources()
|
||||
{
|
||||
if (mBuffer) {
|
||||
mBuffer->Detach(this);
|
||||
@ -166,16 +166,16 @@ ThebesLayerComposite::CleanupResources()
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::GenEffectChain(EffectChain& aEffect)
|
||||
PaintedLayerComposite::GenEffectChain(EffectChain& aEffect)
|
||||
{
|
||||
aEffect.mLayerRef = this;
|
||||
aEffect.mPrimaryEffect = mBuffer->GenEffect(GetEffectFilter());
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerComposite::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
PaintedLayerComposite::PrintInfo(std::stringstream& aStream, const char* aPrefix)
|
||||
{
|
||||
ThebesLayer::PrintInfo(aStream, aPrefix);
|
||||
PaintedLayer::PrintInfo(aStream, aPrefix);
|
||||
if (mBuffer && mBuffer->IsAttached()) {
|
||||
aStream << "\n";
|
||||
nsAutoCString pfx(aPrefix);
|
@ -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 GFX_ThebesLayerComposite_H
|
||||
#define GFX_ThebesLayerComposite_H
|
||||
#ifndef GFX_PaintedLayerComposite_H
|
||||
#define GFX_PaintedLayerComposite_H
|
||||
|
||||
#include "Layers.h" // for Layer (ptr only), etc
|
||||
#include "gfxRect.h" // for gfxRect
|
||||
@ -25,7 +25,7 @@ namespace layers {
|
||||
|
||||
/**
|
||||
* Thebes layers use ContentHosts for their compsositable host.
|
||||
* By using different ContentHosts, ThebesLayerComposite support tiled and
|
||||
* By using different ContentHosts, PaintedLayerComposite support tiled and
|
||||
* non-tiled Thebes layers and single or double buffering.
|
||||
*/
|
||||
|
||||
@ -33,14 +33,14 @@ class CompositableHost;
|
||||
class ContentHost;
|
||||
class TiledLayerComposer;
|
||||
|
||||
class ThebesLayerComposite : public ThebesLayer,
|
||||
class PaintedLayerComposite : public PaintedLayer,
|
||||
public LayerComposite
|
||||
{
|
||||
public:
|
||||
explicit ThebesLayerComposite(LayerManagerComposite *aManager);
|
||||
explicit PaintedLayerComposite(LayerManagerComposite *aManager);
|
||||
|
||||
protected:
|
||||
virtual ~ThebesLayerComposite();
|
||||
virtual ~PaintedLayerComposite();
|
||||
|
||||
public:
|
||||
virtual void Disconnect() MOZ_OVERRIDE;
|
||||
@ -67,7 +67,7 @@ public:
|
||||
|
||||
virtual void InvalidateRegion(const nsIntRegion& aRegion)
|
||||
{
|
||||
NS_RUNTIMEABORT("ThebesLayerComposites can't fill invalidated regions");
|
||||
NS_RUNTIMEABORT("PaintedLayerComposites can't fill invalidated regions");
|
||||
}
|
||||
|
||||
void SetValidRegion(const nsIntRegion& aRegion)
|
||||
@ -77,7 +77,7 @@ public:
|
||||
Mutated();
|
||||
}
|
||||
|
||||
MOZ_LAYER_DECL_NAME("ThebesLayerComposite", TYPE_THEBES)
|
||||
MOZ_LAYER_DECL_NAME("PaintedLayerComposite", TYPE_THEBES)
|
||||
|
||||
protected:
|
||||
|
||||
@ -92,4 +92,4 @@ private:
|
||||
|
||||
} /* layers */
|
||||
} /* mozilla */
|
||||
#endif /* GFX_ThebesLayerComposite_H */
|
||||
#endif /* GFX_PaintedLayerComposite_H */
|
@ -4,7 +4,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "TiledContentHost.h"
|
||||
#include "ThebesLayerComposite.h" // for ThebesLayerComposite
|
||||
#include "PaintedLayerComposite.h" // for PaintedLayerComposite
|
||||
#include "mozilla/gfx/BaseSize.h" // for BaseSize
|
||||
#include "mozilla/gfx/Matrix.h" // for Matrix4x4
|
||||
#include "mozilla/layers/Compositor.h" // for Compositor
|
||||
|
@ -24,4 +24,4 @@ public:
|
||||
|
||||
} /* layers */
|
||||
} /* mozilla */
|
||||
#endif /* GFX_THEBESLAYERD3D10_H */
|
||||
#endif /* GFX_PAINTEDLAYERD3D10_H */
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "ContainerLayerD3D10.h"
|
||||
|
||||
#include "ThebesLayerD3D10.h"
|
||||
#include "PaintedLayerD3D10.h"
|
||||
#include "ReadbackProcessor.h"
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
@ -256,7 +256,7 @@ ContainerLayerD3D10::Validate()
|
||||
Layer *layer = GetFirstChild();
|
||||
while (layer) {
|
||||
if (layer->GetType() == TYPE_THEBES) {
|
||||
static_cast<ThebesLayerD3D10*>(layer)->Validate(&readback);
|
||||
static_cast<PaintedLayerD3D10*>(layer)->Validate(&readback);
|
||||
} else {
|
||||
static_cast<LayerD3D10*>(layer->ImplData())->Validate();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "dxgi.h"
|
||||
|
||||
#include "ContainerLayerD3D10.h"
|
||||
#include "ThebesLayerD3D10.h"
|
||||
#include "PaintedLayerD3D10.h"
|
||||
#include "ColorLayerD3D10.h"
|
||||
#include "CanvasLayerD3D10.h"
|
||||
#include "ReadbackLayerD3D10.h"
|
||||
@ -354,7 +354,7 @@ LayerManagerD3D10::EndEmptyTransaction(EndTransactionFlags aFlags)
|
||||
}
|
||||
|
||||
void
|
||||
LayerManagerD3D10::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
LayerManagerD3D10::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
@ -392,10 +392,10 @@ LayerManagerD3D10::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
mTarget = nullptr;
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
LayerManagerD3D10::CreateThebesLayer()
|
||||
already_AddRefed<PaintedLayer>
|
||||
LayerManagerD3D10::CreatePaintedLayer()
|
||||
{
|
||||
nsRefPtr<ThebesLayer> layer = new ThebesLayerD3D10(this);
|
||||
nsRefPtr<PaintedLayer> layer = new PaintedLayerD3D10(this);
|
||||
return layer.forget();
|
||||
}
|
||||
|
||||
|
@ -81,11 +81,11 @@ public:
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
struct CallbackInfo {
|
||||
DrawThebesLayerCallback Callback;
|
||||
DrawPaintedLayerCallback Callback;
|
||||
void *CallbackData;
|
||||
};
|
||||
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
@ -105,7 +105,7 @@ public:
|
||||
return MAX_TEXTURE_SIZE;
|
||||
}
|
||||
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer();
|
||||
virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
|
||||
virtual already_AddRefed<ImageLayer> CreateImageLayer();
|
||||
virtual already_AddRefed<ColorLayer> CreateColorLayer();
|
||||
|
@ -9,7 +9,7 @@
|
||||
// typedefs conflicts.
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
|
||||
#include "ThebesLayerD3D10.h"
|
||||
#include "PaintedLayerD3D10.h"
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#include "gfxWindowsPlatform.h"
|
||||
@ -31,27 +31,27 @@ namespace layers {
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
ThebesLayerD3D10::ThebesLayerD3D10(LayerManagerD3D10 *aManager)
|
||||
: ThebesLayer(aManager, nullptr)
|
||||
PaintedLayerD3D10::PaintedLayerD3D10(LayerManagerD3D10 *aManager)
|
||||
: PaintedLayer(aManager, nullptr)
|
||||
, LayerD3D10(aManager)
|
||||
, mCurrentSurfaceMode(SurfaceMode::SURFACE_OPAQUE)
|
||||
{
|
||||
mImplData = static_cast<LayerD3D10*>(this);
|
||||
}
|
||||
|
||||
ThebesLayerD3D10::~ThebesLayerD3D10()
|
||||
PaintedLayerD3D10::~PaintedLayerD3D10()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::InvalidateRegion(const nsIntRegion &aRegion)
|
||||
PaintedLayerD3D10::InvalidateRegion(const nsIntRegion &aRegion)
|
||||
{
|
||||
mInvalidRegion.Or(mInvalidRegion, aRegion);
|
||||
mInvalidRegion.SimplifyOutward(20);
|
||||
mValidRegion.Sub(mValidRegion, mInvalidRegion);
|
||||
}
|
||||
|
||||
void ThebesLayerD3D10::CopyRegion(ID3D10Texture2D* aSrc, const nsIntPoint &aSrcOffset,
|
||||
void PaintedLayerD3D10::CopyRegion(ID3D10Texture2D* aSrc, const nsIntPoint &aSrcOffset,
|
||||
ID3D10Texture2D* aDest, const nsIntPoint &aDestOffset,
|
||||
const nsIntRegion &aCopyRegion, nsIntRegion* aValidRegion)
|
||||
{
|
||||
@ -84,7 +84,7 @@ void ThebesLayerD3D10::CopyRegion(ID3D10Texture2D* aSrc, const nsIntPoint &aSrcO
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::RenderLayer()
|
||||
PaintedLayerD3D10::RenderLayer()
|
||||
{
|
||||
if (!mTexture) {
|
||||
return;
|
||||
@ -145,7 +145,7 @@ ThebesLayerD3D10::RenderLayer()
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
PaintedLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
{
|
||||
if (mVisibleRegion.IsEmpty()) {
|
||||
return;
|
||||
@ -189,7 +189,7 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
nsTArray<ReadbackProcessor::Update> readbackUpdates;
|
||||
nsIntRegion readbackRegion;
|
||||
if (aReadback && UsedForReadback()) {
|
||||
aReadback->GetThebesLayerUpdates(this, &readbackUpdates, &readbackRegion);
|
||||
aReadback->GetPaintedLayerUpdates(this, &readbackUpdates, &readbackRegion);
|
||||
}
|
||||
|
||||
if (mTexture) {
|
||||
@ -243,7 +243,7 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
if (!drawRegion.IsEmpty()) {
|
||||
LayerManagerD3D10::CallbackInfo cbInfo = mD3DManager->GetCallbackInfo();
|
||||
if (!cbInfo.Callback) {
|
||||
NS_ERROR("D3D10 should never need to update ThebesLayers in an empty transaction");
|
||||
NS_ERROR("D3D10 should never need to update PaintedLayers in an empty transaction");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -258,7 +258,7 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
nsRefPtr<ID3D10Texture2D> readbackTexture;
|
||||
HRESULT hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(readbackTexture));
|
||||
if (FAILED(hr)) {
|
||||
LayerManagerD3D10::ReportFailure(NS_LITERAL_CSTRING("ThebesLayerD3D10::Validate(): Failed to create texture"),
|
||||
LayerManagerD3D10::ReportFailure(NS_LITERAL_CSTRING("PaintedLayerD3D10::Validate(): Failed to create texture"),
|
||||
hr);
|
||||
return;
|
||||
}
|
||||
@ -277,19 +277,19 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::LayerManagerDestroyed()
|
||||
PaintedLayerD3D10::LayerManagerDestroyed()
|
||||
{
|
||||
mD3DManager = nullptr;
|
||||
}
|
||||
|
||||
Layer*
|
||||
ThebesLayerD3D10::GetLayer()
|
||||
PaintedLayerD3D10::GetLayer()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::VerifyContentType(SurfaceMode aMode)
|
||||
PaintedLayerD3D10::VerifyContentType(SurfaceMode aMode)
|
||||
{
|
||||
if (mDrawTarget) {
|
||||
SurfaceFormat format = aMode != SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA ?
|
||||
@ -299,7 +299,7 @@ ThebesLayerD3D10::VerifyContentType(SurfaceMode aMode)
|
||||
mDrawTarget = Factory::CreateDrawTargetForD3D10Texture(mTexture, format);
|
||||
|
||||
if (!mDrawTarget) {
|
||||
NS_WARNING("Failed to create drawtarget for ThebesLayerD3D10.");
|
||||
NS_WARNING("Failed to create drawtarget for PaintedLayerD3D10.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ ThebesLayerD3D10::VerifyContentType(SurfaceMode aMode)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsIntPoint& aOffset)
|
||||
PaintedLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsIntPoint& aOffset)
|
||||
{
|
||||
if (mTexture && mTextureOnWhite) {
|
||||
// It would be more optimal to draw the actual geometry, but more code
|
||||
@ -380,7 +380,7 @@ ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsInt
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode)
|
||||
PaintedLayerD3D10::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode)
|
||||
{
|
||||
nsIntRect visibleRect = mVisibleRegion.GetBounds();
|
||||
|
||||
@ -413,7 +413,7 @@ ThebesLayerD3D10::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode)
|
||||
PaintedLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode)
|
||||
{
|
||||
if (aSize.width == 0 || aSize.height == 0) {
|
||||
// Nothing to do.
|
||||
@ -429,14 +429,14 @@ ThebesLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode
|
||||
hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(mTexture));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create new texture for ThebesLayerD3D10!");
|
||||
NS_WARNING("Failed to create new texture for PaintedLayerD3D10!");
|
||||
return;
|
||||
}
|
||||
|
||||
hr = device()->CreateShaderResourceView(mTexture, nullptr, getter_AddRefs(mSRView));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create shader resource view for ThebesLayerD3D10.");
|
||||
NS_WARNING("Failed to create shader resource view for PaintedLayerD3D10.");
|
||||
}
|
||||
|
||||
mDrawTarget = nullptr;
|
||||
@ -446,14 +446,14 @@ ThebesLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode
|
||||
hr = device()->CreateTexture2D(&desc, nullptr, getter_AddRefs(mTextureOnWhite));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create new texture for ThebesLayerD3D10!");
|
||||
NS_WARNING("Failed to create new texture for PaintedLayerD3D10!");
|
||||
return;
|
||||
}
|
||||
|
||||
hr = device()->CreateShaderResourceView(mTextureOnWhite, nullptr, getter_AddRefs(mSRViewOnWhite));
|
||||
|
||||
if (FAILED(hr)) {
|
||||
NS_WARNING("Failed to create shader resource view for ThebesLayerD3D10.");
|
||||
NS_WARNING("Failed to create shader resource view for PaintedLayerD3D10.");
|
||||
}
|
||||
|
||||
mDrawTarget = nullptr;
|
||||
@ -468,7 +468,7 @@ ThebesLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode
|
||||
}
|
||||
|
||||
if (!mDrawTarget) {
|
||||
NS_WARNING("Failed to create DrawTarget for ThebesLayerD3D10.");
|
||||
NS_WARNING("Failed to create DrawTarget for PaintedLayerD3D10.");
|
||||
mDrawTarget = nullptr;
|
||||
return;
|
||||
}
|
@ -3,24 +3,24 @@
|
||||
* 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_THEBESLAYERD3D10_H
|
||||
#define GFX_THEBESLAYERD3D10_H
|
||||
#ifndef GFX_PAINTEDLAYERD3D10_H
|
||||
#define GFX_PAINTEDLAYERD3D10_H
|
||||
|
||||
#include "LayerManagerD3D10.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class ThebesLayerD3D10 : public ThebesLayer,
|
||||
class PaintedLayerD3D10 : public PaintedLayer,
|
||||
public LayerD3D10
|
||||
{
|
||||
public:
|
||||
ThebesLayerD3D10(LayerManagerD3D10 *aManager);
|
||||
virtual ~ThebesLayerD3D10();
|
||||
PaintedLayerD3D10(LayerManagerD3D10 *aManager);
|
||||
virtual ~PaintedLayerD3D10();
|
||||
|
||||
void Validate(ReadbackProcessor *aReadback);
|
||||
|
||||
/* ThebesLayer implementation */
|
||||
/* PaintedLayer implementation */
|
||||
void InvalidateRegion(const nsIntRegion& aRegion);
|
||||
|
||||
/* LayerD3D10 implementation */
|
||||
@ -70,4 +70,4 @@ private:
|
||||
|
||||
} /* layers */
|
||||
} /* mozilla */
|
||||
#endif /* GFX_THEBESLAYERD3D10_H */
|
||||
#endif /* GFX_PAINTEDLAYERD3D10_H */
|
@ -20,14 +20,14 @@ namespace layers {
|
||||
// mLayer may be released only on the main thread this object should always be
|
||||
// destroyed on the main thread!
|
||||
struct ReadbackTask {
|
||||
// The texture that we copied the contents of the thebeslayer to.
|
||||
// The texture that we copied the contents of the paintedlayer to.
|
||||
nsRefPtr<ID3D10Texture2D> mReadbackTexture;
|
||||
// This exists purely to keep the ReadbackLayer alive for the lifetime of
|
||||
// mUpdate. Note that this addref and release should occur -solely- on the
|
||||
// main thread.
|
||||
nsRefPtr<ReadbackLayer> mLayer;
|
||||
ReadbackProcessor::Update mUpdate;
|
||||
// The origin in ThebesLayer coordinates of mReadbackTexture.
|
||||
// The origin in PaintedLayer coordinates of mReadbackTexture.
|
||||
gfxPoint mOrigin;
|
||||
// mLayer->GetBackgroundOffset() when the task is created. We have
|
||||
// to save this in the ReadbackTask because it might change before
|
||||
@ -64,7 +64,7 @@ public:
|
||||
HRESULT hr = mTask->mReadbackTexture->Map(0, D3D10_MAP_READ, 0, &mappedTex);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
// If this fails we're never going to get our ThebesLayer content.
|
||||
// If this fails we're never going to get our PaintedLayer content.
|
||||
update->mLayer->GetSink()->SetUnknown(update->mSequenceCounter);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
* @param aUpdate ReadbackProcessor::Update object. This is a void pointer
|
||||
* since we cannot forward declare a nested class, and do not
|
||||
* export ReadbackProcessor.h
|
||||
* @param aOrigin Origin of the aTexture surface in the ThebesLayer
|
||||
* @param aOrigin Origin of the aTexture surface in the PaintedLayer
|
||||
* coordinate system.
|
||||
*/
|
||||
void PostTask(ID3D10Texture2D *aTexture, void *aUpdate, const gfxPoint &aOrigin);
|
||||
|
@ -23,7 +23,7 @@ namespace layers {
|
||||
// mSink may be released only on the main thread this object should always be
|
||||
// destroyed on the main thread!
|
||||
struct ReadbackTask {
|
||||
// The texture that we copied the contents of the thebeslayer to.
|
||||
// The texture that we copied the contents of the paintedlayer to.
|
||||
nsRefPtr<ID3D10Texture2D> mReadbackTexture;
|
||||
// The sink that we're trying to read back to.
|
||||
RefPtr<TextureReadbackSink> mSink;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "ContainerLayerD3D9.h"
|
||||
|
||||
#include "ThebesLayerD3D9.h"
|
||||
#include "PaintedLayerD3D9.h"
|
||||
#include "ReadbackProcessor.h"
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
@ -174,7 +174,7 @@ ContainerLayerD3D9::RenderLayer()
|
||||
device()->SetScissorRect(&d3drect);
|
||||
|
||||
if (layerToRender->GetLayer()->GetType() == TYPE_THEBES) {
|
||||
static_cast<ThebesLayerD3D9*>(layerToRender)->RenderThebesLayer(&readback);
|
||||
static_cast<PaintedLayerD3D9*>(layerToRender)->RenderPaintedLayer(&readback);
|
||||
} else {
|
||||
layerToRender->RenderLayer();
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "DeviceManagerD3D9.h"
|
||||
#include "LayerManagerD3D9Shaders.h"
|
||||
#include "ThebesLayerD3D9.h"
|
||||
#include "PaintedLayerD3D9.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIConsoleService.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "gfxSharedImageSurface.h"
|
||||
|
||||
#include "ImageLayerD3D9.h"
|
||||
#include "ThebesLayerD3D9.h"
|
||||
#include "PaintedLayerD3D9.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "gfx2DGlue.h"
|
||||
#include "yuv_convert.h"
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "LayerManagerD3D9.h"
|
||||
|
||||
#include "ThebesLayerD3D9.h"
|
||||
#include "PaintedLayerD3D9.h"
|
||||
#include "ContainerLayerD3D9.h"
|
||||
#include "ImageLayerD3D9.h"
|
||||
#include "ColorLayerD3D9.h"
|
||||
@ -128,7 +128,7 @@ LayerManagerD3D9::EndEmptyTransaction(EndTransactionFlags aFlags)
|
||||
}
|
||||
|
||||
void
|
||||
LayerManagerD3D9::EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
LayerManagerD3D9::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
@ -167,10 +167,10 @@ LayerManagerD3D9::SetRoot(Layer *aLayer)
|
||||
mRoot = aLayer;
|
||||
}
|
||||
|
||||
already_AddRefed<ThebesLayer>
|
||||
LayerManagerD3D9::CreateThebesLayer()
|
||||
already_AddRefed<PaintedLayer>
|
||||
LayerManagerD3D9::CreatePaintedLayer()
|
||||
{
|
||||
nsRefPtr<ThebesLayer> layer = new ThebesLayerD3D9(this);
|
||||
nsRefPtr<PaintedLayer> layer = new PaintedLayerD3D9(this);
|
||||
return layer.forget();
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class LayerD3D9;
|
||||
class ThebesLayerD3D9;
|
||||
class PaintedLayerD3D9;
|
||||
|
||||
/*
|
||||
* This is the LayerManager used for Direct3D 9. For now this will render on
|
||||
@ -66,11 +66,11 @@ public:
|
||||
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
struct CallbackInfo {
|
||||
DrawThebesLayerCallback Callback;
|
||||
DrawPaintedLayerCallback Callback;
|
||||
void *CallbackData;
|
||||
};
|
||||
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT);
|
||||
|
||||
@ -91,7 +91,7 @@ public:
|
||||
return mDeviceManager->GetMaxTextureSize();
|
||||
}
|
||||
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer();
|
||||
|
||||
virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
// typedefs conflicts.
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
|
||||
#include "ThebesLayerD3D9.h"
|
||||
#include "PaintedLayerD3D9.h"
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#include "gfxWindowsPlatform.h"
|
||||
@ -24,15 +24,15 @@ namespace layers {
|
||||
|
||||
using namespace gfx;
|
||||
|
||||
ThebesLayerD3D9::ThebesLayerD3D9(LayerManagerD3D9 *aManager)
|
||||
: ThebesLayer(aManager, nullptr)
|
||||
PaintedLayerD3D9::PaintedLayerD3D9(LayerManagerD3D9 *aManager)
|
||||
: PaintedLayer(aManager, nullptr)
|
||||
, LayerD3D9(aManager)
|
||||
{
|
||||
mImplData = static_cast<LayerD3D9*>(this);
|
||||
aManager->deviceManager()->mLayersWithResources.AppendElement(this);
|
||||
}
|
||||
|
||||
ThebesLayerD3D9::~ThebesLayerD3D9()
|
||||
PaintedLayerD3D9::~PaintedLayerD3D9()
|
||||
{
|
||||
if (mD3DManager) {
|
||||
mD3DManager->deviceManager()->mLayersWithResources.RemoveElement(this);
|
||||
@ -47,7 +47,7 @@ ThebesLayerD3D9::~ThebesLayerD3D9()
|
||||
#define RETENTION_THRESHOLD 16384
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::InvalidateRegion(const nsIntRegion &aRegion)
|
||||
PaintedLayerD3D9::InvalidateRegion(const nsIntRegion &aRegion)
|
||||
{
|
||||
mInvalidRegion.Or(mInvalidRegion, aRegion);
|
||||
mInvalidRegion.SimplifyOutward(20);
|
||||
@ -55,7 +55,7 @@ ThebesLayerD3D9::InvalidateRegion(const nsIntRegion &aRegion)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::CopyRegion(IDirect3DTexture9* aSrc, const nsIntPoint &aSrcOffset,
|
||||
PaintedLayerD3D9::CopyRegion(IDirect3DTexture9* aSrc, const nsIntPoint &aSrcOffset,
|
||||
IDirect3DTexture9* aDest, const nsIntPoint &aDestOffset,
|
||||
const nsIntRegion &aCopyRegion, nsIntRegion* aValidRegion)
|
||||
{
|
||||
@ -97,7 +97,7 @@ ThebesLayerD3D9::CopyRegion(IDirect3DTexture9* aSrc, const nsIntPoint &aSrcOffse
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::UpdateTextures(SurfaceMode aMode)
|
||||
PaintedLayerD3D9::UpdateTextures(SurfaceMode aMode)
|
||||
{
|
||||
nsIntRect visibleRect = mVisibleRegion.GetBounds();
|
||||
|
||||
@ -141,7 +141,7 @@ ThebesLayerD3D9::UpdateTextures(SurfaceMode aMode)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::RenderRegion(const nsIntRegion& aRegion)
|
||||
PaintedLayerD3D9::RenderRegion(const nsIntRegion& aRegion)
|
||||
{
|
||||
nsIntRegionRectIterator iter(aRegion);
|
||||
|
||||
@ -166,7 +166,7 @@ ThebesLayerD3D9::RenderRegion(const nsIntRegion& aRegion)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::RenderThebesLayer(ReadbackProcessor* aReadback)
|
||||
PaintedLayerD3D9::RenderPaintedLayer(ReadbackProcessor* aReadback)
|
||||
{
|
||||
if (mVisibleRegion.IsEmpty()) {
|
||||
return;
|
||||
@ -208,10 +208,10 @@ ThebesLayerD3D9::RenderThebesLayer(ReadbackProcessor* aReadback)
|
||||
nsTArray<ReadbackProcessor::Update> readbackUpdates;
|
||||
nsIntRegion readbackRegion;
|
||||
if (aReadback && UsedForReadback()) {
|
||||
aReadback->GetThebesLayerUpdates(this, &readbackUpdates, &readbackRegion);
|
||||
aReadback->GetPaintedLayerUpdates(this, &readbackUpdates, &readbackRegion);
|
||||
}
|
||||
|
||||
// Because updates to D3D9 ThebesLayers are rendered with the CPU, we don't
|
||||
// Because updates to D3D9 PaintedLayers are rendered with the CPU, we don't
|
||||
// have to do readback from D3D9 surfaces. Instead we make sure that any area
|
||||
// needed for readback is included in the drawRegion we ask layout to render.
|
||||
// Then the readback areas we need can be copied out of the temporary
|
||||
@ -224,7 +224,7 @@ ThebesLayerD3D9::RenderThebesLayer(ReadbackProcessor* aReadback)
|
||||
if (!drawRegion.IsEmpty()) {
|
||||
LayerManagerD3D9::CallbackInfo cbInfo = mD3DManager->GetCallbackInfo();
|
||||
if (!cbInfo.Callback) {
|
||||
NS_ERROR("D3D9 should never need to update ThebesLayers in an empty transaction");
|
||||
NS_ERROR("D3D9 should never need to update PaintedLayers in an empty transaction");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -272,7 +272,7 @@ ThebesLayerD3D9::RenderThebesLayer(ReadbackProcessor* aReadback)
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::CleanResources()
|
||||
PaintedLayerD3D9::CleanResources()
|
||||
{
|
||||
mTexture = nullptr;
|
||||
mTextureOnWhite = nullptr;
|
||||
@ -280,26 +280,26 @@ ThebesLayerD3D9::CleanResources()
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::LayerManagerDestroyed()
|
||||
PaintedLayerD3D9::LayerManagerDestroyed()
|
||||
{
|
||||
mD3DManager->deviceManager()->mLayersWithResources.RemoveElement(this);
|
||||
mD3DManager = nullptr;
|
||||
}
|
||||
|
||||
Layer*
|
||||
ThebesLayerD3D9::GetLayer()
|
||||
PaintedLayerD3D9::GetLayer()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
bool
|
||||
ThebesLayerD3D9::IsEmpty()
|
||||
PaintedLayerD3D9::IsEmpty()
|
||||
{
|
||||
return !mTexture;
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::VerifyContentType(SurfaceMode aMode)
|
||||
PaintedLayerD3D9::VerifyContentType(SurfaceMode aMode)
|
||||
{
|
||||
if (!mTexture)
|
||||
return;
|
||||
@ -480,7 +480,7 @@ FillSurface(gfxASurface* aSurface, const nsIntRegion& aRegion,
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode,
|
||||
PaintedLayerD3D9::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode,
|
||||
const nsTArray<ReadbackProcessor::Update>& aReadbackUpdates)
|
||||
{
|
||||
nsIntRect visibleRect = mVisibleRegion.GetBounds();
|
||||
@ -619,7 +619,7 @@ ThebesLayerD3D9::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode,
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D9::CreateNewTextures(const gfx::IntSize &aSize,
|
||||
PaintedLayerD3D9::CreateNewTextures(const gfx::IntSize &aSize,
|
||||
SurfaceMode aMode)
|
||||
{
|
||||
if (aSize.width == 0 || aSize.height == 0) {
|
||||
@ -634,7 +634,7 @@ ThebesLayerD3D9::CreateNewTextures(const gfx::IntSize &aSize,
|
||||
aMode != SurfaceMode::SURFACE_SINGLE_CHANNEL_ALPHA ? D3DFMT_X8R8G8B8 : D3DFMT_A8R8G8B8,
|
||||
D3DPOOL_DEFAULT, getter_AddRefs(mTexture), nullptr);
|
||||
if (FAILED(hr)) {
|
||||
ReportFailure(NS_LITERAL_CSTRING("ThebesLayerD3D9::CreateNewTextures(): Failed to create texture"),
|
||||
ReportFailure(NS_LITERAL_CSTRING("PaintedLayerD3D9::CreateNewTextures(): Failed to create texture"),
|
||||
hr);
|
||||
return;
|
||||
}
|
||||
@ -645,7 +645,7 @@ ThebesLayerD3D9::CreateNewTextures(const gfx::IntSize &aSize,
|
||||
D3DFMT_X8R8G8B8,
|
||||
D3DPOOL_DEFAULT, getter_AddRefs(mTextureOnWhite), nullptr);
|
||||
if (FAILED(hr)) {
|
||||
ReportFailure(NS_LITERAL_CSTRING("ThebesLayerD3D9::CreateNewTextures(): Failed to create texture (2)"),
|
||||
ReportFailure(NS_LITERAL_CSTRING("PaintedLayerD3D9::CreateNewTextures(): Failed to create texture (2)"),
|
||||
hr);
|
||||
return;
|
||||
}
|
@ -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 GFX_THEBESLAYERD3D9_H
|
||||
#define GFX_THEBESLAYERD3D9_H
|
||||
#ifndef GFX_PAINTEDLAYERD3D9_H
|
||||
#define GFX_PAINTEDLAYERD3D9_H
|
||||
|
||||
#include "Layers.h"
|
||||
#include "LayerManagerD3D9.h"
|
||||
@ -15,24 +15,24 @@ namespace layers {
|
||||
|
||||
class ReadbackProcessor;
|
||||
|
||||
class ThebesLayerD3D9 : public ThebesLayer,
|
||||
class PaintedLayerD3D9 : public PaintedLayer,
|
||||
public LayerD3D9
|
||||
{
|
||||
public:
|
||||
ThebesLayerD3D9(LayerManagerD3D9 *aManager);
|
||||
virtual ~ThebesLayerD3D9();
|
||||
PaintedLayerD3D9(LayerManagerD3D9 *aManager);
|
||||
virtual ~PaintedLayerD3D9();
|
||||
|
||||
/* ThebesLayer implementation */
|
||||
/* PaintedLayer implementation */
|
||||
void InvalidateRegion(const nsIntRegion& aRegion);
|
||||
|
||||
/* LayerD3D9 implementation */
|
||||
Layer* GetLayer();
|
||||
virtual bool IsEmpty();
|
||||
virtual void RenderLayer() { RenderThebesLayer(nullptr); }
|
||||
virtual void RenderLayer() { RenderPaintedLayer(nullptr); }
|
||||
virtual void CleanResources();
|
||||
virtual void LayerManagerDestroyed();
|
||||
|
||||
void RenderThebesLayer(ReadbackProcessor* aReadback);
|
||||
void RenderPaintedLayer(ReadbackProcessor* aReadback);
|
||||
|
||||
private:
|
||||
/*
|
||||
@ -81,4 +81,4 @@ private:
|
||||
|
||||
} /* layers */
|
||||
} /* mozilla */
|
||||
#endif /* GFX_THEBESLAYERD3D9_H */
|
||||
#endif /* GFX_PAINTEDLAYERD3D9_H */
|
@ -23,7 +23,7 @@
|
||||
#include "mozilla/layers/LayersTypes.h" // for MOZ_LAYERS_LOG
|
||||
#include "mozilla/layers/TextureHost.h" // for TextureHost
|
||||
#include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL
|
||||
#include "mozilla/layers/ThebesLayerComposite.h"
|
||||
#include "mozilla/layers/PaintedLayerComposite.h"
|
||||
#include "mozilla/mozalloc.h" // for operator delete
|
||||
#include "mozilla/unused.h"
|
||||
#include "nsDebug.h" // for NS_WARNING, NS_ASSERTION
|
||||
@ -88,7 +88,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
||||
break;
|
||||
}
|
||||
case CompositableOperation::TOpPaintTextureRegion: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Paint ThebesLayer"));
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Paint PaintedLayer"));
|
||||
|
||||
const OpPaintTextureRegion& op = aEdit.get_OpPaintTextureRegion();
|
||||
CompositableHost* compositable = AsCompositable(op);
|
||||
@ -96,7 +96,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
||||
if (!layer || layer->GetType() != Layer::TYPE_THEBES) {
|
||||
return false;
|
||||
}
|
||||
ThebesLayerComposite* thebes = static_cast<ThebesLayerComposite*>(layer);
|
||||
PaintedLayerComposite* thebes = static_cast<PaintedLayerComposite*>(layer);
|
||||
|
||||
const ThebesBufferData& bufferData = op.bufferData();
|
||||
|
||||
@ -117,7 +117,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
|
||||
break;
|
||||
}
|
||||
case CompositableOperation::TOpPaintTextureIncremental: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Paint ThebesLayer"));
|
||||
MOZ_LAYERS_LOG(("[ParentSide] Paint PaintedLayer"));
|
||||
|
||||
const OpPaintTextureIncremental& op = aEdit.get_OpPaintTextureIncremental();
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "mozilla/layers/PCompositableParent.h"
|
||||
#include "mozilla/layers/PLayerParent.h" // for PLayerParent
|
||||
#include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL
|
||||
#include "mozilla/layers/ThebesLayerComposite.h"
|
||||
#include "mozilla/layers/PaintedLayerComposite.h"
|
||||
#include "mozilla/mozalloc.h" // for operator delete, etc
|
||||
#include "mozilla/unused.h"
|
||||
#include "nsCoord.h" // for NSAppUnitsToFloatPixels
|
||||
@ -234,12 +234,12 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
|
||||
switch (edit.type()) {
|
||||
// Create* ops
|
||||
case Edit::TOpCreateThebesLayer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] CreateThebesLayer"));
|
||||
case Edit::TOpCreatePaintedLayer: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] CreatePaintedLayer"));
|
||||
|
||||
nsRefPtr<ThebesLayerComposite> layer =
|
||||
layer_manager()->CreateThebesLayerComposite();
|
||||
AsLayerComposite(edit.get_OpCreateThebesLayer())->Bind(layer);
|
||||
nsRefPtr<PaintedLayerComposite> layer =
|
||||
layer_manager()->CreatePaintedLayerComposite();
|
||||
AsLayerComposite(edit.get_OpCreatePaintedLayer())->Bind(layer);
|
||||
break;
|
||||
}
|
||||
case Edit::TOpCreateContainerLayer: {
|
||||
@ -329,17 +329,17 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
case Specific::Tnull_t:
|
||||
break;
|
||||
|
||||
case Specific::TThebesLayerAttributes: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] thebes layer"));
|
||||
case Specific::TPaintedLayerAttributes: {
|
||||
MOZ_LAYERS_LOG(("[ParentSide] painted layer"));
|
||||
|
||||
ThebesLayerComposite* thebesLayer = layerParent->AsThebesLayerComposite();
|
||||
if (!thebesLayer) {
|
||||
PaintedLayerComposite* paintedLayer = layerParent->AsPaintedLayerComposite();
|
||||
if (!paintedLayer) {
|
||||
return false;
|
||||
}
|
||||
const ThebesLayerAttributes& attrs =
|
||||
specific.get_ThebesLayerAttributes();
|
||||
const PaintedLayerAttributes& attrs =
|
||||
specific.get_PaintedLayerAttributes();
|
||||
|
||||
thebesLayer->SetValidRegion(attrs.validRegion());
|
||||
paintedLayer->SetValidRegion(attrs.validRegion());
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ struct TargetConfig {
|
||||
};
|
||||
|
||||
// Create a shadow layer for |layer|
|
||||
struct OpCreateThebesLayer { PLayer layer; };
|
||||
struct OpCreatePaintedLayer { PLayer layer; };
|
||||
struct OpCreateContainerLayer { PLayer layer; };
|
||||
struct OpCreateImageLayer { PLayer layer; };
|
||||
struct OpCreateColorLayer { PLayer layer; };
|
||||
@ -219,7 +219,7 @@ struct CommonLayerAttributes {
|
||||
string contentDescription;
|
||||
};
|
||||
|
||||
struct ThebesLayerAttributes {
|
||||
struct PaintedLayerAttributes {
|
||||
nsIntRegion validRegion;
|
||||
};
|
||||
struct ContainerLayerAttributes {
|
||||
@ -235,7 +235,7 @@ struct ImageLayerAttributes { GraphicsFilterType filter; IntSize scaleToSize
|
||||
|
||||
union SpecificLayerAttributes {
|
||||
null_t;
|
||||
ThebesLayerAttributes;
|
||||
PaintedLayerAttributes;
|
||||
ContainerLayerAttributes;
|
||||
ColorLayerAttributes;
|
||||
CanvasLayerAttributes;
|
||||
@ -430,7 +430,7 @@ union CompositableOperation {
|
||||
|
||||
// A unit of a changeset; a set of these comprise a changeset
|
||||
union Edit {
|
||||
OpCreateThebesLayer;
|
||||
OpCreatePaintedLayer;
|
||||
OpCreateContainerLayer;
|
||||
OpCreateImageLayer;
|
||||
OpCreateColorLayer;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "nsDebug.h" // for NS_RUNTIMEABORT
|
||||
#include "nsISupportsImpl.h" // for Layer::AddRef, etc
|
||||
|
||||
#include "mozilla/layers/ThebesLayerComposite.h"
|
||||
#include "mozilla/layers/PaintedLayerComposite.h"
|
||||
#include "mozilla/layers/CanvasLayerComposite.h"
|
||||
#include "mozilla/layers/ColorLayerComposite.h"
|
||||
#include "mozilla/layers/ImageLayerComposite.h"
|
||||
@ -85,11 +85,11 @@ ShadowLayerParent::AsRefLayerComposite() const
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
ThebesLayerComposite*
|
||||
ShadowLayerParent::AsThebesLayerComposite() const
|
||||
PaintedLayerComposite*
|
||||
ShadowLayerParent::AsPaintedLayerComposite() const
|
||||
{
|
||||
return mLayer && mLayer->GetType() == Layer::TYPE_THEBES
|
||||
? static_cast<ThebesLayerComposite*>(mLayer.get())
|
||||
? static_cast<PaintedLayerComposite*>(mLayer.get())
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ class ColorLayerComposite;
|
||||
class ContainerLayerComposite;
|
||||
class ImageLayerComposite;
|
||||
class RefLayerComposite;
|
||||
class ThebesLayerComposite;
|
||||
class PaintedLayerComposite;
|
||||
|
||||
class ShadowLayerParent : public PLayerParent
|
||||
{
|
||||
@ -44,7 +44,7 @@ public:
|
||||
ColorLayerComposite* AsColorLayerComposite() const;
|
||||
ImageLayerComposite* AsImageLayerComposite() const;
|
||||
RefLayerComposite* AsRefLayerComposite() const;
|
||||
ThebesLayerComposite* AsThebesLayerComposite() const;
|
||||
PaintedLayerComposite* AsPaintedLayerComposite() const;
|
||||
|
||||
private:
|
||||
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
||||
|
@ -205,9 +205,9 @@ CreatedLayer(Transaction* aTxn, ShadowableLayer* aLayer)
|
||||
}
|
||||
|
||||
void
|
||||
ShadowLayerForwarder::CreatedThebesLayer(ShadowableLayer* aThebes)
|
||||
ShadowLayerForwarder::CreatedPaintedLayer(ShadowableLayer* aThebes)
|
||||
{
|
||||
CreatedLayer<OpCreateThebesLayer>(mTxn, aThebes);
|
||||
CreatedLayer<OpCreatePaintedLayer>(mTxn, aThebes);
|
||||
}
|
||||
void
|
||||
ShadowLayerForwarder::CreatedContainerLayer(ShadowableLayer* aContainer)
|
||||
|
@ -50,7 +50,7 @@ class ShadowableLayer;
|
||||
class ShmemTextureClient;
|
||||
class SurfaceDescriptor;
|
||||
class TextureClient;
|
||||
class ThebesLayerComposite;
|
||||
class PaintedLayerComposite;
|
||||
class ThebesBuffer;
|
||||
class ThebesBufferData;
|
||||
class TiledLayerComposer;
|
||||
@ -189,7 +189,7 @@ public:
|
||||
* created, and a corresponding shadow layer should be created in
|
||||
* the compositing process.
|
||||
*/
|
||||
void CreatedThebesLayer(ShadowableLayer* aThebes);
|
||||
void CreatedPaintedLayer(ShadowableLayer* aThebes);
|
||||
void CreatedContainerLayer(ShadowableLayer* aContainer);
|
||||
void CreatedImageLayer(ShadowableLayer* aImage);
|
||||
void CreatedColorLayer(ShadowableLayer* aColor);
|
||||
|
@ -9,12 +9,12 @@ EXPORTS += [
|
||||
'basic/BasicImplData.h',
|
||||
'basic/BasicLayers.h',
|
||||
'basic/BasicLayersImpl.h',
|
||||
'basic/BasicThebesLayer.h',
|
||||
'basic/BasicPaintedLayer.h',
|
||||
'client/ClientCanvasLayer.h',
|
||||
'client/ClientContainerLayer.h',
|
||||
'client/ClientLayerManager.h',
|
||||
'client/ClientThebesLayer.h',
|
||||
'client/ClientTiledThebesLayer.h',
|
||||
'client/ClientPaintedLayer.h',
|
||||
'client/ClientTiledPaintedLayer.h',
|
||||
'composite/CompositableHost.h',
|
||||
'composite/ImageHost.h',
|
||||
'CopyableCanvasLayer.h',
|
||||
@ -65,8 +65,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
'd3d9/ContainerLayerD3D9.cpp',
|
||||
'd3d9/ImageLayerD3D9.cpp',
|
||||
'd3d9/LayerManagerD3D9.cpp',
|
||||
'd3d9/PaintedLayerD3D9.cpp',
|
||||
'd3d9/TextureD3D9.cpp',
|
||||
'd3d9/ThebesLayerD3D9.cpp',
|
||||
]
|
||||
SOURCES += [
|
||||
'd3d9/CompositorD3D9.cpp',
|
||||
@ -90,8 +90,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
'd3d10/ContainerLayerD3D10.cpp',
|
||||
'd3d10/ImageLayerD3D10.cpp',
|
||||
'd3d10/LayerManagerD3D10.cpp',
|
||||
'd3d10/PaintedLayerD3D10.cpp',
|
||||
'd3d10/ReadbackManagerD3D10.cpp',
|
||||
'd3d10/ThebesLayerD3D10.cpp',
|
||||
'd3d11/TextureD3D11.cpp',
|
||||
'ipc/ShadowLayerUtilsD3D10.cpp',
|
||||
]
|
||||
@ -139,8 +139,8 @@ EXPORTS.mozilla.layers += [
|
||||
'composite/ImageHost.h',
|
||||
'composite/ImageLayerComposite.h',
|
||||
'composite/LayerManagerComposite.h',
|
||||
'composite/PaintedLayerComposite.h',
|
||||
'composite/TextureHost.h',
|
||||
'composite/ThebesLayerComposite.h',
|
||||
'Compositor.h',
|
||||
'CompositorTypes.h',
|
||||
'D3D9SurfaceImage.h',
|
||||
@ -256,7 +256,7 @@ UNIFIED_SOURCES += [
|
||||
'basic/BasicImages.cpp',
|
||||
'basic/BasicLayerManager.cpp',
|
||||
'basic/BasicLayersImpl.cpp',
|
||||
'basic/BasicThebesLayer.cpp',
|
||||
'basic/BasicPaintedLayer.cpp',
|
||||
'basic/TextureHostBasic.cpp',
|
||||
'BufferUnrotate.cpp',
|
||||
'client/CanvasClient.cpp',
|
||||
@ -265,8 +265,8 @@ UNIFIED_SOURCES += [
|
||||
'client/ClientContainerLayer.cpp',
|
||||
'client/ClientImageLayer.cpp',
|
||||
'client/ClientLayerManager.cpp',
|
||||
'client/ClientThebesLayer.cpp',
|
||||
'client/ClientTiledThebesLayer.cpp',
|
||||
'client/ClientPaintedLayer.cpp',
|
||||
'client/ClientTiledPaintedLayer.cpp',
|
||||
'client/CompositableClient.cpp',
|
||||
'client/ContentClient.cpp',
|
||||
'client/ImageClient.cpp',
|
||||
@ -285,7 +285,7 @@ UNIFIED_SOURCES += [
|
||||
'composite/LayerManagerComposite.cpp',
|
||||
'composite/TextRenderer.cpp',
|
||||
'composite/TextureHost.cpp',
|
||||
'composite/ThebesLayerComposite.cpp',
|
||||
'composite/PaintedLayerComposite.cpp',
|
||||
'composite/TiledContentHost.cpp',
|
||||
'Compositor.cpp',
|
||||
'CopyableCanvasLayer.cpp',
|
||||
|
@ -963,7 +963,7 @@ bool LayersPacket_Layer_LayerType_IsValid(int value) {
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::UnknownLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::LayerManager;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::ContainerLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::ThebesLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::PaintedLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::CanvasLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::ImageLayer;
|
||||
const LayersPacket_Layer_LayerType LayersPacket_Layer::ColorLayer;
|
||||
|
@ -49,7 +49,7 @@ enum LayersPacket_Layer_LayerType {
|
||||
LayersPacket_Layer_LayerType_UnknownLayer = 0,
|
||||
LayersPacket_Layer_LayerType_LayerManager = 1,
|
||||
LayersPacket_Layer_LayerType_ContainerLayer = 2,
|
||||
LayersPacket_Layer_LayerType_ThebesLayer = 3,
|
||||
LayersPacket_Layer_LayerType_PaintedLayer = 3,
|
||||
LayersPacket_Layer_LayerType_CanvasLayer = 4,
|
||||
LayersPacket_Layer_LayerType_ImageLayer = 5,
|
||||
LayersPacket_Layer_LayerType_ColorLayer = 6,
|
||||
@ -904,7 +904,7 @@ class LayersPacket_Layer : public ::google::protobuf::MessageLite {
|
||||
static const LayerType UnknownLayer = LayersPacket_Layer_LayerType_UnknownLayer;
|
||||
static const LayerType LayerManager = LayersPacket_Layer_LayerType_LayerManager;
|
||||
static const LayerType ContainerLayer = LayersPacket_Layer_LayerType_ContainerLayer;
|
||||
static const LayerType ThebesLayer = LayersPacket_Layer_LayerType_ThebesLayer;
|
||||
static const LayerType PaintedLayer = LayersPacket_Layer_LayerType_PaintedLayer;
|
||||
static const LayerType CanvasLayer = LayersPacket_Layer_LayerType_CanvasLayer;
|
||||
static const LayerType ImageLayer = LayersPacket_Layer_LayerType_ImageLayer;
|
||||
static const LayerType ColorLayer = LayersPacket_Layer_LayerType_ColorLayer;
|
||||
|
@ -31,7 +31,7 @@ message LayersPacket {
|
||||
UnknownLayer = 0;
|
||||
LayerManager = 1;
|
||||
ContainerLayer = 2;
|
||||
ThebesLayer = 3;
|
||||
PaintedLayer = 3;
|
||||
CanvasLayer = 4;
|
||||
ImageLayer = 5;
|
||||
ColorLayer = 6;
|
||||
|
@ -1812,7 +1812,7 @@ TEST_F(APZHitTestingTester, HitTesting2) {
|
||||
EXPECT_EQ(Point(25, 75), transformToGecko * Point(25, 25));
|
||||
}
|
||||
|
||||
TEST_F(APZCTreeManagerTester, ScrollableThebesLayers) {
|
||||
TEST_F(APZCTreeManagerTester, ScrollablePaintedLayers) {
|
||||
CreateSimpleMultiLayerTree();
|
||||
ScopedLayerTreeRegistration registration(0, root, mcc);
|
||||
|
||||
|
@ -28,11 +28,11 @@ public:
|
||||
virtual already_AddRefed<ColorLayer> CreateColorLayer() { return nullptr; }
|
||||
virtual void BeginTransactionWithTarget(gfxContext* aTarget) {}
|
||||
virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() { return nullptr; }
|
||||
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
|
||||
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags = END_DEFAULT) {}
|
||||
virtual int32_t GetMaxTextureSize() const { return 0; }
|
||||
virtual already_AddRefed<ThebesLayer> CreateThebesLayer() { return nullptr; }
|
||||
virtual already_AddRefed<PaintedLayer> CreatePaintedLayer() { return nullptr; }
|
||||
};
|
||||
|
||||
class TestContainerLayer: public ContainerLayer {
|
||||
@ -54,14 +54,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class TestThebesLayer: public ThebesLayer {
|
||||
class TestPaintedLayer: public PaintedLayer {
|
||||
public:
|
||||
explicit TestThebesLayer(LayerManager* aManager)
|
||||
: ThebesLayer(aManager, nullptr)
|
||||
explicit TestPaintedLayer(LayerManager* aManager)
|
||||
: PaintedLayer(aManager, nullptr)
|
||||
{}
|
||||
|
||||
virtual const char* Name() const {
|
||||
return "TestThebesLayer";
|
||||
return "TestPaintedLayer";
|
||||
}
|
||||
|
||||
virtual LayerType GetType() const {
|
||||
@ -107,7 +107,7 @@ TEST(Layers, Transform) {
|
||||
|
||||
TEST(Layers, Type) {
|
||||
TestContainerLayer layer(nullptr);
|
||||
ASSERT_EQ(nullptr, layer.AsThebesLayer());
|
||||
ASSERT_EQ(nullptr, layer.AsPaintedLayer());
|
||||
ASSERT_EQ(nullptr, layer.AsRefLayer());
|
||||
ASSERT_EQ(nullptr, layer.AsColorLayer());
|
||||
}
|
||||
@ -155,7 +155,7 @@ already_AddRefed<Layer> CreateLayer(char aLayerType, LayerManager* aManager) {
|
||||
if (aLayerType == 'c') {
|
||||
layer = new TestContainerLayer(aManager);
|
||||
} else if (aLayerType == 't') {
|
||||
layer = new TestThebesLayer(aManager);
|
||||
layer = new TestPaintedLayer(aManager);
|
||||
}
|
||||
return layer.forget();
|
||||
}
|
||||
@ -242,8 +242,8 @@ TEST(Layers, LayerTree) {
|
||||
Layer* nullLayer = nullptr;
|
||||
ASSERT_NE(nullLayer, layers[0]->AsContainerLayer());
|
||||
ASSERT_NE(nullLayer, layers[1]->AsContainerLayer());
|
||||
ASSERT_NE(nullLayer, layers[2]->AsThebesLayer());
|
||||
ASSERT_NE(nullLayer, layers[3]->AsThebesLayer());
|
||||
ASSERT_NE(nullLayer, layers[2]->AsPaintedLayer());
|
||||
ASSERT_NE(nullLayer, layers[3]->AsPaintedLayer());
|
||||
}
|
||||
|
||||
static void ValidateTreePointers(Layer* aLayer) {
|
||||
|
@ -20,7 +20,7 @@ Mozilla Bug 705580: Test animated GIFs that are converted to ImageLayers
|
||||
|
||||
<div id="content">
|
||||
<!--
|
||||
Use an opacity of almost-1 to force a ContainerLayer with opacity, and the img as the sole item in the ThebesLayer. It should then
|
||||
Use an opacity of almost-1 to force a ContainerLayer with opacity, and the img as the sole item in the PaintedLayer. It should then
|
||||
be promoted to an ImageLayer.
|
||||
-->
|
||||
<div id="referenceDiv" style="height: 40px; width: 40px;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -27,7 +27,7 @@ namespace layers {
|
||||
class ContainerLayer;
|
||||
class LayerManager;
|
||||
class BasicLayerManager;
|
||||
class ThebesLayer;
|
||||
class PaintedLayer;
|
||||
}
|
||||
|
||||
namespace gfx {
|
||||
@ -36,7 +36,7 @@ class Matrix4x4;
|
||||
|
||||
class FrameLayerBuilder;
|
||||
class LayerManagerData;
|
||||
class ThebesLayerData;
|
||||
class PaintedLayerData;
|
||||
class ContainerState;
|
||||
|
||||
class RefCountedRegion {
|
||||
@ -99,14 +99,14 @@ struct ContainerLayerParameters {
|
||||
bool mDisableSubpixelAntialiasingInDescendants;
|
||||
bool mInLowPrecisionDisplayPort;
|
||||
/**
|
||||
* When this is false, ThebesLayer coordinates are drawn to with an integer
|
||||
* When this is false, PaintedLayer coordinates are drawn to with an integer
|
||||
* translation and the scale in mXScale/mYScale.
|
||||
*/
|
||||
bool AllowResidualTranslation()
|
||||
{
|
||||
// If we're in a transformed subtree, but no ancestor transform is actively
|
||||
// changing, we'll use the residual translation when drawing into the
|
||||
// ThebesLayer to ensure that snapping exactly matches the ideal transform.
|
||||
// PaintedLayer to ensure that snapping exactly matches the ideal transform.
|
||||
return mInTransformedSubtree && !mInActiveTransformedSubtree;
|
||||
}
|
||||
};
|
||||
@ -124,7 +124,7 @@ struct ContainerLayerParameters {
|
||||
* That data enables us to retain layer trees. When constructing a
|
||||
* ContainerLayer, we first check to see if there's an existing
|
||||
* ContainerLayer for the same frame that can be recycled. If we recycle
|
||||
* it, we also try to reuse its existing ThebesLayer children to render
|
||||
* it, we also try to reuse its existing PaintedLayer children to render
|
||||
* the display items without layers of their own. The idea is that by
|
||||
* recycling layers deterministically, we can ensure that when nothing
|
||||
* changes in a display list, we will reuse the existing layers without
|
||||
@ -135,7 +135,7 @@ struct ContainerLayerParameters {
|
||||
* locates the last layer used to render the display item, if any, and
|
||||
* return it as a candidate for recycling.
|
||||
*
|
||||
* FrameLayerBuilder sets up ThebesLayers so that 0,0 in the Thebes layer
|
||||
* FrameLayerBuilder sets up PaintedLayers so that 0,0 in the Thebes layer
|
||||
* corresponds to the (pixel-snapped) top-left of the aAnimatedGeometryRoot.
|
||||
* It sets up ContainerLayers so that 0,0 in the container layer
|
||||
* corresponds to the snapped top-left of the display item reference frame.
|
||||
@ -143,7 +143,7 @@ struct ContainerLayerParameters {
|
||||
* When we construct a container layer, we know the transform that will be
|
||||
* applied to the layer. If the transform scales the content, we can get
|
||||
* better results when intermediate buffers are used by pushing some scale
|
||||
* from the container's transform down to the children. For ThebesLayer
|
||||
* from the container's transform down to the children. For PaintedLayer
|
||||
* children, the scaling can be achieved by changing the size of the layer
|
||||
* and drawing into it with increased or decreased resolution. By convention,
|
||||
* integer types (nsIntPoint/nsIntSize/nsIntRect/nsIntRegion) are all in layer
|
||||
@ -153,7 +153,7 @@ class FrameLayerBuilder : public layers::LayerUserData {
|
||||
public:
|
||||
typedef layers::ContainerLayer ContainerLayer;
|
||||
typedef layers::Layer Layer;
|
||||
typedef layers::ThebesLayer ThebesLayer;
|
||||
typedef layers::PaintedLayer PaintedLayer;
|
||||
typedef layers::ImageLayer ImageLayer;
|
||||
typedef layers::LayerManager LayerManager;
|
||||
typedef layers::BasicLayerManager BasicLayerManager;
|
||||
@ -177,7 +177,7 @@ public:
|
||||
static void Shutdown();
|
||||
|
||||
void Init(nsDisplayListBuilder* aBuilder, LayerManager* aManager,
|
||||
ThebesLayerData* aLayerData = nullptr);
|
||||
PaintedLayerData* aLayerData = nullptr);
|
||||
|
||||
/**
|
||||
* Call this to notify that we have just started a transaction on the
|
||||
@ -208,7 +208,7 @@ public:
|
||||
* This gets called by display list code. It calls BuildLayer on the
|
||||
* items in the display list, making items with their own layers
|
||||
* children of the new container, and assigning all other items to
|
||||
* ThebesLayer children created and managed by the FrameLayerBuilder.
|
||||
* PaintedLayer children created and managed by the FrameLayerBuilder.
|
||||
* Returns a layer with clip rect cleared; it is the
|
||||
* caller's responsibility to add any clip rect. The visible region
|
||||
* is set based on what's in the layer.
|
||||
@ -261,7 +261,7 @@ public:
|
||||
* This function can be called multiple times in a row to draw
|
||||
* different regions.
|
||||
*/
|
||||
static void DrawThebesLayer(ThebesLayer* aLayer,
|
||||
static void DrawPaintedLayer(PaintedLayer* aLayer,
|
||||
gfxContext* aContext,
|
||||
const nsIntRegion& aRegionToDraw,
|
||||
mozilla::layers::DrawRegionClip aClip,
|
||||
@ -298,13 +298,13 @@ public:
|
||||
BasicLayerManager* aManager);
|
||||
|
||||
/**
|
||||
* Record aItem as a display item that is rendered by the ThebesLayer
|
||||
* Record aItem as a display item that is rendered by the PaintedLayer
|
||||
* aLayer, with aClipRect, where aContainerLayerFrame is the frame
|
||||
* for the container layer this ThebesItem belongs to.
|
||||
* aItem must have an underlying frame.
|
||||
* @param aTopLeft offset from active scrolled root to reference frame
|
||||
*/
|
||||
void AddThebesDisplayItem(ThebesLayerData* aLayer,
|
||||
void AddThebesDisplayItem(PaintedLayerData* aLayer,
|
||||
nsDisplayItem* aItem,
|
||||
const DisplayItemClip& aClip,
|
||||
const nsIntRect& aItemVisibleRect,
|
||||
@ -355,13 +355,13 @@ public:
|
||||
* of the active scrolled root frame. It must be an integer
|
||||
* translation.
|
||||
*/
|
||||
void SavePreviousDataForLayer(ThebesLayer* aLayer, uint32_t aClipCount);
|
||||
void SavePreviousDataForLayer(PaintedLayer* aLayer, uint32_t aClipCount);
|
||||
/**
|
||||
* Get the translation transform that was in aLayer when we last painted. It's either
|
||||
* the transform saved by SaveLastPaintTransform, or else the transform
|
||||
* that's currently in the layer (which must be an integer translation).
|
||||
*/
|
||||
nsIntPoint GetLastPaintOffset(ThebesLayer* aLayer);
|
||||
nsIntPoint GetLastPaintOffset(PaintedLayer* aLayer);
|
||||
|
||||
/**
|
||||
* Return the resolution at which we expect to render aFrame's contents,
|
||||
@ -370,12 +370,12 @@ public:
|
||||
* being rendered at, as well as any currently-inactive transforms between
|
||||
* aFrame and that container layer.
|
||||
*/
|
||||
static gfxSize GetThebesLayerScaleForFrame(nsIFrame* aFrame);
|
||||
static gfxSize GetPaintedLayerScaleForFrame(nsIFrame* aFrame);
|
||||
|
||||
/**
|
||||
* Stores a Layer as the dedicated layer in the DisplayItemData for a given frame/key pair.
|
||||
*
|
||||
* Used when we optimize a ThebesLayer into an ImageLayer and want to retroactively update the
|
||||
* Used when we optimize a PaintedLayer into an ImageLayer and want to retroactively update the
|
||||
* DisplayItemData so we can retrieve the layer from within layout.
|
||||
*/
|
||||
void StoreOptimizedLayerForFrame(nsDisplayItem* aItem, Layer* aLayer);
|
||||
@ -446,7 +446,7 @@ public:
|
||||
* longer than the transaction.
|
||||
*
|
||||
* Updates the geometry, frame list and clip.
|
||||
* For items within a ThebesLayer, a geometry object must be specifed to retain
|
||||
* For items within a PaintedLayer, a geometry object must be specifed to retain
|
||||
* until the next transaction.
|
||||
*
|
||||
*/
|
||||
@ -489,7 +489,7 @@ protected:
|
||||
* Given a frame and a display item key that uniquely identifies a
|
||||
* display item for the frame, find the layer that was last used to
|
||||
* render that display item. Returns null if there is no such layer.
|
||||
* This could be a dedicated layer for the display item, or a ThebesLayer
|
||||
* This could be a dedicated layer for the display item, or a PaintedLayer
|
||||
* that renders many display items.
|
||||
*/
|
||||
DisplayItemData* GetOldLayerForFrame(nsIFrame* aFrame, uint32_t aDisplayItemKey);
|
||||
@ -534,12 +534,12 @@ protected:
|
||||
void* aClosure);
|
||||
/**
|
||||
* We store one of these for each display item associated with a
|
||||
* ThebesLayer, in a hashtable that maps each ThebesLayer to an array
|
||||
* of ClippedDisplayItems. (ThebesLayerItemsEntry is the hash entry
|
||||
* PaintedLayer, in a hashtable that maps each PaintedLayer to an array
|
||||
* of ClippedDisplayItems. (PaintedLayerItemsEntry is the hash entry
|
||||
* for that hashtable.)
|
||||
* These are only stored during the paint process, so that the
|
||||
* DrawThebesLayer callback can figure out which items to draw for the
|
||||
* ThebesLayer.
|
||||
* DrawPaintedLayer callback can figure out which items to draw for the
|
||||
* PaintedLayer.
|
||||
*/
|
||||
struct ClippedDisplayItem {
|
||||
ClippedDisplayItem(nsDisplayItem* aItem, uint32_t aGeneration)
|
||||
@ -585,25 +585,25 @@ protected:
|
||||
* the paint process. This is the hashentry for that hashtable.
|
||||
*/
|
||||
public:
|
||||
class ThebesLayerItemsEntry : public nsPtrHashKey<ThebesLayer> {
|
||||
class PaintedLayerItemsEntry : public nsPtrHashKey<PaintedLayer> {
|
||||
public:
|
||||
explicit ThebesLayerItemsEntry(const ThebesLayer *key)
|
||||
: nsPtrHashKey<ThebesLayer>(key)
|
||||
explicit PaintedLayerItemsEntry(const PaintedLayer *key)
|
||||
: nsPtrHashKey<PaintedLayer>(key)
|
||||
, mContainerLayerFrame(nullptr)
|
||||
, mLastCommonClipCount(0)
|
||||
, mContainerLayerGeneration(0)
|
||||
, mHasExplicitLastPaintOffset(false)
|
||||
, mCommonClipCount(0)
|
||||
{}
|
||||
ThebesLayerItemsEntry(const ThebesLayerItemsEntry &toCopy) :
|
||||
nsPtrHashKey<ThebesLayer>(toCopy.mKey), mItems(toCopy.mItems)
|
||||
PaintedLayerItemsEntry(const PaintedLayerItemsEntry &toCopy) :
|
||||
nsPtrHashKey<PaintedLayer>(toCopy.mKey), mItems(toCopy.mItems)
|
||||
{
|
||||
NS_ERROR("Should never be called, since we ALLOW_MEMMOVE");
|
||||
}
|
||||
|
||||
nsTArray<ClippedDisplayItem> mItems;
|
||||
nsIFrame* mContainerLayerFrame;
|
||||
// The translation set on this ThebesLayer before we started updating the
|
||||
// The translation set on this PaintedLayer before we started updating the
|
||||
// layer tree.
|
||||
nsIntPoint mLastPaintOffset;
|
||||
uint32_t mLastCommonClipCount;
|
||||
@ -612,7 +612,7 @@ public:
|
||||
bool mHasExplicitLastPaintOffset;
|
||||
/**
|
||||
* The first mCommonClipCount rounded rectangle clips are identical for
|
||||
* all items in the layer. Computed in ThebesLayerData.
|
||||
* all items in the layer. Computed in PaintedLayerData.
|
||||
*/
|
||||
uint32_t mCommonClipCount;
|
||||
|
||||
@ -620,22 +620,22 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the ThebesLayerItemsEntry object associated with aLayer in this
|
||||
* Get the PaintedLayerItemsEntry object associated with aLayer in this
|
||||
* FrameLayerBuilder
|
||||
*/
|
||||
ThebesLayerItemsEntry* GetThebesLayerItemsEntry(ThebesLayer* aLayer)
|
||||
PaintedLayerItemsEntry* GetPaintedLayerItemsEntry(PaintedLayer* aLayer)
|
||||
{
|
||||
return mThebesLayerItems.GetEntry(aLayer);
|
||||
return mPaintedLayerItems.GetEntry(aLayer);
|
||||
}
|
||||
|
||||
ThebesLayerData* GetContainingThebesLayerData()
|
||||
PaintedLayerData* GetContainingPaintedLayerData()
|
||||
{
|
||||
return mContainingThebesLayer;
|
||||
return mContainingPaintedLayer;
|
||||
}
|
||||
|
||||
bool IsBuildingRetainedLayers()
|
||||
{
|
||||
return !mContainingThebesLayer && mRetainingManager;
|
||||
return !mContainingPaintedLayer && mRetainingManager;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -657,7 +657,7 @@ protected:
|
||||
static PLDHashOperator RestoreDisplayItemData(nsRefPtrHashKey<DisplayItemData>* aEntry,
|
||||
void *aUserArg);
|
||||
|
||||
static PLDHashOperator RestoreThebesLayerItemEntries(ThebesLayerItemsEntry* aEntry,
|
||||
static PLDHashOperator RestorePaintedLayerItemEntries(PaintedLayerItemsEntry* aEntry,
|
||||
void *aUserArg);
|
||||
|
||||
/**
|
||||
@ -682,16 +682,16 @@ protected:
|
||||
*/
|
||||
nsDisplayListBuilder* mDisplayListBuilder;
|
||||
/**
|
||||
* A map from ThebesLayers to the list of display items (plus
|
||||
* A map from PaintedLayers to the list of display items (plus
|
||||
* clipping data) to be rendered in the layer.
|
||||
*/
|
||||
nsTHashtable<ThebesLayerItemsEntry> mThebesLayerItems;
|
||||
nsTHashtable<PaintedLayerItemsEntry> mPaintedLayerItems;
|
||||
|
||||
/**
|
||||
* When building layers for an inactive layer, this is where the
|
||||
* inactive layer will be placed.
|
||||
*/
|
||||
ThebesLayerData* mContainingThebesLayer;
|
||||
PaintedLayerData* mContainingPaintedLayer;
|
||||
|
||||
/**
|
||||
* Saved generation counter so we can detect DOM changes.
|
||||
|
@ -1237,7 +1237,7 @@ void nsDisplayList::PaintRoot(nsDisplayListBuilder* aBuilder,
|
||||
/**
|
||||
* We paint by executing a layer manager transaction, constructing a
|
||||
* single layer representing the display list, and then making it the
|
||||
* root of the layer manager, drawing into the ThebesLayers.
|
||||
* root of the layer manager, drawing into the PaintedLayers.
|
||||
*/
|
||||
void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx,
|
||||
@ -1385,7 +1385,7 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
MaybeSetupTransactionIdAllocator(layerManager, view);
|
||||
|
||||
layerManager->EndTransaction(FrameLayerBuilder::DrawThebesLayer,
|
||||
layerManager->EndTransaction(FrameLayerBuilder::DrawPaintedLayer,
|
||||
aBuilder, flags);
|
||||
aBuilder->SetIsCompositingCheap(temp);
|
||||
layerBuilder->DidEndTransaction();
|
||||
@ -3222,7 +3222,7 @@ void nsDisplayWrapList::Paint(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
/**
|
||||
* Returns true if all descendant display items can be placed in the same
|
||||
* ThebesLayer --- GetLayerState returns LAYER_INACTIVE or LAYER_NONE,
|
||||
* PaintedLayer --- GetLayerState returns LAYER_INACTIVE or LAYER_NONE,
|
||||
* and they all have the expected animated geometry root.
|
||||
*/
|
||||
static LayerState
|
||||
|
@ -1096,14 +1096,14 @@ public:
|
||||
* Return LAYER_INACTIVE if there is a layer --- BuildLayer will
|
||||
* not return null (unless there's an error) --- but the layer contents
|
||||
* are not changing frequently. In this case it makes sense to composite
|
||||
* the layer into a ThebesLayer with other content, so we don't have to
|
||||
* the layer into a PaintedLayer with other content, so we don't have to
|
||||
* recomposite it every time we paint.
|
||||
* Note: GetLayerState is only allowed to return LAYER_INACTIVE if all
|
||||
* descendant display items returned LAYER_INACTIVE or LAYER_NONE. Also,
|
||||
* all descendant display item frames must have an active scrolled root
|
||||
* that's either the same as this item's frame's active scrolled root, or
|
||||
* a descendant of this item's frame. This ensures that the entire
|
||||
* set of display items can be collapsed onto a single ThebesLayer.
|
||||
* set of display items can be collapsed onto a single PaintedLayer.
|
||||
* Return LAYER_ACTIVE if the layer is active, that is, its contents are
|
||||
* changing frequently. In this case it makes sense to keep the layer
|
||||
* as a separate buffer in VRAM and composite it into the destination
|
||||
@ -1131,7 +1131,7 @@ public:
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
/**
|
||||
* Mark this display item as being painted via FrameLayerBuilder::DrawThebesLayer.
|
||||
* Mark this display item as being painted via FrameLayerBuilder::DrawPaintedLayer.
|
||||
*/
|
||||
bool Painted() { return mPainted; }
|
||||
|
||||
@ -1378,7 +1378,7 @@ class nsDisplayList {
|
||||
public:
|
||||
typedef mozilla::layers::Layer Layer;
|
||||
typedef mozilla::layers::LayerManager LayerManager;
|
||||
typedef mozilla::layers::ThebesLayer ThebesLayer;
|
||||
typedef mozilla::layers::PaintedLayer PaintedLayer;
|
||||
|
||||
/**
|
||||
* Create an empty list.
|
||||
@ -1538,7 +1538,7 @@ public:
|
||||
* been removed from aVisibleRegion when we return.
|
||||
* This does not remove any items from the list, so we can recompute
|
||||
* visiblity with different regions later (see
|
||||
* FrameLayerBuilder::DrawThebesLayer).
|
||||
* FrameLayerBuilder::DrawPaintedLayer).
|
||||
* This method needs to be idempotent.
|
||||
*
|
||||
* @param aVisibleRegion the area that is visible, relative to the
|
||||
@ -2495,14 +2495,14 @@ public:
|
||||
* One of these is created for each stacking context and pseudo-stacking-context.
|
||||
* It accumulates regions for event targets contributed by the border-boxes of
|
||||
* frames in its (pseudo) stacking context. A nsDisplayLayerEventRegions
|
||||
* eventually contributes its regions to the ThebesLayer it is placed in by
|
||||
* eventually contributes its regions to the PaintedLayer it is placed in by
|
||||
* FrameLayerBuilder. (We don't create a display item for every frame that
|
||||
* could be an event target (i.e. almost all frames), because that would be
|
||||
* high overhead.)
|
||||
*
|
||||
* We always make leaf layers other than ThebesLayers transparent to events.
|
||||
* We always make leaf layers other than PaintedLayers transparent to events.
|
||||
* For example, an event targeting a canvas or video will actually target the
|
||||
* background of that element, which is logically in the ThebesLayer behind the
|
||||
* background of that element, which is logically in the PaintedLayer behind the
|
||||
* CanvasFrame or ImageFrame. We only need to create a
|
||||
* nsDisplayLayerEventRegions when an element's background could be in front
|
||||
* of a lower z-order element with its own layer.
|
||||
|
@ -1380,8 +1380,8 @@ public:
|
||||
virtual void SynthesizeMouseMove(bool aFromScroll) = 0;
|
||||
|
||||
enum PaintFlags {
|
||||
/* Update the layer tree and paint ThebesLayers. If this is not specified,
|
||||
* we may still have to do it if the layer tree lost ThebesLayer contents
|
||||
/* Update the layer tree and paint PaintedLayers. If this is not specified,
|
||||
* we may still have to do it if the layer tree lost PaintedLayer contents
|
||||
* we need for compositing. */
|
||||
PAINT_LAYERS = 0x01,
|
||||
/* Composite layers to the window. */
|
||||
|
@ -491,7 +491,7 @@ public:
|
||||
* scrollframes which are actively being scrolled fall into this category.
|
||||
* Frames with certain CSS properties that are being animated (e.g.
|
||||
* 'left'/'top' etc) are also placed in this category.
|
||||
* Frames with different active geometry roots are in different ThebesLayers,
|
||||
* Frames with different active geometry roots are in different PaintedLayers,
|
||||
* so that we can animate the geometry root by changing its transform (either
|
||||
* on the main thread or in the compositor).
|
||||
* The animated geometry root is required to be a descendant (or equal to)
|
||||
|
@ -824,14 +824,14 @@ nsPresContext::GetUserPreferences()
|
||||
}
|
||||
|
||||
void
|
||||
nsPresContext::InvalidateThebesLayers()
|
||||
nsPresContext::InvalidatePaintedLayers()
|
||||
{
|
||||
if (!mShell)
|
||||
return;
|
||||
nsIFrame* rootFrame = mShell->FrameManager()->GetRootFrame();
|
||||
if (rootFrame) {
|
||||
// FrameLayerBuilder caches invalidation-related values that depend on the
|
||||
// appunits-per-dev-pixel ratio, so ensure that all ThebesLayer drawing
|
||||
// appunits-per-dev-pixel ratio, so ensure that all PaintedLayer drawing
|
||||
// is completely flushed.
|
||||
rootFrame->InvalidateFrameSubtree();
|
||||
}
|
||||
@ -840,7 +840,7 @@ nsPresContext::InvalidateThebesLayers()
|
||||
void
|
||||
nsPresContext::AppUnitsPerDevPixelChanged()
|
||||
{
|
||||
InvalidateThebesLayers();
|
||||
InvalidatePaintedLayers();
|
||||
|
||||
if (mDeviceContext) {
|
||||
mDeviceContext->FlushFontCache();
|
||||
@ -937,7 +937,7 @@ nsPresContext::UpdateAfterPreferencesChanged()
|
||||
mShell->SetPreferenceStyleRules(true);
|
||||
}
|
||||
|
||||
InvalidateThebesLayers();
|
||||
InvalidatePaintedLayers();
|
||||
mDeviceContext->FlushFontCache();
|
||||
|
||||
nsChangeHint hint = nsChangeHint(0);
|
||||
|
@ -1161,7 +1161,7 @@ public:
|
||||
#endif
|
||||
|
||||
protected:
|
||||
void InvalidateThebesLayers();
|
||||
void InvalidatePaintedLayers();
|
||||
void AppUnitsPerDevPixelChanged();
|
||||
|
||||
void HandleRebuildUserFontSet() {
|
||||
|
@ -184,7 +184,7 @@ FRAME_STATE_BIT(Generic, 36, NS_FRAME_UPDATE_LAYER_TREE)
|
||||
// Frame can accept absolutely positioned children.
|
||||
FRAME_STATE_BIT(Generic, 37, NS_FRAME_HAS_ABSPOS_CHILDREN)
|
||||
|
||||
// A display item for this frame has been painted as part of a ThebesLayer.
|
||||
// A display item for this frame has been painted as part of a PaintedLayer.
|
||||
FRAME_STATE_BIT(Generic, 38, NS_FRAME_PAINTED_THEBES)
|
||||
|
||||
// Frame is or is a descendant of something with a fixed height, unless that
|
||||
|
@ -2273,7 +2273,7 @@ ClampAndAlignWithPixels(nscoord aDesired,
|
||||
double delta = desiredLayerVal - currentLayerVal;
|
||||
double nearestLayerVal = NS_round(delta) + currentLayerVal;
|
||||
|
||||
// Convert back from ThebesLayer space to appunits relative to the top-left
|
||||
// Convert back from PaintedLayer space to appunits relative to the top-left
|
||||
// of the scrolled frame.
|
||||
nscoord aligned =
|
||||
NSToCoordRoundWithClamp(nearestLayerVal*aAppUnitsPerPixel/aRes);
|
||||
@ -2368,15 +2368,15 @@ ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange, nsIAtom* aOri
|
||||
nsPresContext* presContext = mOuter->PresContext();
|
||||
nscoord appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
|
||||
// 'scale' is our estimate of the scale factor that will be applied
|
||||
// when rendering the scrolled content to its own ThebesLayer.
|
||||
gfxSize scale = FrameLayerBuilder::GetThebesLayerScaleForFrame(mScrolledFrame);
|
||||
// when rendering the scrolled content to its own PaintedLayer.
|
||||
gfxSize scale = FrameLayerBuilder::GetPaintedLayerScaleForFrame(mScrolledFrame);
|
||||
nsPoint curPos = GetScrollPosition();
|
||||
nsPoint alignWithPos = mScrollPosForLayerPixelAlignment == nsPoint(-1,-1)
|
||||
? curPos : mScrollPosForLayerPixelAlignment;
|
||||
// Try to align aPt with curPos so they have an integer number of layer
|
||||
// pixels between them. This gives us the best chance of scrolling without
|
||||
// having to invalidate due to changes in subpixel rendering.
|
||||
// Note that when we actually draw into a ThebesLayer, the coordinates
|
||||
// Note that when we actually draw into a PaintedLayer, the coordinates
|
||||
// that get mapped onto the layer buffer pixels are from the display list,
|
||||
// which are relative to the display root frame's top-left increasing down,
|
||||
// whereas here our coordinates are scroll positions which increase upward
|
||||
|
@ -1027,7 +1027,7 @@ nsDisplayPlugin::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
// security reasons.)
|
||||
// We shouldn't be repainting the content under plugins much anyway
|
||||
// since there generally shouldn't be anything to invalidate or paint
|
||||
// in ThebesLayers there.
|
||||
// in PaintedLayers there.
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) == clipping-5-image.html
|
||||
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) == clipping-5-overflow-hidden.html clipping-5-ref.html
|
||||
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) fuzzy-if(Android,5,21) == clipping-5-refi.html clipping-5-ref.html
|
||||
fuzzy-if(true,1,7) fuzzy-if(cocoaWidget,1,99) fuzzy-if(Android&&browserIsRemote,7,89) fuzzy-if(Android&&!browserIsRemote,99,115) == clipping-5-refc.html clipping-5-ref.html # bug 732535
|
||||
fuzzy-if(winWidget,105,71) fuzzy-if(Android,8,464) == clipping-6.html clipping-6-ref.html # ThebesLayer and MaskLayer with transforms that aren't identical
|
||||
fuzzy-if(winWidget,105,71) fuzzy-if(Android,8,464) == clipping-6.html clipping-6-ref.html # PaintedLayer and MaskLayer with transforms that aren't identical
|
||||
fuzzy-if(true,2,29) fuzzy-if(Android&&AndroidVersion<15,12,81) fuzzy-if(Android&&AndroidVersion>=15,255,586) == clipping-7.html clipping-7-ref.html # ColorLayer and MaskLayer with transforms that aren't identical. Reference image rendered without using layers (which causes fuzzy failures).
|
||||
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) == clipping-and-zindex-1.html clipping-and-zindex-1-ref.html
|
||||
fuzzy-if(cocoaWidget,1,4) == intersecting-clipping-1-canvas.html intersecting-clipping-1-refc.html
|
||||
|
@ -397,7 +397,7 @@ public:
|
||||
gfxContextMatrixAutoSaveRestore autoSR(ctx);
|
||||
ctx->SetMatrix(ctx->CurrentMatrix().Translate(devPixelOffset));
|
||||
|
||||
mLayerManager->EndTransaction(FrameLayerBuilder::DrawThebesLayer, mBuilder);
|
||||
mLayerManager->EndTransaction(FrameLayerBuilder::DrawPaintedLayer, mBuilder);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -541,7 +541,7 @@ nsSVGIntegrationUtils::PaintFramesWithEffects(nsRenderingContext* aCtx,
|
||||
nsFilterInstance::PaintFilteredFrame(aFrame, aCtx, tm, &callback, &dirtyRegion);
|
||||
} else {
|
||||
gfx->SetMatrix(matrixAutoSaveRestore.Matrix());
|
||||
aLayerManager->EndTransaction(FrameLayerBuilder::DrawThebesLayer, aBuilder);
|
||||
aLayerManager->EndTransaction(FrameLayerBuilder::DrawPaintedLayer, aBuilder);
|
||||
gfx->SetMatrix(gfx->CurrentMatrix().Translate(devPixelOffsetToUserSpace));
|
||||
}
|
||||
|
||||
|
@ -389,7 +389,7 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer,
|
||||
}
|
||||
}
|
||||
// Buffer rotation is not to be confused with the angled rotation done by a transform matrix
|
||||
// It's a fancy ThebesLayer feature used for scrolling
|
||||
// It's a fancy PaintedLayer feature used for scrolling
|
||||
if (state.BufferRotated()) {
|
||||
LOGD("%s Layer has a rotated buffer", aLayer->Name());
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user