Bug 1073103 - SReplace 'Thebes' with 'Painted' in some more places. r=roc

This commit is contained in:
Markus Stange 2014-09-26 13:07:06 -04:00
Родитель 7d5a3be591
Коммит 3efef60534
25 изменённых файлов: 129 добавлений и 129 удалений

Просмотреть файл

@ -715,7 +715,7 @@ SenderHelper::SendLayer(LayerComposite* aLayer,
}
case Layer::TYPE_IMAGE:
case Layer::TYPE_CANVAS:
case Layer::TYPE_THEBES: {
case Layer::TYPE_PAINTED: {
// Get CompositableHost and Compositor
CompositableHost* compHost = aLayer->GetCompositableHost();
Compositor* comp = compHost->GetCompositor();

Просмотреть файл

@ -1343,7 +1343,7 @@ Layer::Dump(std::stringstream& aStream, const char* aPrefix, bool aDumpHtml)
if (aDumpHtml) {
aStream << nsPrintfCString("<li><a id=\"%p\" ", this).get();
#ifdef MOZ_DUMP_PAINTING
if (GetType() == TYPE_CONTAINER || GetType() == TYPE_THEBES) {
if (GetType() == TYPE_CONTAINER || GetType() == TYPE_PAINTED) {
WriteSnapshotLinkToDumpFile(this, aStream);
}
#endif

Просмотреть файл

@ -373,7 +373,7 @@ public:
#endif
/**
* Hints that can be used during Thebes layer creation to influence the type
* Hints that can be used during PaintedLayer creation to influence the type
* or properties of the layer created.
*
* NONE: No hint.
@ -738,7 +738,7 @@ public:
TYPE_READBACK,
TYPE_REF,
TYPE_SHADOW,
TYPE_THEBES
TYPE_PAINTED
};
/**
@ -1323,7 +1323,7 @@ public:
virtual void Disconnect() {}
/**
* Dynamic downcast to a Thebes layer. Returns null if this is not
* Dynamic downcast to a PaintedLayer. Returns null if this is not
* a PaintedLayer.
*/
virtual PaintedLayer* AsPaintedLayer() { return nullptr; }
@ -1655,7 +1655,7 @@ protected:
};
/**
* A Layer which we can draw into using Thebes. It is a conceptually
* A Layer which we can paint into. It is a conceptually
* 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.
@ -1695,7 +1695,7 @@ public:
virtual PaintedLayer* AsPaintedLayer() { return this; }
MOZ_LAYER_DECL_NAME("PaintedLayer", TYPE_THEBES)
MOZ_LAYER_DECL_NAME("PaintedLayer", TYPE_PAINTED)
virtual void ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSurface)
{

Просмотреть файл

@ -77,7 +77,7 @@ FindBackgroundLayer(ReadbackLayer* aLayer, nsIntPoint* aOffset)
return nullptr;
Layer::LayerType type = l->GetType();
if (type != Layer::TYPE_COLOR && type != Layer::TYPE_THEBES)
if (type != Layer::TYPE_COLOR && type != Layer::TYPE_PAINTED)
return nullptr;
*aOffset = backgroundOffset - transformOffset;

Просмотреть файл

@ -21,7 +21,7 @@ class SurfaceDescriptor;
* This is the ImplData for all Basic layers. It also exposes methods
* private to the Basic implementation that are common to all Basic layer types.
* In particular, there is an internal Paint() method that we can use
* to paint the contents of non-Thebes layers.
* to paint the contents of non-PaintedLayers.
*
* The class hierarchy for Basic layers is like this:
* BasicImplData

Просмотреть файл

@ -292,7 +292,7 @@ private:
nsIWidget* mWidget;
/* Thebes layer callbacks; valid at the end of a transaciton,
/* PaintedLayer callbacks; valid at the end of a transaciton,
* while rendering */
DrawPaintedLayerCallback mPaintedLayerCallback;
void *mPaintedLayerCallbackData;

Просмотреть файл

@ -167,11 +167,11 @@ ClientLayerManager::CreatePaintedLayerWithHint(PaintedLayerCreationHint aHint)
AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_D3D9 ||
AsShadowForwarder()->GetCompositorBackendType() == LayersBackend::LAYERS_D3D11)) {
nsRefPtr<ClientTiledPaintedLayer> layer = new ClientTiledPaintedLayer(this, aHint);
CREATE_SHADOW(Thebes);
CREATE_SHADOW(Painted);
return layer.forget();
} else {
nsRefPtr<ClientPaintedLayer> layer = new ClientPaintedLayer(this, aHint);
CREATE_SHADOW(Thebes);
CREATE_SHADOW(Painted);
return layer.forget();
}
}

Просмотреть файл

@ -132,7 +132,7 @@ ClientTiledPaintedLayer::BeginPaint()
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_B2G)
// Both Android and b2g are guaranteed to have a displayport set, so this
// should never happen.
NS_WARNING("Tiled Thebes layer with no scrollable container ancestor");
NS_WARNING("Tiled PaintedLayer with no scrollable container ancestor");
#endif
return;
}

Просмотреть файл

@ -26,7 +26,7 @@ class SpecificLayerAttributes;
* is better suited to mobile hardware to work around slow implementation
* of glTexImage2D (for OGL compositors), and restrait memory bandwidth.
*
* Tiled Thebes layers use a different protocol compared with other
* Tiled PaintedLayers use a different protocol compared with other
* layers. A copy of the tiled buffer is made and sent to the compositing
* thread via the layers protocol. Tiles are uploaded by the buffers
* asynchonously without using IPC, that means they are not safe for cross-
@ -51,7 +51,7 @@ public:
// Override name to distinguish it from ClientPaintedLayer in layer dumps
virtual const char* Name() const { return "TiledPaintedLayer"; }
// Thebes Layer
// PaintedLayer
virtual Layer* AsLayer() { return this; }
virtual void InvalidateRegion(const nsIntRegion& aRegion) {
mInvalidRegion.Or(mInvalidRegion, aRegion);

Просмотреть файл

@ -110,7 +110,7 @@ private:
* by this layer forwarder (the matching uses a global map on the compositor side,
* see CompositableMap in ImageBridgeParent.cpp)
*
* Subclasses: Thebes layers use ContentClients, ImageLayers use ImageClients,
* Subclasses: Painted layers use ContentClients, ImageLayers use ImageClients,
* Canvas layers use CanvasClients (but ImageHosts). We have a different subclass
* where we have a different way of interfacing with the textures - in terms of
* drawing into the compositable and/or passing its contents to the compostior.

Просмотреть файл

@ -41,7 +41,7 @@ class BasicLayerManager;
class PaintedLayer;
/**
* A compositable client for Thebes layers. These are different to Image/Canvas
* A compositable client for PaintedLayers. These are different to Image/Canvas
* clients due to sending a valid region across IPC and because we do a lot more
* optimisation work, encapsualted in RotatedContentBuffers.
*

Просмотреть файл

@ -47,7 +47,7 @@ class TextureImageTextureSourceOGL;
struct TexturedEffect;
/**
* ContentHosts are used for compositing Thebes layers, always matched by a
* ContentHosts are used for compositing Painted layers, always matched by a
* ContentClient of the same type.
*
* ContentHosts support only UpdateThebes(), not Update().

Просмотреть файл

@ -24,9 +24,9 @@ namespace mozilla {
namespace layers {
/**
* Thebes layers use ContentHosts for their compsositable host.
* PaintedLayers use ContentHosts for their compsositable host.
* By using different ContentHosts, PaintedLayerComposite support tiled and
* non-tiled Thebes layers and single or double buffering.
* non-tiled PaintedLayers and single or double buffering.
*/
class CompositableHost;
@ -77,7 +77,7 @@ public:
Mutated();
}
MOZ_LAYER_DECL_NAME("PaintedLayerComposite", TYPE_THEBES)
MOZ_LAYER_DECL_NAME("PaintedLayerComposite", TYPE_PAINTED)
protected:

Просмотреть файл

@ -166,7 +166,7 @@ private:
};
/**
* ContentHost for tiled Thebes layers. Since tiled layers are special snow
* ContentHost for tiled PaintedLayers. Since tiled layers are special snow
* flakes, we have a unique update process. All the textures that back the
* tiles are added in the usual way, but Updated is called on the host side
* in response to a message that describes the transaction for every tile.

Просмотреть файл

@ -255,7 +255,7 @@ ContainerLayerD3D10::Validate()
Layer *layer = GetFirstChild();
while (layer) {
if (layer->GetType() == TYPE_THEBES) {
if (layer->GetType() == TYPE_PAINTED) {
static_cast<PaintedLayerD3D10*>(layer)->Validate(&readback);
} else {
static_cast<LayerD3D10*>(layer->ImplData())->Validate();

Просмотреть файл

@ -173,7 +173,7 @@ ContainerLayerD3D9::RenderLayer()
d3drect.bottom = scissorRect.y + scissorRect.height;
device()->SetScissorRect(&d3drect);
if (layerToRender->GetLayer()->GetType() == TYPE_THEBES) {
if (layerToRender->GetLayer()->GetType() == TYPE_PAINTED) {
static_cast<PaintedLayerD3D9*>(layerToRender)->RenderPaintedLayer(&readback);
} else {
layerToRender->RenderLayer();

Просмотреть файл

@ -93,7 +93,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation
const OpPaintTextureRegion& op = aEdit.get_OpPaintTextureRegion();
CompositableHost* compositable = AsCompositable(op);
Layer* layer = compositable->GetLayer();
if (!layer || layer->GetType() != Layer::TYPE_THEBES) {
if (!layer || layer->GetType() != Layer::TYPE_PAINTED) {
return false;
}
PaintedLayerComposite* thebes = static_cast<PaintedLayerComposite*>(layer);

Просмотреть файл

@ -88,7 +88,7 @@ ShadowLayerParent::AsRefLayerComposite() const
PaintedLayerComposite*
ShadowLayerParent::AsPaintedLayerComposite() const
{
return mLayer && mLayer->GetType() == Layer::TYPE_THEBES
return mLayer && mLayer->GetType() == Layer::TYPE_PAINTED
? static_cast<PaintedLayerComposite*>(mLayer.get())
: nullptr;
}

Просмотреть файл

@ -283,9 +283,9 @@ UNIFIED_SOURCES += [
'composite/ImageHost.cpp',
'composite/ImageLayerComposite.cpp',
'composite/LayerManagerComposite.cpp',
'composite/PaintedLayerComposite.cpp',
'composite/TextRenderer.cpp',
'composite/TextureHost.cpp',
'composite/PaintedLayerComposite.cpp',
'composite/TiledContentHost.cpp',
'Compositor.cpp',
'CopyableCanvasLayer.cpp',

Просмотреть файл

@ -94,7 +94,7 @@ message LayersPacket {
optional uint64 mask = 19; // mask layer
// Specific info (100 to max)
// Thebes Layer
// Painted Layer
optional Region valid = 100;
// Color Layer
optional uint32 color = 101;

Просмотреть файл

@ -65,7 +65,7 @@ public:
}
virtual LayerType GetType() const {
return TYPE_THEBES;
return TYPE_PAINTED;
}
virtual void InvalidateRegion(const nsIntRegion& aRegion) {

Просмотреть файл

@ -93,7 +93,7 @@ gfxPlatformGtk::CreateOffscreenSurface(const IntSize& size,
// we should try to match
GdkScreen *gdkScreen = gdk_screen_get_default();
if (gdkScreen) {
// When forcing Thebes Layers to use image surfaces for content,
// When forcing PaintedLayers to use image surfaces for content,
// force creation of gfxImageSurface surfaces.
if (UseXRender() && !UseImageOffscreenSurfaces()) {
Screen *screen = gdk_x11_screen_get_xscreen(gdkScreen);

Просмотреть файл

@ -380,11 +380,11 @@ public:
*/
nsAutoCString mLog;
#define FLB_LOG_THEBES_DECISION(tld, ...) \
#define FLB_LOG_PAINTED_LAYER_DECISION(tld, ...) \
tld->mLog.AppendPrintf("\t\t\t\t"); \
tld->mLog.AppendPrintf(__VA_ARGS__);
#else
#define FLB_LOG_THEBES_DECISION(...)
#define FLB_LOG_PAINTED_LAYER_DECISION(...)
#endif
/**
@ -479,7 +479,7 @@ public:
* image, a clip for SOME item in the layer. There is no guarantee which
* item's clip will be stored here and mItemClip should not be used to clip
* the whole layer - only some part of the clip should be used, as determined
* by ThebesDisplayItemLayerUserData::GetCommonClipCount() - which may even be
* by PaintedDisplayItemLayerUserData::GetCommonClipCount() - which may even be
* no part at all.
*/
DisplayItemClip mItemClip;
@ -709,12 +709,12 @@ protected:
* Grab the next recyclable ColorLayer, or create one if there are no
* more recyclable ColorLayers.
*/
already_AddRefed<ColorLayer> CreateOrRecycleColorLayer(PaintedLayer* aThebes);
already_AddRefed<ColorLayer> CreateOrRecycleColorLayer(PaintedLayer* aPainted);
/**
* Grab the next recyclable ImageLayer, or create one if there are no
* more recyclable ImageLayers.
*/
already_AddRefed<ImageLayer> CreateOrRecycleImageLayer(PaintedLayer* aThebes);
already_AddRefed<ImageLayer> CreateOrRecycleImageLayer(PaintedLayer* aPainted);
/**
* Grab a recyclable ImageLayer for use as a mask layer for aLayer (that is a
* mask layer which has been used for aLayer before), or create one if such
@ -872,7 +872,7 @@ protected:
* The region of PaintedLayers that should be invalidated every time
* we recycle one.
*/
nsIntRegion mInvalidThebesContent;
nsIntRegion mInvalidPaintedContent;
nsAutoTArray<nsAutoPtr<PaintedLayerData>,1> mPaintedLayerDataStack;
/**
* We collect the list of children in here. During ProcessDisplayItems,
@ -894,10 +894,10 @@ protected:
bool mFlattenToSingleLayer;
};
class ThebesDisplayItemLayerUserData : public LayerUserData
class PaintedDisplayItemLayerUserData : public LayerUserData
{
public:
ThebesDisplayItemLayerUserData() :
PaintedDisplayItemLayerUserData() :
mMaskClipCount(0),
mForcedBackgroundColor(NS_RGBA(0,0,0,0)),
mXScale(1.f), mYScale(1.f),
@ -906,7 +906,7 @@ public:
mAnimatedGeometryRootPosition(0, 0) {}
/**
* Record the number of clips in the Thebes layer's mask layer.
* Record the number of clips in the PaintedLayer's mask layer.
* Should not be reset when the layer is recycled since it is used to track
* changes in the use of mask layers.
*/
@ -993,15 +993,15 @@ struct MaskLayerUserData : public LayerUserData
};
/**
* The address of gThebesDisplayItemLayerUserData is used as the user
* The address of gPaintedDisplayItemLayerUserData is used as the user
* data key for PaintedLayers created by FrameLayerBuilder.
* It identifies PaintedLayers used to draw non-layer content, which are
* therefore eligible for recycling. We want display items to be able to
* create their own dedicated PaintedLayers in BuildLayer, if necessary,
* and we wouldn't want to accidentally recycle those.
* The user data is a ThebesDisplayItemLayerUserData.
* The user data is a PaintedDisplayItemLayerUserData.
*/
uint8_t gThebesDisplayItemLayerUserData;
uint8_t gPaintedDisplayItemLayerUserData;
/**
* The address of gColorLayerUserData is used as the user
* data key for ColorLayers created by FrameLayerBuilder.
@ -1036,10 +1036,10 @@ MaskLayerUserData* GetMaskLayerUserData(Layer* aLayer)
return static_cast<MaskLayerUserData*>(aLayer->GetUserData(&gMaskLayerUserData));
}
ThebesDisplayItemLayerUserData* GetThebesDisplayItemLayerUserData(Layer* aLayer)
PaintedDisplayItemLayerUserData* GetPaintedDisplayItemLayerUserData(Layer* aLayer)
{
return static_cast<ThebesDisplayItemLayerUserData*>(
aLayer->GetUserData(&gThebesDisplayItemLayerUserData));
return static_cast<PaintedDisplayItemLayerUserData*>(
aLayer->GetUserData(&gPaintedDisplayItemLayerUserData));
}
/* static */ void
@ -1147,8 +1147,8 @@ InvalidatePostTransformRegion(PaintedLayer* aLayer, const nsRect& aRect,
const DisplayItemClip& aClip,
const nsIntPoint& aTranslation)
{
ThebesDisplayItemLayerUserData* data =
static_cast<ThebesDisplayItemLayerUserData*>(aLayer->GetUserData(&gThebesDisplayItemLayerUserData));
PaintedDisplayItemLayerUserData* data =
static_cast<PaintedDisplayItemLayerUserData*>(aLayer->GetUserData(&gPaintedDisplayItemLayerUserData));
nsRect rect = aClip.ApplyNonRoundedIntersection(aRect);
@ -1160,9 +1160,9 @@ InvalidatePostTransformRegion(PaintedLayer* aLayer, const nsRect& aRect,
static nsIntPoint
GetTranslationForPaintedLayer(PaintedLayer* aLayer)
{
ThebesDisplayItemLayerUserData* data =
static_cast<ThebesDisplayItemLayerUserData*>
(aLayer->GetUserData(&gThebesDisplayItemLayerUserData));
PaintedDisplayItemLayerUserData* data =
static_cast<PaintedDisplayItemLayerUserData*>
(aLayer->GetUserData(&gPaintedDisplayItemLayerUserData));
NS_ASSERTION(data, "Must be a tracked painted layer!");
return data->mTranslation;
@ -1215,14 +1215,14 @@ FrameLayerBuilder::RemoveFrameFromLayerManager(nsIFrame* aFrame,
PaintedLayer* t = data->mLayer->AsPaintedLayer();
if (t) {
ThebesDisplayItemLayerUserData* thebesData =
static_cast<ThebesDisplayItemLayerUserData*>(t->GetUserData(&gThebesDisplayItemLayerUserData));
if (thebesData) {
PaintedDisplayItemLayerUserData* paintedData =
static_cast<PaintedDisplayItemLayerUserData*>(t->GetUserData(&gPaintedDisplayItemLayerUserData));
if (paintedData) {
nsRegion old = data->mGeometry->ComputeInvalidationRegion();
nsIntRegion rgn = old.ScaleToOutsidePixels(thebesData->mXScale, thebesData->mYScale, thebesData->mAppUnitsPerDevPixel);
nsIntRegion rgn = old.ScaleToOutsidePixels(paintedData->mXScale, paintedData->mYScale, paintedData->mAppUnitsPerDevPixel);
rgn.MoveBy(-GetTranslationForPaintedLayer(t));
thebesData->mRegionToInvalidate.Or(thebesData->mRegionToInvalidate, rgn);
thebesData->mRegionToInvalidate.SimplifyOutward(8);
paintedData->mRegionToInvalidate.Or(paintedData->mRegionToInvalidate, rgn);
paintedData->mRegionToInvalidate.SimplifyOutward(8);
}
}
@ -1488,10 +1488,10 @@ FrameLayerBuilder::GetDebugOldLayerFor(nsIFrame* aFrame, uint32_t aDisplayItemKe
}
already_AddRefed<ColorLayer>
ContainerState::CreateOrRecycleColorLayer(PaintedLayer *aThebes)
ContainerState::CreateOrRecycleColorLayer(PaintedLayer *aPainted)
{
ThebesDisplayItemLayerUserData* data =
static_cast<ThebesDisplayItemLayerUserData*>(aThebes->GetUserData(&gThebesDisplayItemLayerUserData));
PaintedDisplayItemLayerUserData* data =
static_cast<PaintedDisplayItemLayerUserData*>(aPainted->GetUserData(&gPaintedDisplayItemLayerUserData));
nsRefPtr<ColorLayer> layer = data->mColorLayer;
if (layer) {
layer->SetMaskLayer(nullptr);
@ -1501,7 +1501,7 @@ ContainerState::CreateOrRecycleColorLayer(PaintedLayer *aThebes)
layer = mManager->CreateColorLayer();
if (!layer)
return nullptr;
// Mark this layer as being used for Thebes-painting display items
// Mark this layer as being used for painting display items
data->mColorLayer = layer;
layer->SetUserData(&gColorLayerUserData, nullptr);
@ -1512,10 +1512,10 @@ ContainerState::CreateOrRecycleColorLayer(PaintedLayer *aThebes)
}
already_AddRefed<ImageLayer>
ContainerState::CreateOrRecycleImageLayer(PaintedLayer *aThebes)
ContainerState::CreateOrRecycleImageLayer(PaintedLayer *aPainted)
{
ThebesDisplayItemLayerUserData* data =
static_cast<ThebesDisplayItemLayerUserData*>(aThebes->GetUserData(&gThebesDisplayItemLayerUserData));
PaintedDisplayItemLayerUserData* data =
static_cast<PaintedDisplayItemLayerUserData*>(aPainted->GetUserData(&gPaintedDisplayItemLayerUserData));
nsRefPtr<ImageLayer> layer = data->mImageLayer;
if (layer) {
layer->SetMaskLayer(nullptr);
@ -1525,7 +1525,7 @@ ContainerState::CreateOrRecycleImageLayer(PaintedLayer *aThebes)
layer = mManager->CreateImageLayer();
if (!layer)
return nullptr;
// Mark this layer as being used for Thebes-painting display items
// Mark this layer as being used for painting display items
data->mImageLayer = layer;
layer->SetUserData(&gImageLayerUserData, nullptr);
@ -1613,7 +1613,7 @@ ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoo
{
// We need a new painted layer
nsRefPtr<PaintedLayer> layer;
ThebesDisplayItemLayerUserData* data;
PaintedDisplayItemLayerUserData* data;
bool layerRecycled = false;
#ifndef MOZ_WIDGET_ANDROID
bool didResetScrollPositionForLayerPixelAlignment = false;
@ -1646,8 +1646,8 @@ ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoo
layer->SetMaskLayer(nullptr);
layer->ClearExtraDumpInfo();
data = static_cast<ThebesDisplayItemLayerUserData*>
(layer->GetUserData(&gThebesDisplayItemLayerUserData));
data = static_cast<PaintedDisplayItemLayerUserData*>
(layer->GetUserData(&gPaintedDisplayItemLayerUserData));
NS_ASSERTION(data, "Recycled PaintedLayers must have user data");
// This gets called on recycled PaintedLayers that are going to be in the
@ -1656,7 +1656,7 @@ ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoo
// to, or if we need to invalidate the entire layer, we can do that.
// This needs to be done before we update the PaintedLayer to its new
// transform. See nsGfxScrollFrame::InvalidateInternal, where
// we ensure that mInvalidThebesContent is updated according to the
// we ensure that mInvalidPaintedContent is updated according to the
// scroll position as of the most recent paint.
if (!FuzzyEqual(data->mXScale, mParameters.mXScale, 0.00001f) ||
!FuzzyEqual(data->mYScale, mParameters.mYScale, 0.00001f) ||
@ -1699,9 +1699,9 @@ ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoo
layer = mManager->CreatePaintedLayerWithHint(creationHint);
if (!layer)
return nullptr;
// Mark this layer as being used for Thebes-painting display items
data = new ThebesDisplayItemLayerUserData();
layer->SetUserData(&gThebesDisplayItemLayerUserData, data);
// Mark this layer as being used for painting display items
data = new PaintedDisplayItemLayerUserData();
layer->SetUserData(&gPaintedDisplayItemLayerUserData, data);
ResetScrollPositionForLayerPixelAlignment(aAnimatedGeometryRoot);
#ifndef MOZ_WIDGET_ANDROID
didResetScrollPositionForLayerPixelAlignment = true;
@ -1716,7 +1716,7 @@ ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoo
mLayerBuilder->SavePreviousDataForLayer(layer, data->mMaskClipCount);
// Set up transform so that 0,0 in the Thebes layer corresponds to the
// Set up transform so that 0,0 in the Painted layer corresponds to the
// (pixel-snapped) top-left of the aAnimatedGeometryRoot.
nsPoint offset = aAnimatedGeometryRoot->GetOffsetToCrossDoc(aReferenceFrame);
nscoord appUnitsPerDevPixel = aAnimatedGeometryRoot->PresContext()->AppUnitsPerDevPixel();
@ -1835,7 +1835,7 @@ ContainerState::FindOpaqueBackgroundColorFor(int32_t aPaintedLayerIndex)
for (int32_t i = aPaintedLayerIndex - 1; i >= 0; --i) {
PaintedLayerData* candidate = mPaintedLayerDataStack[i];
if (candidate->IntersectsVisibleAboveRegion(target->mVisibleRegion)) {
// Some non-Thebes content between target and candidate; this is
// Some non-PaintedLayer content between target and candidate; this is
// hopeless
break;
}
@ -2093,8 +2093,8 @@ ContainerState::PopPaintedLayerData()
nsRefPtr<Layer> layer;
nsRefPtr<ImageContainer> imageContainer = data->CanOptimizeImageLayer(mBuilder);
FLB_LOG_THEBES_DECISION(data, "Selecting layer for tld=%p\n", data);
FLB_LOG_THEBES_DECISION(data, " Solid=%i, hasImage=%i, canOptimizeAwayThebes=%i\n",
FLB_LOG_PAINTED_LAYER_DECISION(data, "Selecting layer for tld=%p\n", data);
FLB_LOG_PAINTED_LAYER_DECISION(data, " Solid=%i, hasImage=%i, canOptimizeAwayPaintedLayer=%i\n",
data->mIsSolidColorInVisibleRegion, !!imageContainer,
CanOptimizeAwayPaintedLayer(data, mLayerBuilder));
@ -2118,7 +2118,7 @@ ContainerState::PopPaintedLayerData()
layer = imageLayer;
mLayerBuilder->StoreOptimizedLayerForFrame(data->mImage,
imageLayer);
FLB_LOG_THEBES_DECISION(data, " Selected image layer=%p\n", layer.get());
FLB_LOG_PAINTED_LAYER_DECISION(data, " Selected image layer=%p\n", layer.get());
} else {
nsRefPtr<ColorLayer> colorLayer = CreateOrRecycleColorLayer(data->mLayer);
colorLayer->SetColor(data->mSolidColor);
@ -2132,13 +2132,13 @@ ContainerState::PopPaintedLayerData()
colorLayer->SetBounds(visibleRect);
layer = colorLayer;
FLB_LOG_THEBES_DECISION(data, " Selected color layer=%p\n", layer.get());
FLB_LOG_PAINTED_LAYER_DECISION(data, " Selected color layer=%p\n", layer.get());
}
NS_ASSERTION(FindIndexOfLayerIn(mNewChildLayers, layer) < 0,
"Layer already in list???");
NS_ASSERTION(newLayerEntry->mLayer == data->mLayer,
"Thebes layer at wrong index");
"Painted layer at wrong index");
// Store optimized layer in reserved slot
newLayerEntry = &mNewChildLayers[data->mNewChildLayersIndex + 1];
NS_ASSERTION(!newLayerEntry->mLayer, "Slot already occupied?");
@ -2157,7 +2157,7 @@ ContainerState::PopPaintedLayerData()
layer = data->mLayer;
imageContainer = nullptr;
layer->SetClipRect(nullptr);
FLB_LOG_THEBES_DECISION(data, " Selected painted layer=%p\n", layer.get());
FLB_LOG_PAINTED_LAYER_DECISION(data, " Selected painted layer=%p\n", layer.get());
}
if (mLayerBuilder->IsBuildingRetainedLayers()) {
@ -2193,8 +2193,8 @@ ContainerState::PopPaintedLayerData()
}
// Store the background color
ThebesDisplayItemLayerUserData* userData =
GetThebesDisplayItemLayerUserData(data->mLayer);
PaintedDisplayItemLayerUserData* userData =
GetPaintedDisplayItemLayerUserData(data->mLayer);
NS_ASSERTION(userData, "where did our user data go?");
if (userData->mForcedBackgroundColor != backgroundColor) {
// Invalidate the entire target PaintedLayer since we're changing
@ -2331,7 +2331,7 @@ PaintedLayerData::Accumulate(ContainerState* aState,
const nsIntRect& aDrawRect,
const DisplayItemClip& aClip)
{
FLB_LOG_THEBES_DECISION(this, "Accumulating dp=%s(%p), f=%p against tld=%p\n", aItem->Name(), aItem, aItem->Frame(), this);
FLB_LOG_PAINTED_LAYER_DECISION(this, "Accumulating dp=%s(%p), f=%p against tld=%p\n", aItem->Name(), aItem, aItem->Frame(), this);
bool snap;
nsRect itemBounds = aItem->GetBounds(aState->mBuilder, &snap);
@ -2371,9 +2371,9 @@ PaintedLayerData::Accumulate(ContainerState* aState,
aClippedOpaqueRegion.Contains(mVisibleRegion) &&
aItem->SupportsOptimizingToImage()) {
mImage = static_cast<nsDisplayImageContainer*>(aItem);
FLB_LOG_THEBES_DECISION(this, " Tracking image: nsDisplayImageContainer covers the layer\n");
FLB_LOG_PAINTED_LAYER_DECISION(this, " Tracking image: nsDisplayImageContainer covers the layer\n");
} else if (mImage) {
FLB_LOG_THEBES_DECISION(this, " No longer tracking image\n");
FLB_LOG_PAINTED_LAYER_DECISION(this, " No longer tracking image\n");
mImage = nullptr;
}
@ -2392,7 +2392,7 @@ PaintedLayerData::Accumulate(ContainerState* aState,
nsRect bounds = aItem->GetBounds(aState->mBuilder, &snap);
if (!aState->ScaleToInsidePixels(bounds, snap).Contains(aVisibleRect)) {
isUniform = false;
FLB_LOG_THEBES_DECISION(this, " Display item does not cover the visible rect\n");
FLB_LOG_PAINTED_LAYER_DECISION(this, " Display item does not cover the visible rect\n");
}
}
if (isUniform) {
@ -2406,11 +2406,11 @@ PaintedLayerData::Accumulate(ContainerState* aState,
// we can just blend the colors together
mSolidColor = NS_ComposeColors(mSolidColor, uniformColor);
} else {
FLB_LOG_THEBES_DECISION(this, " Layer not a solid color: Can't blend colors togethers\n");
FLB_LOG_PAINTED_LAYER_DECISION(this, " Layer not a solid color: Can't blend colors togethers\n");
mIsSolidColorInVisibleRegion = false;
}
} else {
FLB_LOG_THEBES_DECISION(this, " Layer is not a solid color: Display item is not uniform over the visible bound\n");
FLB_LOG_PAINTED_LAYER_DECISION(this, " Layer is not a solid color: Display item is not uniform over the visible bound\n");
mIsSolidColorInVisibleRegion = false;
}
@ -2725,7 +2725,7 @@ ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem,
* For each item we compute the effective clip rect. Each item is assigned
* to a layer. We invalidate the areas in PaintedLayers where an item
* has moved from one PaintedLayer to another. Also,
* aState->mInvalidThebesContent is invalidated in every PaintedLayer.
* aState->mInvalidPaintedContent is invalidated in every PaintedLayer.
* We set the clip rect for items that generated their own layer, and
* create a mask layer to do any rounded rect clipping.
* (PaintedLayers don't need a clip rect on the layer, we clip the items
@ -2894,7 +2894,7 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
}
NS_ASSERTION(!ownLayer->AsPaintedLayer(),
"Should never have created a dedicated Thebes layer!");
"Should never have created a dedicated Painted layer!");
const nsIFrame* fixedPosFrame =
FindFixedPosFrameForLayerData(animatedGeometryRoot, shouldFixToViewport);
@ -3040,7 +3040,7 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
InvalidateForLayerChange(item, paintedLayerData->mLayer);
mLayerBuilder->AddThebesDisplayItem(paintedLayerData, item, itemClip, itemVisibleRect,
mLayerBuilder->AddPaintedDisplayItem(paintedLayerData, item, itemClip, itemVisibleRect,
*this, layerState, topLeft);
nsIntRegion opaquePixels = ComputeOpaqueRect(item,
animatedGeometryRoot, paintedLayerData->mFixedPosFrameForLayerData,
@ -3108,8 +3108,8 @@ FrameLayerBuilder::ComputeGeometryChangeForItem(DisplayItemData* aData)
nsAutoPtr<nsDisplayItemGeometry> geometry(item->AllocateGeometry(mDisplayListBuilder));
ThebesDisplayItemLayerUserData* layerData =
static_cast<ThebesDisplayItemLayerUserData*>(aData->mLayer->GetUserData(&gThebesDisplayItemLayerUserData));
PaintedDisplayItemLayerUserData* layerData =
static_cast<PaintedDisplayItemLayerUserData*>(aData->mLayer->GetUserData(&gPaintedDisplayItemLayerUserData));
nsPoint shift = layerData->mAnimatedGeometryRootOrigin - layerData->mLastAnimatedGeometryRootOrigin;
const DisplayItemClip& clip = item->GetClip();
@ -3122,7 +3122,7 @@ FrameLayerBuilder::ComputeGeometryChangeForItem(DisplayItemData* aData)
bool notifyRenderingChanged = true;
if (!aData->mGeometry) {
// This item is being added for the first time, invalidate its entire area.
//TODO: We call GetGeometry again in AddThebesDisplayItem, we should reuse this.
//TODO: We call GetGeometry again in AddPaintedDisplayItem, we should reuse this.
combined = clip.ApplyNonRoundedIntersection(geometry->ComputeInvalidationRegion());
#ifdef MOZ_DUMP_PAINTING
if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
@ -3199,7 +3199,7 @@ FrameLayerBuilder::ComputeGeometryChangeForItem(DisplayItemData* aData)
}
void
FrameLayerBuilder::AddThebesDisplayItem(PaintedLayerData* aLayerData,
FrameLayerBuilder::AddPaintedDisplayItem(PaintedLayerData* aLayerData,
nsDisplayItem* aItem,
const DisplayItemClip& aClip,
const nsIntRect& aItemVisibleRect,
@ -3208,9 +3208,9 @@ FrameLayerBuilder::AddThebesDisplayItem(PaintedLayerData* aLayerData,
const nsPoint& aTopLeft)
{
PaintedLayer* layer = aLayerData->mLayer;
ThebesDisplayItemLayerUserData* thebesData =
static_cast<ThebesDisplayItemLayerUserData*>
(layer->GetUserData(&gThebesDisplayItemLayerUserData));
PaintedDisplayItemLayerUserData* paintedData =
static_cast<PaintedDisplayItemLayerUserData*>
(layer->GetUserData(&gPaintedDisplayItemLayerUserData));
nsRefPtr<BasicLayerManager> tempManager;
nsIntRect intClip;
bool hasClip = false;
@ -3228,13 +3228,13 @@ FrameLayerBuilder::AddThebesDisplayItem(PaintedLayerData* aLayerData,
DisplayItemClip* oldClip = nullptr;
GetOldLayerFor(aItem, nullptr, &oldClip);
hasClip = aClip.ComputeRegionInClips(oldClip,
aTopLeft - thebesData->mLastAnimatedGeometryRootOrigin,
aTopLeft - paintedData->mLastAnimatedGeometryRootOrigin,
&clip);
if (hasClip) {
intClip = clip.GetBounds().ScaleToOutsidePixels(thebesData->mXScale,
thebesData->mYScale,
thebesData->mAppUnitsPerDevPixel);
intClip = clip.GetBounds().ScaleToOutsidePixels(paintedData->mXScale,
paintedData->mYScale,
paintedData->mAppUnitsPerDevPixel);
}
}
@ -3269,7 +3269,7 @@ FrameLayerBuilder::AddThebesDisplayItem(PaintedLayerData* aLayerData,
bool snap;
nsRect visibleRect =
aItem->GetVisibleRect().Intersect(aItem->GetBounds(mDisplayListBuilder, &snap));
nsIntRegion rgn = visibleRect.ToOutsidePixels(thebesData->mAppUnitsPerDevPixel);
nsIntRegion rgn = visibleRect.ToOutsidePixels(paintedData->mAppUnitsPerDevPixel);
SetOuterVisibleRegion(tmpLayer, &rgn);
// If BuildLayer didn't call BuildContainerLayerFor, then our new layer won't have been
@ -3303,7 +3303,7 @@ FrameLayerBuilder::AddThebesDisplayItem(PaintedLayerData* aLayerData,
printf_stderr("Inactive LayerManager(%p) for display item %s(%p) has an invalid region - invalidating layer %p\n", tempManager.get(), aItem->Name(), aItem->Frame(), layer);
}
#endif
invalid.ScaleRoundOut(thebesData->mXScale, thebesData->mYScale);
invalid.ScaleRoundOut(paintedData->mXScale, paintedData->mYScale);
if (hasClip) {
invalid.And(invalid, intClip);
@ -3437,7 +3437,7 @@ ContainerState::CollectOldLayers()
layer = layer->GetNextSibling()) {
NS_ASSERTION(!layer->HasUserData(&gMaskLayerUserData),
"Mask layer in layer tree; could not be recycled.");
if (layer->HasUserData(&gThebesDisplayItemLayerUserData)) {
if (layer->HasUserData(&gPaintedDisplayItemLayerUserData)) {
NS_ASSERTION(layer->AsPaintedLayer(), "Wrong layer type");
mRecycledPaintedLayers.AppendElement(static_cast<PaintedLayer*>(layer));
}
@ -3921,7 +3921,7 @@ FrameLayerBuilder::BuildContainerLayerFor(nsDisplayListBuilder* aBuilder,
if (oldLayer) {
NS_ASSERTION(oldLayer->Manager() == aManager, "Wrong manager");
if (oldLayer->HasUserData(&gThebesDisplayItemLayerUserData)) {
if (oldLayer->HasUserData(&gPaintedDisplayItemLayerUserData)) {
// The old layer for this item is actually our PaintedLayer
// because we rendered its layer into that PaintedLayer. So we
// don't actually have a retained container layer.
@ -4067,7 +4067,7 @@ FrameLayerBuilder::GetLeafLayerFor(nsDisplayListBuilder* aBuilder,
Layer* layer = GetOldLayerFor(aItem);
if (!layer)
return nullptr;
if (layer->HasUserData(&gThebesDisplayItemLayerUserData)) {
if (layer->HasUserData(&gPaintedDisplayItemLayerUserData)) {
// This layer was created to render Thebes-rendered content for this
// display item. The display item should not use it for its own
// layer rendering.
@ -4123,7 +4123,7 @@ FrameLayerBuilder::GetDedicatedLayer(nsIFrame* aFrame, uint32_t aDisplayItemKey)
Layer* layer = element->mLayer;
if (!layer->HasUserData(&gColorLayerUserData) &&
!layer->HasUserData(&gImageLayerUserData) &&
!layer->HasUserData(&gThebesDisplayItemLayerUserData)) {
!layer->HasUserData(&gPaintedDisplayItemLayerUserData)) {
return layer;
}
}
@ -4177,9 +4177,9 @@ FrameLayerBuilder::GetPaintedLayerScaleForFrame(nsIFrame* aFrame)
continue;
}
for (Layer* l = container->GetFirstChild(); l; l = l->GetNextSibling()) {
ThebesDisplayItemLayerUserData* data =
static_cast<ThebesDisplayItemLayerUserData*>
(l->GetUserData(&gThebesDisplayItemLayerUserData));
PaintedDisplayItemLayerUserData* data =
static_cast<PaintedDisplayItemLayerUserData*>
(l->GetUserData(&gPaintedDisplayItemLayerUserData));
if (data) {
return PredictScaleForContent(aFrame, f, gfxSize(data->mXScale, data->mYScale));
}
@ -4444,9 +4444,9 @@ FrameLayerBuilder::DrawPaintedLayer(PaintedLayer* aLayer,
}
ThebesDisplayItemLayerUserData* userData =
static_cast<ThebesDisplayItemLayerUserData*>
(aLayer->GetUserData(&gThebesDisplayItemLayerUserData));
PaintedDisplayItemLayerUserData* userData =
static_cast<PaintedDisplayItemLayerUserData*>
(aLayer->GetUserData(&gPaintedDisplayItemLayerUserData));
NS_ASSERTION(userData, "where did our user data go?");
bool shouldDrawRectsSeparately = ShouldDrawRectsSeparately(aContext, aClip);
@ -4578,11 +4578,11 @@ CalculateBounds(const nsTArray<DisplayItemClip::RoundedRect>& aRects, int32_t A2
}
static void
SetClipCount(ThebesDisplayItemLayerUserData* aThebesData,
SetClipCount(PaintedDisplayItemLayerUserData* apaintedData,
uint32_t aClipCount)
{
if (aThebesData) {
aThebesData->mMaskClipCount = aClipCount;
if (apaintedData) {
apaintedData->mMaskClipCount = aClipCount;
}
}
@ -4595,11 +4595,11 @@ ContainerState::SetupMaskLayer(Layer *aLayer,
// if the number of clips we are going to mask has decreased, then aLayer might have
// cached graphics which assume the existence of a soon-to-be non-existent mask layer
// in that case, invalidate the whole layer.
ThebesDisplayItemLayerUserData* thebesData = GetThebesDisplayItemLayerUserData(aLayer);
if (thebesData &&
aRoundedRectClipCount < thebesData->mMaskClipCount) {
PaintedLayer* thebes = aLayer->AsPaintedLayer();
thebes->InvalidateRegion(thebes->GetValidRegion().GetBounds());
PaintedDisplayItemLayerUserData* paintedData = GetPaintedDisplayItemLayerUserData(aLayer);
if (paintedData &&
aRoundedRectClipCount < paintedData->mMaskClipCount) {
PaintedLayer* painted = aLayer->AsPaintedLayer();
painted->InvalidateRegion(painted->GetValidRegion().GetBounds());
}
// don't build an unnecessary mask
@ -4607,7 +4607,7 @@ ContainerState::SetupMaskLayer(Layer *aLayer,
if (aClip.GetRoundedRectCount() == 0 ||
aRoundedRectClipCount == 0 ||
layerBounds.IsEmpty()) {
SetClipCount(thebesData, 0);
SetClipCount(paintedData, 0);
return;
}
@ -4624,7 +4624,7 @@ ContainerState::SetupMaskLayer(Layer *aLayer,
if (*userData == newData) {
aLayer->SetMaskLayer(maskLayer);
SetClipCount(thebesData, aRoundedRectClipCount);
SetClipCount(paintedData, aRoundedRectClipCount);
return;
}
@ -4678,7 +4678,7 @@ ContainerState::SetupMaskLayer(Layer *aLayer,
// fail if we can't get the right surface
if (!dt) {
NS_WARNING("Could not create DrawTarget for mask layer.");
SetClipCount(thebesData, 0);
SetClipCount(paintedData, 0);
return;
}
@ -4725,7 +4725,7 @@ ContainerState::SetupMaskLayer(Layer *aLayer,
userData->mImageKey = lookupKey;
aLayer->SetMaskLayer(maskLayer);
SetClipCount(thebesData, aRoundedRectClipCount);
SetClipCount(paintedData, aRoundedRectClipCount);
return;
}

Просмотреть файл

@ -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 PaintedLayers so that 0,0 in the Thebes layer
* FrameLayerBuilder sets up PaintedLayers so that 0,0 in the Painted 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.
@ -249,7 +249,7 @@ public:
static void InvalidateAllLayersForFrame(nsIFrame *aFrame);
/**
* Call this to determine if a frame has a dedicated (non-Thebes) layer
* Call this to determine if a frame has a dedicated (non-Painted) layer
* for the given display item key. If there isn't one, we return null,
* otherwise we return the layer.
*/
@ -304,7 +304,7 @@ public:
* aItem must have an underlying frame.
* @param aTopLeft offset from active scrolled root to reference frame
*/
void AddThebesDisplayItem(PaintedLayerData* aLayer,
void AddPaintedDisplayItem(PaintedLayerData* aLayer,
nsDisplayItem* aItem,
const DisplayItemClip& aClip,
const nsIntRect& aItemVisibleRect,

Просмотреть файл

@ -364,7 +364,7 @@ nsPluginFrame::PrepForDrawing(nsIWidget *aWidget)
#ifdef XP_MACOSX
// On Mac, we need to invalidate ourselves since even windowed
// plugins are painted through Thebes and we need to ensure
// the Thebes layer containing the plugin is updated.
// the PaintedLayer containing the plugin is updated.
if (parentWidget == GetNearestWidget()) {
InvalidateFrame();
}