mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backout a17b6115cdd7 for causing reftest failures
This commit is contained in:
parent
386a36b37f
commit
28c11b7893
@ -1563,19 +1563,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SetBounds(const nsIntRect& aBounds)
|
||||
{
|
||||
if (!mBounds.IsEqualEdges(aBounds)) {
|
||||
mBounds = aBounds;
|
||||
Mutated();
|
||||
}
|
||||
}
|
||||
|
||||
const nsIntRect& GetBounds()
|
||||
{
|
||||
return mBounds;
|
||||
}
|
||||
|
||||
// This getter can be used anytime.
|
||||
virtual const gfxRGBA& GetColor() { return mColor; }
|
||||
|
||||
@ -1596,7 +1583,6 @@ protected:
|
||||
|
||||
virtual nsACString& PrintInfo(nsACString& aTo, const char* aPrefix);
|
||||
|
||||
nsIntRect mBounds;
|
||||
gfxRGBA mColor;
|
||||
};
|
||||
|
||||
|
@ -34,18 +34,14 @@ public:
|
||||
{
|
||||
if (IsHidden())
|
||||
return;
|
||||
gfxContextAutoSaveRestore contextSR(aContext);
|
||||
AutoSetOperator setOperator(aContext, GetOperator());
|
||||
|
||||
aContext->SetColor(mColor);
|
||||
|
||||
nsIntRect bounds = GetBounds();
|
||||
aContext->NewPath();
|
||||
aContext->Rectangle(gfxRect(bounds.x, bounds.y, bounds.width, bounds.height));
|
||||
|
||||
FillWithMask(aContext, GetEffectiveOpacity(), aMaskLayer);
|
||||
PaintColorTo(mColor, GetEffectiveOpacity(), aContext, aMaskLayer);
|
||||
}
|
||||
|
||||
static void PaintColorTo(gfxRGBA aColor, float aOpacity,
|
||||
gfxContext* aContext,
|
||||
Layer* aMaskLayer);
|
||||
|
||||
protected:
|
||||
BasicLayerManager* BasicManager()
|
||||
{
|
||||
@ -53,6 +49,15 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
/*static*/ void
|
||||
BasicColorLayer::PaintColorTo(gfxRGBA aColor, float aOpacity,
|
||||
gfxContext* aContext,
|
||||
Layer* aMaskLayer)
|
||||
{
|
||||
aContext->SetColor(aColor);
|
||||
PaintWithMask(aContext, aOpacity, aMaskLayer);
|
||||
}
|
||||
|
||||
already_AddRefed<ColorLayer>
|
||||
BasicLayerManager::CreateColorLayer()
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
|
||||
virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
|
||||
{
|
||||
aAttrs = ColorLayerAttributes(GetColor(), GetBounds());
|
||||
aAttrs = ColorLayerAttributes(GetColor());
|
||||
}
|
||||
|
||||
virtual Layer* AsLayer() { return this; }
|
||||
|
@ -20,12 +20,12 @@ ColorLayerComposite::RenderLayer(const nsIntPoint& aOffset,
|
||||
color.g,
|
||||
color.b,
|
||||
color.a));
|
||||
nsIntRect boundRect = GetBounds();
|
||||
nsIntRect visibleRect = GetEffectiveVisibleRegion().GetBounds();
|
||||
|
||||
LayerManagerComposite::AddMaskEffect(GetMaskLayer(), effects);
|
||||
|
||||
gfx::Rect rect(boundRect.x, boundRect.y,
|
||||
boundRect.width, boundRect.height);
|
||||
gfx::Rect rect(visibleRect.x, visibleRect.y,
|
||||
visibleRect.width, visibleRect.height);
|
||||
gfx::Rect clipRect(aClipRect.x, aClipRect.y,
|
||||
aClipRect.width, aClipRect.height);
|
||||
|
||||
|
@ -42,18 +42,21 @@ ColorLayerD3D10::RenderLayer()
|
||||
|
||||
ID3D10EffectTechnique *technique = SelectShader(SHADER_SOLID | LoadMaskTexture());
|
||||
|
||||
nsIntRect bounds = GetBounds();
|
||||
nsIntRegionRectIterator iter(mVisibleRegion);
|
||||
|
||||
effect()->GetVariableByName("vLayerQuad")->AsVector()->SetFloatVector(
|
||||
ShaderConstantRectD3D10(
|
||||
(float)bounds.x,
|
||||
(float)bounds.y,
|
||||
(float)bounds.width,
|
||||
(float)bounds.height)
|
||||
);
|
||||
const nsIntRect *iterRect;
|
||||
while ((iterRect = iter.Next())) {
|
||||
effect()->GetVariableByName("vLayerQuad")->AsVector()->SetFloatVector(
|
||||
ShaderConstantRectD3D10(
|
||||
(float)iterRect->x,
|
||||
(float)iterRect->y,
|
||||
(float)iterRect->width,
|
||||
(float)iterRect->height)
|
||||
);
|
||||
|
||||
technique->GetPassByIndex(0)->Apply(0);
|
||||
device()->Draw(4, 0);
|
||||
technique->GetPassByIndex(0)->Apply(0);
|
||||
device()->Draw(4, 0);
|
||||
}
|
||||
}
|
||||
|
||||
} /* layers */
|
||||
|
@ -23,14 +23,14 @@ RenderColorLayerD3D9(ColorLayer* aLayer, LayerManagerD3D9 *aManager)
|
||||
return;
|
||||
}
|
||||
|
||||
nsIntRect bounds = aLayer->GetBounds();
|
||||
nsIntRect visibleRect = aLayer->GetEffectiveVisibleRegion().GetBounds();
|
||||
|
||||
aManager->device()->SetVertexShaderConstantF(
|
||||
CBvLayerQuad,
|
||||
ShaderConstantRect(bounds.x,
|
||||
bounds.y,
|
||||
bounds.width,
|
||||
bounds.height),
|
||||
ShaderConstantRect(visibleRect.x,
|
||||
visibleRect.y,
|
||||
visibleRect.width,
|
||||
visibleRect.height),
|
||||
1);
|
||||
|
||||
const gfx3DMatrix& transform = aLayer->GetEffectiveTransform();
|
||||
|
@ -203,7 +203,7 @@ struct ContainerLayerAttributes {
|
||||
float inheritedXScale;
|
||||
float inheritedYScale;
|
||||
};
|
||||
struct ColorLayerAttributes { LayerColor color; nsIntRect bounds; };
|
||||
struct ColorLayerAttributes { LayerColor color; };
|
||||
struct CanvasLayerAttributes { GraphicsFilterType filter; nsIntRect bounds; };
|
||||
struct RefLayerAttributes { int64_t id; };
|
||||
struct ImageLayerAttributes { GraphicsFilterType filter; gfxIntSize scaleToSize; ScaleMode scaleMode; };
|
||||
|
@ -299,8 +299,6 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
|
||||
static_cast<ColorLayer*>(layer)->SetColor(
|
||||
specific.get_ColorLayerAttributes().color().value());
|
||||
static_cast<ColorLayer*>(layer)->SetBounds(
|
||||
specific.get_ColorLayerAttributes().bounds());
|
||||
break;
|
||||
|
||||
case Specific::TCanvasLayerAttributes:
|
||||
|
@ -20,6 +20,8 @@ RenderColorLayer(ColorLayer* aLayer, LayerManagerOGL *aManager,
|
||||
|
||||
// XXX we might be able to improve performance by using glClear
|
||||
|
||||
nsIntRect visibleRect = aLayer->GetEffectiveVisibleRegion().GetBounds();
|
||||
|
||||
/* Multiply color by the layer opacity, as the shader
|
||||
* ignores layer opacity and expects a final color to
|
||||
* write to the color buffer. This saves a needless
|
||||
@ -35,7 +37,7 @@ RenderColorLayer(ColorLayer* aLayer, LayerManagerOGL *aManager,
|
||||
ShaderProgramOGL *program = aManager->GetProgram(ColorLayerProgramType,
|
||||
aLayer->GetMaskLayer());
|
||||
program->Activate();
|
||||
program->SetLayerQuadRect(aLayer->GetBounds());
|
||||
program->SetLayerQuadRect(visibleRect);
|
||||
program->SetLayerTransform(aLayer->GetEffectiveTransform());
|
||||
program->SetRenderOffset(aOffset);
|
||||
program->SetRenderColor(color);
|
||||
|
@ -1579,9 +1579,15 @@ ContainerState::PopThebesLayerData()
|
||||
colorLayer->SetBaseTransform(data->mLayer->GetBaseTransform());
|
||||
colorLayer->SetPostScale(data->mLayer->GetPostXScale(), data->mLayer->GetPostYScale());
|
||||
|
||||
// Clip colorLayer to its visible region, since ColorLayers are
|
||||
// allowed to paint outside the visible region. Here we rely on the
|
||||
// fact that uniform display items fill rectangles; obviously the
|
||||
// area to fill must contain the visible region, and because it's
|
||||
// a rectangle, it must therefore contain the visible region's GetBounds.
|
||||
// Note that the visible region is already clipped appropriately.
|
||||
nsIntRect visibleRect = data->mVisibleRegion.GetBounds();
|
||||
visibleRect.MoveBy(-GetTranslationForThebesLayer(data->mLayer));
|
||||
colorLayer->SetBounds(visibleRect);
|
||||
visibleRect.MoveBy(mParameters.mOffset);
|
||||
colorLayer->SetClipRect(&visibleRect);
|
||||
|
||||
layer = colorLayer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user