зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1568227. Render blobs at visibleRect.x,y instead of 0,0. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D45322 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
6223028546
Коммит
b74d61d223
|
@ -2047,6 +2047,7 @@ static bool PaintByLayer(nsDisplayItem* aItem,
|
||||||
|
|
||||||
static bool PaintItemByDrawTarget(nsDisplayItem* aItem, gfx::DrawTarget* aDT,
|
static bool PaintItemByDrawTarget(nsDisplayItem* aItem, gfx::DrawTarget* aDT,
|
||||||
const LayoutDevicePoint& aOffset,
|
const LayoutDevicePoint& aOffset,
|
||||||
|
const IntRect& visibleRect,
|
||||||
nsDisplayListBuilder* aDisplayListBuilder,
|
nsDisplayListBuilder* aDisplayListBuilder,
|
||||||
const RefPtr<BasicLayerManager>& aManager,
|
const RefPtr<BasicLayerManager>& aManager,
|
||||||
const gfx::Size& aScale,
|
const gfx::Size& aScale,
|
||||||
|
@ -2055,7 +2056,7 @@ static bool PaintItemByDrawTarget(nsDisplayItem* aItem, gfx::DrawTarget* aDT,
|
||||||
|
|
||||||
bool isInvalidated = false;
|
bool isInvalidated = false;
|
||||||
// XXX Why is this ClearRect() needed?
|
// XXX Why is this ClearRect() needed?
|
||||||
aDT->ClearRect(Rect(aDT->GetRect()));
|
aDT->ClearRect(Rect(visibleRect));
|
||||||
RefPtr<gfxContext> context = gfxContext::CreateOrNull(aDT);
|
RefPtr<gfxContext> context = gfxContext::CreateOrNull(aDT);
|
||||||
MOZ_ASSERT(context);
|
MOZ_ASSERT(context);
|
||||||
|
|
||||||
|
@ -2100,15 +2101,14 @@ static bool PaintItemByDrawTarget(nsDisplayItem* aItem, gfx::DrawTarget* aDT,
|
||||||
// which isn't very useful.
|
// which isn't very useful.
|
||||||
if (aHighlight) {
|
if (aHighlight) {
|
||||||
aDT->SetTransform(gfx::Matrix());
|
aDT->SetTransform(gfx::Matrix());
|
||||||
aDT->FillRect(Rect(aDT->GetRect()),
|
aDT->FillRect(Rect(visibleRect), gfx::ColorPattern(aHighlight.value()));
|
||||||
gfx::ColorPattern(aHighlight.value()));
|
|
||||||
}
|
}
|
||||||
if (aItem->Frame()->PresContext()->GetPaintFlashing() && isInvalidated) {
|
if (aItem->Frame()->PresContext()->GetPaintFlashing() && isInvalidated) {
|
||||||
aDT->SetTransform(gfx::Matrix());
|
aDT->SetTransform(gfx::Matrix());
|
||||||
float r = float(rand()) / float(RAND_MAX);
|
float r = float(rand()) / float(RAND_MAX);
|
||||||
float g = float(rand()) / float(RAND_MAX);
|
float g = float(rand()) / float(RAND_MAX);
|
||||||
float b = float(rand()) / float(RAND_MAX);
|
float b = float(rand()) / float(RAND_MAX);
|
||||||
aDT->FillRect(Rect(aDT->GetRect()),
|
aDT->FillRect(Rect(visibleRect),
|
||||||
gfx::ColorPattern(gfx::Color(r, g, b, 0.5)));
|
gfx::ColorPattern(gfx::Color(r, g, b, 0.5)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2195,7 +2195,7 @@ WebRenderCommandBuilder::GenerateFallbackData(
|
||||||
if (dtSize.IsEmpty()) {
|
if (dtSize.IsEmpty()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
// Display item bounds should be unscaled
|
||||||
aImageRect = dtRect / layerScale;
|
aImageRect = dtRect / layerScale;
|
||||||
|
|
||||||
nsDisplayItemGeometry* geometry = fallbackData->mGeometry;
|
nsDisplayItemGeometry* geometry = fallbackData->mGeometry;
|
||||||
|
@ -2276,8 +2276,11 @@ WebRenderCommandBuilder::GenerateFallbackData(
|
||||||
fallbackData->mBasicLayerManager =
|
fallbackData->mBasicLayerManager =
|
||||||
new BasicLayerManager(BasicLayerManager::BLM_INACTIVE);
|
new BasicLayerManager(BasicLayerManager::BLM_INACTIVE);
|
||||||
}
|
}
|
||||||
|
// aOffset is (0, 0) because blobs don't want to normalize their
|
||||||
|
// coordinates
|
||||||
bool isInvalidated = PaintItemByDrawTarget(
|
bool isInvalidated = PaintItemByDrawTarget(
|
||||||
aItem, dt, LayoutDevicePoint(0, 0), aDisplayListBuilder,
|
aItem, dt, LayoutDevicePoint(0, 0),
|
||||||
|
/*aVisibleRect: */ dtRect.ToUnknownRect(), aDisplayListBuilder,
|
||||||
fallbackData->mBasicLayerManager, scale, highlight);
|
fallbackData->mBasicLayerManager, scale, highlight);
|
||||||
if (!isInvalidated) {
|
if (!isInvalidated) {
|
||||||
if (!aItem->GetBuildingRect().IsEqualInterior(
|
if (!aItem->GetBuildingRect().IsEqualInterior(
|
||||||
|
@ -2346,8 +2349,12 @@ WebRenderCommandBuilder::GenerateFallbackData(
|
||||||
fallbackData->mBasicLayerManager =
|
fallbackData->mBasicLayerManager =
|
||||||
new BasicLayerManager(mManager->GetWidget());
|
new BasicLayerManager(mManager->GetWidget());
|
||||||
}
|
}
|
||||||
|
// aOffset is applied because this case is a "real" image and not a
|
||||||
|
// blob
|
||||||
isInvalidated = PaintItemByDrawTarget(
|
isInvalidated = PaintItemByDrawTarget(
|
||||||
aItem, dt, aImageRect.TopLeft(), aDisplayListBuilder,
|
aItem, dt,
|
||||||
|
/*aOffset: */ aImageRect.TopLeft(),
|
||||||
|
/*aVisibleRect: */ dt->GetRect(), aDisplayListBuilder,
|
||||||
fallbackData->mBasicLayerManager, scale, highlight);
|
fallbackData->mBasicLayerManager, scale, highlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче