Bug 1317862 - Part 4: Remove unnecessary clip. r=mstange
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -4818,17 +4818,17 @@ public:
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry,
nsRegion *aInvalidRegion) override;
virtual void DisableComponentAlpha() override {
mDisableSubpixelAA = true;
}
- void RenderToContext(gfxContext* aCtx, nsDisplayListBuilder* aBuilder);
+ void RenderToContext(gfxContext* aCtx, nsDisplayListBuilder* aBuilder, bool aIsRecording = false);
bool CanApplyOpacity() const override
{
nsTextFrame* f = static_cast<nsTextFrame*>(mFrame);
if (f->IsSelected()) {
return false;
}
@@ -4990,17 +4990,17 @@ nsDisplayText::nsDisplayText(nsDisplayLi
mBounds.Inflate(mFrame->PresContext()->AppUnitsPerDevPixel());
if (gfxPrefs::LayersAllowTextLayers()) {
RefPtr<DrawTargetCapture> capture =
gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()->CreateCaptureDT(IntSize());
RefPtr<gfxContext> captureCtx = gfxContext::CreateOrNull(capture);
// TODO: Paint() checks mDisableSubpixelAA, we should too.
- RenderToContext(captureCtx, aBuilder);
+ RenderToContext(captureCtx, aBuilder, true);
// TODO: Ideally we'd re-use captureCtx in Paint() if we couldn't build
// a layer here. We have to deal with the problem that the ScreenReferenceDrawTarget
// might not be compatible with the DT used for layer rendering.
GlyphArray* g = mGlyphs.AppendElement();
std::vector<Glyph> glyphs;
Color color;
@@ -5063,17 +5063,17 @@ nsDisplayText::BuildLayer(nsDisplayListB
layer->SetBounds(IntRect(destBounds.x, destBounds.y, destBounds.width, destBounds.height));
layer->SetBaseTransform(gfx::Matrix4x4::Translation(aContainerParameters.mOffset.x,
aContainerParameters.mOffset.y, 0));
return layer.forget();
}
void
-nsDisplayText::RenderToContext(gfxContext* aCtx, nsDisplayListBuilder* aBuilder)
+nsDisplayText::RenderToContext(gfxContext* aCtx, nsDisplayListBuilder* aBuilder, bool aIsRecording)
{
nsTextFrame* f = static_cast<nsTextFrame*>(mFrame);
// Add 1 pixel of dirty area around mVisibleRect to allow us to paint
// antialiased pixels beyond the measured text extents.
// This is temporary until we do this in the actual calculation of text extents.
auto A2D = mFrame->PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect extraVisible =
@@ -5083,17 +5083,18 @@ nsDisplayText::RenderToContext(gfxContex
gfxContextAutoSaveRestore save(aCtx);
gfxRect pixelVisible(extraVisible.x, extraVisible.y,
extraVisible.width, extraVisible.height);
pixelVisible.Inflate(2);
pixelVisible.RoundOut();
if (!aBuilder->IsForGenerateGlyphMask() &&
- !aBuilder->IsForPaintingSelectionBG()) {
+ !aBuilder->IsForPaintingSelectionBG() &&
+ !aIsRecording) {
aCtx->NewPath();
aCtx->Rectangle(pixelVisible);
aCtx->Clip();
}
NS_ASSERTION(mVisIStartEdge >= 0, "illegal start edge");
NS_ASSERTION(mVisIEndEdge >= 0, "illegal end edge");