mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1282957 - Add a visual indicator for pages affected by scroll-linked effects. r=mstange
MozReview-Commit-ID: KuAL2CUDCnj --HG-- extra : rebase_source : 19ed84b06568a9dbca5d96aecb02161aa5535d42
This commit is contained in:
parent
b1bd30f80e
commit
95d204ffcd
@ -625,6 +625,15 @@ RenderLayers(ContainerT* aContainer,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (gfxPrefs::LayersDrawFPS()) {
|
||||
for (auto metadata : layer->GetAllScrollMetadata()) {
|
||||
if (metadata.IsApzForceDisabled()) {
|
||||
aManager->DisabledApzWarning();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Color color;
|
||||
if (NeedToDrawCheckerboardingForLayer(layer, &color)) {
|
||||
if (gfxPrefs::APZHighlightCheckerboardedAreas()) {
|
||||
|
@ -118,6 +118,7 @@ LayerManagerComposite::ClearCachedResources(Layer* aSubtree)
|
||||
LayerManagerComposite::LayerManagerComposite(Compositor* aCompositor)
|
||||
: mWarningLevel(0.0f)
|
||||
, mUnusedApzTransformWarning(false)
|
||||
, mDisabledApzWarning(false)
|
||||
, mCompositor(aCompositor)
|
||||
, mInTransaction(false)
|
||||
, mIsCompositorReady(false)
|
||||
@ -626,12 +627,25 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
|
||||
// in the top-right corner
|
||||
EffectChain effects;
|
||||
effects.mPrimaryEffect = new EffectSolidColor(gfx::Color(1, 0, 0, 1));
|
||||
mCompositor->DrawQuad(gfx::Rect(aBounds.width - 20, 0, aBounds.width, 20),
|
||||
mCompositor->DrawQuad(gfx::Rect(aBounds.width - 20, 0, 20, 20),
|
||||
aBounds, effects, alpha, gfx::Matrix4x4());
|
||||
|
||||
mUnusedApzTransformWarning = false;
|
||||
SetDebugOverlayWantsNextFrame(true);
|
||||
}
|
||||
if (mDisabledApzWarning) {
|
||||
// If we have a disabled APZ on this composite, draw a 20x20 yellow box
|
||||
// in the top-right corner, to the left of the unused-apz-transform
|
||||
// warning box
|
||||
EffectChain effects;
|
||||
effects.mPrimaryEffect = new EffectSolidColor(gfx::Color(1, 1, 0, 1));
|
||||
mCompositor->DrawQuad(gfx::Rect(aBounds.width - 40, 0, 20, 20),
|
||||
aBounds, effects, alpha, gfx::Matrix4x4());
|
||||
|
||||
mDisabledApzWarning = false;
|
||||
SetDebugOverlayWantsNextFrame(true);
|
||||
}
|
||||
|
||||
|
||||
// Each frame is invalidate by the previous frame for simplicity
|
||||
} else {
|
||||
|
@ -309,6 +309,9 @@ public:
|
||||
void UnusedApzTransformWarning() {
|
||||
mUnusedApzTransformWarning = true;
|
||||
}
|
||||
void DisabledApzWarning() {
|
||||
mDisabledApzWarning = true;
|
||||
}
|
||||
|
||||
bool LastFrameMissedHWC() { return mLastFrameMissedHWC; }
|
||||
|
||||
@ -392,6 +395,7 @@ private:
|
||||
float mWarningLevel;
|
||||
mozilla::TimeStamp mWarnTime;
|
||||
bool mUnusedApzTransformWarning;
|
||||
bool mDisabledApzWarning;
|
||||
RefPtr<Compositor> mCompositor;
|
||||
UniquePtr<LayerProperties> mClonedLayerTreeProperties;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user