зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1061846 - Add constants for transaction delay indicator. r=milan
--HG-- extra : rebase_source : 7176c689bd00e90590cc021ab35189720019c73e
This commit is contained in:
Родитель
c3dc5bb115
Коммит
3ce2052a5c
|
@ -351,8 +351,7 @@ LayerManagerComposite::RenderDebugOverlay(const Rect& aBounds)
|
|||
int width;
|
||||
int border;
|
||||
float alpha = 1;
|
||||
if ((now - mWarnTime).ToMilliseconds() < 150) {
|
||||
printf_stderr("Draw\n");
|
||||
if ((now - mWarnTime).ToMilliseconds() < kVisualWarningDuration) {
|
||||
EffectChain effects;
|
||||
|
||||
// Black blorder
|
||||
|
|
|
@ -67,6 +67,10 @@ class TextRenderer;
|
|||
class CompositingRenderTarget;
|
||||
struct FPSState;
|
||||
|
||||
static const int kVisualWarningTrigger = 200; // ms
|
||||
static const int kVisualWarningMax = 1000; // ms
|
||||
static const int kVisualWarningDuration = 150; // ms
|
||||
|
||||
class LayerManagerComposite MOZ_FINAL : public LayerManager
|
||||
{
|
||||
typedef mozilla::gfx::DrawTarget DrawTarget;
|
||||
|
@ -247,7 +251,7 @@ public:
|
|||
mozilla::TimeStamp now = TimeStamp::Now();
|
||||
if (mWarnTime.IsNull() ||
|
||||
severity > mWarningLevel ||
|
||||
mWarnTime + TimeDuration::FromMilliseconds(150) < now) {
|
||||
mWarnTime + TimeDuration::FromMilliseconds(kVisualWarningDuration) < now) {
|
||||
mWarnTime = now;
|
||||
mWarningLevel = severity;
|
||||
}
|
||||
|
|
|
@ -571,8 +571,9 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
|||
|
||||
TimeDuration latency = TimeStamp::Now() - aTransactionStart;
|
||||
// Theshold is 200ms to trigger, 1000ms to hit red
|
||||
if (latency > TimeDuration::FromMilliseconds(200)) {
|
||||
float severity = (latency - TimeDuration::FromMilliseconds(200)).ToMilliseconds() / 800;
|
||||
if (latency > TimeDuration::FromMilliseconds(kVisualWarningTrigger)) {
|
||||
float severity = (latency - TimeDuration::FromMilliseconds(kVisualWarningTrigger)).ToMilliseconds() /
|
||||
(kVisualWarningMax - kVisualWarningTrigger);
|
||||
if (severity > 1.f) {
|
||||
severity = 1.f;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче