gesso-core 0.6.28 → 0.6.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/{CanvasSurface-BTZ3A3MN.js → CanvasSurface-CspYfnND.js} +63 -1
- package/dist/{CanvasSurface-BTZ3A3MN.js.map → CanvasSurface-CspYfnND.js.map} +1 -1
- package/dist/{index-v2fhm7Pn.d.ts → index-CLCtv12G.d.ts} +14 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# gesso-core
|
|
2
2
|
|
|
3
|
+
## 0.6.30
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 82104d1: Scrolling down a list with a sticky header no longer stutters at high refresh rates. A scroll layer repainted the strip a scroll exposed and the items something changed in one walk over everything between them, and a sticky header is damaged at the top on every frame while a scroll down exposes its strip at the bottom: that walk took in every row on screen, each one's text another copy for the GPU, all clipped away. On a 165Hz display that saturated the GPU and halved the frame rate going down, while going up, with the strip beside the header, stayed smooth. Strips far apart are now walked apart.
|
|
8
|
+
|
|
9
|
+
## 0.6.29
|
|
10
|
+
|
|
3
11
|
## 0.6.28
|
|
4
12
|
|
|
5
13
|
## 0.6.27
|
|
@@ -22495,8 +22495,27 @@ var Canvas2DRenderer = class {
|
|
|
22495
22495
|
* box does not, and leave a seam where a direct draw has none. What a
|
|
22496
22496
|
* strip saves is raster, which is the cost it exists for; the walk
|
|
22497
22497
|
* costs what a direct draw's walk would.
|
|
22498
|
+
*
|
|
22499
|
+
* Strips far apart are walked apart. A walk takes in everything
|
|
22500
|
+
* between the strips it is given, and the two that come together most
|
|
22501
|
+
* often are at opposite edges: a sticky header damaged at the top on
|
|
22502
|
+
* every frame of a scroll, and the strip a scroll down exposes at the
|
|
22503
|
+
* bottom. One walk over both drew every row on screen into a clip that
|
|
22504
|
+
* kept almost none of it — each row's text one more copy for the GPU,
|
|
22505
|
+
* which at 165Hz was more copies than it could take, so scrolling down
|
|
22506
|
+
* a spreadsheet stuttered and scrolling up, its strip beside the
|
|
22507
|
+
* header, did not. Strips whose walks would meet share one, so no
|
|
22508
|
+
* pixel is painted twice.
|
|
22498
22509
|
*/
|
|
22499
22510
|
paintLayer(layer, strips, node, rec, context) {
|
|
22511
|
+
if (strips === null) {
|
|
22512
|
+
this.walkLayer(layer, null, node, rec, context);
|
|
22513
|
+
return;
|
|
22514
|
+
}
|
|
22515
|
+
for (const group of walkGroups(strips, 16 * layer.dpr)) this.walkLayer(layer, group, node, rec, context);
|
|
22516
|
+
}
|
|
22517
|
+
/** One walk of a layer's children, clipped to `strips` and culled to what reaches them. */
|
|
22518
|
+
walkLayer(layer, strips, node, rec, context) {
|
|
22500
22519
|
const lctx = new PreciseContext(layer.frontContext);
|
|
22501
22520
|
lctx.save();
|
|
22502
22521
|
if (strips !== null) {
|
|
@@ -22645,6 +22664,49 @@ function traceFrame(ctx, x, y, width, height) {
|
|
|
22645
22664
|
ctx.closePath();
|
|
22646
22665
|
}
|
|
22647
22666
|
/**
|
|
22667
|
+
* Strips grouped so that each group is one walk of a layer.
|
|
22668
|
+
*
|
|
22669
|
+
* Two strips share a group when less than `reach` separates them, which
|
|
22670
|
+
* is when their walks, each a spill wider than its strips, would meet.
|
|
22671
|
+
* Strips in different groups therefore never overlap, and nothing is
|
|
22672
|
+
* painted twice. A group keeps its strips in the order they came, and
|
|
22673
|
+
* the groups go in the order of their first strip.
|
|
22674
|
+
*
|
|
22675
|
+
* Merged by repeated passes rather than one: joining two strips can
|
|
22676
|
+
* bring the group within reach of a third that neither was near alone.
|
|
22677
|
+
* A frame has a handful of strips, so the passes cost nothing.
|
|
22678
|
+
*/
|
|
22679
|
+
function walkGroups(strips, reach) {
|
|
22680
|
+
const groups = strips.map((strip) => ({
|
|
22681
|
+
strips: [strip],
|
|
22682
|
+
box: { ...strip }
|
|
22683
|
+
}));
|
|
22684
|
+
let merged = true;
|
|
22685
|
+
while (merged) {
|
|
22686
|
+
merged = false;
|
|
22687
|
+
for (let i = 0; i < groups.length && !merged; i++) for (let j = i + 1; j < groups.length; j++) {
|
|
22688
|
+
const a = groups[i].box;
|
|
22689
|
+
const b = groups[j].box;
|
|
22690
|
+
if (b.x - (a.x + a.width) >= reach || a.x - (b.x + b.width) >= reach || b.y - (a.y + a.height) >= reach || a.y - (b.y + b.height) >= reach) continue;
|
|
22691
|
+
const x = Math.min(a.x, b.x);
|
|
22692
|
+
const y = Math.min(a.y, b.y);
|
|
22693
|
+
groups[i] = {
|
|
22694
|
+
strips: [...groups[i].strips, ...groups[j].strips],
|
|
22695
|
+
box: {
|
|
22696
|
+
x,
|
|
22697
|
+
y,
|
|
22698
|
+
width: Math.max(a.x + a.width, b.x + b.width) - x,
|
|
22699
|
+
height: Math.max(a.y + a.height, b.y + b.height) - y
|
|
22700
|
+
}
|
|
22701
|
+
};
|
|
22702
|
+
groups.splice(j, 1);
|
|
22703
|
+
merged = true;
|
|
22704
|
+
break;
|
|
22705
|
+
}
|
|
22706
|
+
}
|
|
22707
|
+
return groups.map((group) => group.strips);
|
|
22708
|
+
}
|
|
22709
|
+
/**
|
|
22648
22710
|
* Emits a rounded-rectangle path (clamped radius) onto a context.
|
|
22649
22711
|
*
|
|
22650
22712
|
* Uses arcTo instead of roundRect so the renderer does not depend
|
|
@@ -22746,4 +22808,4 @@ function createCanvasSurface(host) {
|
|
|
22746
22808
|
//#endregion
|
|
22747
22809
|
export { isImeKey as $, hasVisualState as $a, densityFactors as $i, CharacterCountTextMeasurer as $n, parseTransform as $r, clearFontStacks as $t, withOverrideSource as A, darkColors as Aa, UiInsetRegistry as Ai, pointerEventsOf as An, findPropertyDefinition as Ar, wordRangeIn as At, FlexDirection as B, rgba as Ba, themesEqual as Bi, EDITOR_PROP as Bn, UI_SEMANTIC_STATES as Br, applyCanvasTextStyle as Bt, SCROLLBAR_LINGER_MS as C, spanAtOffset as Ca, borderRadiusIsZero as Ci, isNodeFocusable as Cn, DEFAULT_LINE_HEIGHT_FACTOR as Cr, scrollsFromRight as Ct, formatExplanation as D, textSpansEqual as Da, defineProperty as Di, isNodeTabStop as Dn, resolvePropertyByName as Dr, paragraphGeometry as Dt, formatConstraints as E, textContentOf as Ea, uniformBorderRadius as Ei, isNodeSelectable as En, resolveProperty as Er, offsetAtPointIn as Et, clampSize as F, colorValuesEqual as Fa, bandOf as Fi, linkOf as Fn, propertyIsInherited as Fr, editingGroupOf as Ft, CrossAxisAlignment as G, DirtyNodeSet as Ga, noThemeExtensions as Gi, isMultiline as Gn, validateRole as Gr, layoutTextLines as Gt, placeGridItems as H, findEnvironmentKey as Ha, withDensity as Hi, editorFor as Hn, isUiSemanticState as Hr, createCanvasTextStyle as Ht, constraintsEqual as I, colorsEqual as Ia, containerBands as Ii, linkRunAtPointIn as In, propertyNarrowers as Ir, commandForKey as It, parseCrossAxisAlignment as J, resetOverrideWarnings as Ja, withThemeExtension as Ji, nextCaretToggle as Jn, validateSubgrid as Jr, spanOf as Jt, MainAxisAlignment as K, clearOverrideProperty as Ka, themeExtension as Ki, isReadOnly as Kn, validateStates as Kr, runCanvasStyleInto as Kt, tightenConstraints as L, normalizeColor as La, unknownContainerSize as Li, setLinkHover as Ln, propertyValuesEqualByName as Lr, detectEditingPlatform as Lt, contentOffset as M, UiBasicColors as Ma, noInsets as Mi, clearLinkHover as Mn, inheritedPropertyFlags as Mr, adjacentField as Mt, LayoutRecord as N, colorToHex as Na, observeViewportInsets as Ni, hasTextLinks as Nn, inheritedPropertyNames as Nr, comparePositions as Nt, formatNumber as O, textStylesEqual as Oa, propertyValuesEqual as Oi, isPressable as On, resolveString as Or, paragraphGeometryFrom as Ot, Constraints as P, colorToRgba as Pa, UiContainerSizeSource as Pi, linkHoverOf as Pn, propertyEffects as Pr, edgeField as Pt, capturePointer as Q, defaultVisualState as Qa, relativeLuminance as Qi, videoFrameSize as Qn, UiTransforms as Qr, bumpFontStack as Qt, MAX_MEASURES_PER_CHILD as R, parseColor as Ra, darkTheme as Ri, CARET_BLINK_MS as Rn, UiProperties as Rr, isPrintable as Rt, SCROLLBAR_FADE_MS as S, resolvedSpansOf as Sa, borderRadiusEqual as Si, setSelectionRange as Sn, UiGraph as Sr, scrollbarZoneAt as St, describeOverrides as T, spansDifferOnlyInPaint as Ta, normalizeBorderRadius as Ti, isNodeInert as Tn, resolveNumber as Tr, hasDrawnText as Tt, sizeGridTracks as U, UiEnvironment as Ua, defineThemeExtension as Ui, editorOf as Un, normalizeStates as Ur, drawText as Ut, parseFlexDirection as V, createEnvironmentKey as Va, withContrast as Vi, caretVisibleAt as Vn, isUiRole as Vr, buildFontString as Vt, AlignContent as W, UiNode as Wa, hasThemeExtension as Wi, isEditableNode as Wn, statesEqual as Wr, fillTextRects as Wt, CanvasPlatformSurface as X, writeOverrideProperty as Xa, highContrastColors as Xi, resolveColorValue as Xn, paintValuesEqual as Xr, textRunBackgrounds as Xt, parseMainAxisAlignment as Y, writeDeclaredProperty as Ya, contrastRatio as Yi, syncEditorValue as Yn, inputsEqual as Yr, textMeasureRequest as Yt, UiPlatformAdapter as Z, UiVisualState as Za, raiseContrast as Zi, isVideoSurface as Zn, pathValuesEqual as Zr, textRunDecorations as Zt, LABEL_PADDING_X as _, typographyEqual as _a, repeat as _i, TEXT_SELECTION_PROP as _n, noKeyModifiers as _o, nextGraphemeEnd as _r, scrollBounds as _t, PaintPictureCache as a, shadowsEqual as aa, gradientsEqual as ai, DEFAULT_TEXT_COLOR as an, UiEventType as ao, caretRectFor as ar, UiGestureRecognizer as at, snapScroll as b, flattenTextSpans as ba, borderRadius as bi, selectableTextOf as bn, DirtyFlags as bo, previousWordStart as br, scrollbarThumb as bt, EMPTY_RECORDING as c, boxShadowArraysEqual as ca, validateGradient as ci, createPaintState as cn, UiInputEvent as co, lineLimit as cr, isScrollContainer as ct, tracePathData as d, boxShadowsEqual as da, isAutoLength as di, normalizeVerticalAlign as dn, UiPinchEvent as do, offsetForVerticalMove as dr, UiFocusManager as dt, defaultSpacing as ea, transform as ei, fontStackFor as en, visualState as eo, ParagraphTextMeasurer as er, pointerDeviceOf as et, ScaledImageCache as f, defaultShapes as fa, isFrLength as fi, resolvePaintState as fn, UiPointerEvent as fo, selectionRects as fr, UiHitTester as ft, paintsAfterChildren as g, isTypographyRole as ga, percent as gi, setMatchRanges as gn, UiWheelEvent as go, lineStartAt as gr, SCROLLBAR_THICKNESS as gt, hasDecorationPhase as h, defaultTypography as ha, minmax as hi, matchRangesOf as hn, UiWheelDeltaMode as ho, lineEndAt as hr, SCROLLBAR_MIN_THUMB as ht, traceRoundedRect as i, defaultShadows as ia, gradientPaint as ii, DEFAULT_FONT_WEIGHT as in, UiCompositionEvent as io, proportionalFontMetrics as ir, UiTouchScroller as it, accumulatedOffsetTo as j, lightColors as ja, insetsEqual as ji, resolveCursor as jn, getPropertyNames as jr, textInputOf as jt, labelNode as k, colorsEqualPalette as ka, UiEnvironmentKeys as ki, isSubtreeInert as kn, closestPropertyName as kr, selectionRectsIn as kt, PaintRecorder as l, boxShadowRadius as la, auto as li, isPaintVisible as ln, UiKeyboardEvent as lo, offsetAtPoint as lr, UiKeyboardController as lt, decorationRect as m, shapesEqual as ma, isPercentLength as mi, clearMatchRanges as mn, UiTextChangeEvent as mo, graphemeBoundaries as mr, SCROLLBAR_INSET as mt, createCanvasSurface as n, spacingEqual as na, transformsEqual as ni, DEFAULT_FONT_FAMILY as nn, MOUSE_POINTER as no, ELLIPSIS as nr, touchActionFor as nt, paintPictures as o, BOX_SHADOW_BLUR_REACH as oa, linearGradient as oi, colorToCss as on, UiFocusEvent as oo, lineIndexAtY as or, UiPinchRecognizer as ot, decorationColor as p, isShapeName as pa, isMinMaxTrack as pi, TEXT_MATCHES_PROP as pn, UiSelectionChangeEvent as po, EditableTextModel as pr, SCROLLBAR_HOVER_ZONE as pt, parseAlignContent as q, overrideSources as qa, themeExtensionsEqual as qi, maskText as qn, UI_SUBGRID_AXES as qr, runFontString as qt, Canvas2DRenderer as r, spacingSteps as ra, MAX_GRADIENT_STOPS as ri, DEFAULT_FONT_SIZE as rn, UiBeforeInputEvent as ro, layoutParagraph as rr, UiEditingController as rt, PaintTarget as s, boxShadow as sa, radialGradient as si, computeObjectFitRect as sn, UiGestureEvent as so, lineIndexForOffset as sr, UiWheelController as st, CanvasSurface as t, scaleSpacing as ta, transformIsIdentity as ti, registerFontStack as tn, visualStatesEqual as to, spannedRunsFor as tr, prepareInputSurface as tt, replayPaint as u, boxShadowReach as ua, fr as ui, normalizeTextAlign as un, UiPasteEvent as uo, offsetAtX as ur, UiPointerController as ut, drawOverlayShapes as v, defaultTextStyle as va, resolveLength as vi, clearSelectionRange as vn, wheelDeltaYOf as vo, nextWordEnd as vr, scrollLeaderOf as vt, describeLength as w, spannedTextOf as wa, borderRadiusValuesEqual as wi, isNodeHitTestable as wn, resolveBoolean as wr, UiInputDispatcher as wt, LayoutEngine as x, hiddenRangesOf as xa, borderRadiusCorners as xi, selectionRangeOf as xn, UiBinding as xo, wordRangeAt as xr, scrollbarThumbs as xt, labelOrigin as y, editableSpansOf as ya, UiBorderRadiuses as yi, selectableTextNodes as yn, UiNodeType as yo, previousGraphemeStart as yr, scrollRange as yt, isLayoutProtocol as z, rgb8 as za, lightTheme as zi, CARET_WIDTH as zn, UI_ROLES as zr, EditableLayout as zt };
|
|
22748
22810
|
|
|
22749
|
-
//# sourceMappingURL=CanvasSurface-
|
|
22811
|
+
//# sourceMappingURL=CanvasSurface-CspYfnND.js.map
|