Merge pull request #12137 from ahocevar/low-frame-budget

Load less tiles when low on frame budget
This commit is contained in:
Andreas Hocevar
2021-03-26 22:04:54 +01:00
committed by GitHub
+2 -7
View File
@@ -18,11 +18,7 @@ import RenderEventType from './render/EventType.js';
import TileQueue, {getTilePriority} from './TileQueue.js'; import TileQueue, {getTilePriority} from './TileQueue.js';
import View from './View.js'; import View from './View.js';
import ViewHint from './ViewHint.js'; import ViewHint from './ViewHint.js';
import { import {DEVICE_PIXEL_RATIO, PASSIVE_EVENT_LISTENERS} from './has.js';
DEVICE_PIXEL_RATIO,
IMAGE_DECODE,
PASSIVE_EVENT_LISTENERS,
} from './has.js';
import {TRUE} from './functions.js'; import {TRUE} from './functions.js';
import { import {
apply as applyTransform, apply as applyTransform,
@@ -1047,8 +1043,7 @@ class PluggableMap extends BaseObject {
if (frameState) { if (frameState) {
const hints = frameState.viewHints; const hints = frameState.viewHints;
if (hints[ViewHint.ANIMATING] || hints[ViewHint.INTERACTING]) { if (hints[ViewHint.ANIMATING] || hints[ViewHint.INTERACTING]) {
const lowOnFrameBudget = const lowOnFrameBudget = Date.now() - frameState.time > 8;
!IMAGE_DECODE && Date.now() - frameState.time > 8;
maxTotalLoading = lowOnFrameBudget ? 0 : 8; maxTotalLoading = lowOnFrameBudget ? 0 : 8;
maxNewLoads = lowOnFrameBudget ? 0 : 2; maxNewLoads = lowOnFrameBudget ? 0 : 2;
} }