diff --git a/application.tsx b/application.tsx index df7d121..dde34c8 100644 --- a/application.tsx +++ b/application.tsx @@ -1,17 +1,17 @@ -import { h } from 'preact' -import { StyleSheet, css } from 'aphrodite' -import { ReloadableComponent, SerializedComponent } from './reloadable' +import {h} from 'preact' +import {StyleSheet, css} from 'aphrodite' +import {ReloadableComponent, SerializedComponent} from './reloadable' -import { importFromBGFlameGraph } from './import/bg-flamegraph' -import { importFromStackprof } from './import/stackprof' -import { importFromChromeTimeline, importFromChromeCPUProfile } from './import/chrome' -import { FlamechartRenderer } from './flamechart-renderer' -import { CanvasContext } from './canvas-context' +import {importFromBGFlameGraph} from './import/bg-flamegraph' +import {importFromStackprof} from './import/stackprof' +import {importFromChromeTimeline, importFromChromeCPUProfile} from './import/chrome' +import {FlamechartRenderer} from './flamechart-renderer' +import {CanvasContext} from './canvas-context' -import { Profile, Frame } from './profile' -import { Flamechart } from './flamechart' -import { FlamechartView } from './flamechart-view' -import { FontFamily, FontSize, Colors } from './style' +import {Profile, Frame} from './profile' +import {Flamechart} from './flamechart' +import {FlamechartView} from './flamechart-view' +import {FontFamily, FontSize, Colors} from './style' declare function require(x: string): any const exampleProfileURL = require('./sample/perf-vertx-stacks-01-collapsed-all.txt') @@ -164,7 +164,7 @@ export class GLCanvas extends ReloadableComponent { private maybeResize() { if (!this.canvas) return - let { width, height } = this.canvas.getBoundingClientRect() + let {width, height} = this.canvas.getBoundingClientRect() width = Math.floor(width) * window.devicePixelRatio height = Math.floor(height) * window.devicePixelRatio @@ -220,7 +220,7 @@ export class Application extends ReloadableComponent<{}, ApplicationState> { rehydrate(serialized: SerializedComponent) { super.rehydrate(serialized) - const { flamechart, sortedFlamechart } = serialized.state + const {flamechart, sortedFlamechart} = serialized.state if (this.canvasContext && flamechart && sortedFlamechart) { this.setState({ flamechartRenderer: new FlamechartRenderer(this.canvasContext, flamechart), @@ -235,7 +235,7 @@ export class Application extends ReloadableComponent<{}, ApplicationState> { console.time('import') const profile = importProfile(contents, fileName) if (profile == null) { - this.setState({ loading: false }) + this.setState({loading: false}) // TODO(jlfwong): Make this a nicer overlay alert('Unrecognized format! See documentation about supported formats.') return @@ -298,7 +298,7 @@ export class Application extends ReloadableComponent<{}, ApplicationState> { } loadFromFile(file: File) { - this.setState({ loading: true }, () => { + this.setState({loading: true}, () => { requestAnimationFrame(() => { const reader = new FileReader() reader.addEventListener('loadend', () => { @@ -310,7 +310,7 @@ export class Application extends ReloadableComponent<{}, ApplicationState> { } loadExample = () => { - this.setState({ loading: true }) + this.setState({loading: true}) const filename = 'perf-vertx-stacks-01-collapsed-all.txt' fetch(exampleProfileURL) .then(resp => resp.text()) @@ -435,7 +435,7 @@ export class Application extends ReloadableComponent<{}, ApplicationState> { } setSortOrder = (sortOrder: SortOrder) => { - this.setState({ sortOrder }) + this.setState({sortOrder}) } private canvasContext: CanvasContext | null = null diff --git a/canvas-context.ts b/canvas-context.ts index 813dca1..66dd1c2 100644 --- a/canvas-context.ts +++ b/canvas-context.ts @@ -13,9 +13,9 @@ import { TextureRenderer, TextureRendererProps, } from './texture-catched-renderer' -import { StatsPanel } from './stats' +import {StatsPanel} from './stats' -import { Vec2, Rect } from './math' +import {Vec2, Rect} from './math' import { FlamechartColorPassRenderer, FlamechartColorPassRenderProps, @@ -33,7 +33,7 @@ export class CanvasContext { private viewportRectangleRenderer: ViewportRectangleRenderer private textureRenderer: TextureRenderer private flamechartColorPassRenderer: FlamechartColorPassRenderer - private setViewportScope: regl.Command<{ physicalBounds: Rect }> + private setViewportScope: regl.Command<{physicalBounds: Rect}> private setScissor: regl.Command<{}> constructor(canvas: HTMLCanvasElement) { @@ -51,7 +51,7 @@ export class CanvasContext { this.viewportRectangleRenderer = new ViewportRectangleRenderer(this.gl) this.textureRenderer = new TextureRenderer(this.gl) this.flamechartColorPassRenderer = new FlamechartColorPassRenderer(this.gl) - this.setScissor = this.gl({ scissor: { enable: true } }) + this.setScissor = this.gl({scissor: {enable: true}}) this.setViewportScope = this.gl({ context: { viewportX: (context: regl.Context, props: SetViewportScopeProps) => { @@ -62,7 +62,7 @@ export class CanvasContext { }, }, viewport: (context, props) => { - const { physicalBounds } = props + const {physicalBounds} = props return { x: physicalBounds.left(), y: @@ -74,7 +74,7 @@ export class CanvasContext { } }, scissor: (context, props) => { - const { physicalBounds } = props + const {physicalBounds} = props return { enable: true, box: { @@ -112,7 +112,7 @@ export class CanvasContext { private onBeforeFrame = (context: regl.Context) => { this.setScissor(() => { - this.gl.clear({ color: [0, 0, 0, 0] }) + this.gl.clear({color: [0, 0, 0, 0]}) }) this.tickNeeded = false @@ -173,11 +173,11 @@ export class CanvasContext { new Vec2(bounds.left * window.devicePixelRatio, bounds.top * window.devicePixelRatio), new Vec2(bounds.width * window.devicePixelRatio, bounds.height * window.devicePixelRatio), ) - this.setViewportScope({ physicalBounds }, cb) + this.setViewportScope({physicalBounds}, cb) } setViewport(physicalBounds: Rect, cb: (context: regl.Context) => void) { - this.setViewportScope({ physicalBounds }, cb) + this.setViewportScope({physicalBounds}, cb) } getMaxTextureSize() { diff --git a/color.ts b/color.ts index e700cd3..1ab169d 100644 --- a/color.ts +++ b/color.ts @@ -1,4 +1,4 @@ -import { Frame } from './profile' +import {Frame} from './profile' export class Color { constructor( diff --git a/flamechart-color-pass-renderer.ts b/flamechart-color-pass-renderer.ts index 992c0c6..a56fece 100644 --- a/flamechart-color-pass-renderer.ts +++ b/flamechart-color-pass-renderer.ts @@ -1,5 +1,5 @@ import regl from 'regl' -import { Vec2, Rect, AffineTransform } from './math' +import {Vec2, Rect, AffineTransform} from './math' export interface FlamechartColorPassRenderProps { rectInfoTexture: regl.Texture @@ -125,7 +125,7 @@ export class FlamechartColorPassRenderer { uniforms: { colorTexture: (context, props) => props.rectInfoTexture, uvTransform: (context, props) => { - const { srcRect, rectInfoTexture } = props + const {srcRect, rectInfoTexture} = props const physicalToUV = AffineTransform.withTranslation(new Vec2(0, 1)) .times(AffineTransform.withScale(new Vec2(1, -1))) .times( @@ -146,7 +146,7 @@ export class FlamechartColorPassRenderer { .flatten() }, positionTransform: (context, props) => { - const { dstRect } = props + const {dstRect} = props const viewportSize = new Vec2(context.viewportWidth, context.viewportHeight) const physicalToNDC = AffineTransform.withScale(new Vec2(1, -1)).times( diff --git a/flamechart-minimap-view.tsx b/flamechart-minimap-view.tsx index 3f8df07..6475cd1 100644 --- a/flamechart-minimap-view.tsx +++ b/flamechart-minimap-view.tsx @@ -1,13 +1,13 @@ -import { h, Component } from 'preact' -import { css } from 'aphrodite' -import { Flamechart } from './flamechart' -import { Rect, Vec2, AffineTransform, clamp } from './math' -import { FlamechartRenderer } from './flamechart-renderer' -import { cachedMeasureTextWidth } from './utils' -import { style, Sizes } from './flamechart-style' -import { FontFamily, FontSize, Colors } from './style' -import { CanvasContext } from './canvas-context' -import { TextureCachedRenderer } from './texture-catched-renderer' +import {h, Component} from 'preact' +import {css} from 'aphrodite' +import {Flamechart} from './flamechart' +import {Rect, Vec2, AffineTransform, clamp} from './math' +import {FlamechartRenderer} from './flamechart-renderer' +import {cachedMeasureTextWidth} from './utils' +import {style, Sizes} from './flamechart-style' +import {FontFamily, FontSize, Colors} from './style' +import {CanvasContext} from './canvas-context' +import {TextureCachedRenderer} from './texture-catched-renderer' const DEVICE_PIXEL_RATIO = window.devicePixelRatio @@ -208,7 +208,7 @@ export class FlamechartMinimapView extends Component { wrapS: 'clamp', wrapT: 'clamp', }) - this.framebuffer = canvasContext.gl.framebuffer({ color: [this.texture] }) + this.framebuffer = canvasContext.gl.framebuffer({color: [this.texture]}) this.rowCache = new LRUCache(this.texture.height) this.renderToFramebuffer = canvasContext.gl({ framebuffer: this.framebuffer, @@ -261,7 +261,7 @@ export class FlamechartRenderer { // range than a tree of always-height-two might make this run faster this.layers.push(new RangeTreeInteriorNode(leafNodes)) } - this.rectInfoTexture = this.canvasContext.gl.texture({ width: 1, height: 1 }) + this.rectInfoTexture = this.canvasContext.gl.texture({width: 1, height: 1}) this.framebuffer = this.canvasContext.gl.framebuffer({ color: [this.rectInfoTexture], }) @@ -274,7 +274,7 @@ export class FlamechartRenderer { } configSpaceBoundsForKey(key: FlamechartRowAtlasKey): Rect { - const { stackDepth, zoomLevel, index } = key + const {stackDepth, zoomLevel, index} = key const configSpaceContentWidth = this.flamechart.getTotalWeight() const width = configSpaceContentWidth / Math.pow(2, zoomLevel) @@ -283,9 +283,9 @@ export class FlamechartRenderer { } render(props: FlamechartRendererProps) { - const { configSpaceSrcRect, physicalSpaceDstRect } = props + const {configSpaceSrcRect, physicalSpaceDstRect} = props - const atlasKeysToRender: { stackDepth: number; zoomLevel: number; index: number }[] = [] + const atlasKeysToRender: {stackDepth: number; zoomLevel: number; index: number}[] = [] // We want to render the lowest resolution we can while still guaranteeing that the // atlas line is higher resolution than its corresponding destination rectangle on @@ -298,7 +298,7 @@ export class FlamechartRenderer { let zoomLevel = 0 while (true) { - const configSpaceBounds = this.configSpaceBoundsForKey({ stackDepth: 0, zoomLevel, index: 0 }) + const configSpaceBounds = this.configSpaceBoundsForKey({stackDepth: 0, zoomLevel, index: 0}) const physicalBounds = configToPhysical.transformRect(configSpaceBounds) if (physicalBounds.width() < this.rowAtlas.getResolution()) { break @@ -320,7 +320,7 @@ export class FlamechartRenderer { for (let stackDepth = top; stackDepth < bottom; stackDepth++) { for (let index = left; index <= right; index++) { - const key = this.getOrInsertKey({ stackDepth, zoomLevel, index }) + const key = this.getOrInsertKey({stackDepth, zoomLevel, index}) const configSpaceBounds = this.configSpaceBoundsForKey(key) if (!configSpaceBounds.hasIntersectionWith(configSpaceSrcRect)) continue atlasKeysToRender.push(key) @@ -347,7 +347,7 @@ export class FlamechartRenderer { this.framebuffer.resize(physicalSpaceDstRect.width(), physicalSpaceDstRect.height()) this.framebuffer.use(context => { - this.canvasContext.gl.clear({ color: [0, 0, 0, 0] }) + this.canvasContext.gl.clear({color: [0, 0, 0, 0]}) const viewportRect = new Rect( Vec2.zero, new Vec2(context.viewportWidth, context.viewportHeight), diff --git a/flamechart-style.ts b/flamechart-style.ts index 27a3910..cac617c 100644 --- a/flamechart-style.ts +++ b/flamechart-style.ts @@ -1,5 +1,5 @@ -import { StyleSheet } from 'aphrodite' -import { FontFamily, FontSize, Colors } from './style' +import {StyleSheet} from 'aphrodite' +import {FontFamily, FontSize, Colors} from './style' const HOVERTIP_PADDING = 2 diff --git a/flamechart-view.tsx b/flamechart-view.tsx index c92b4e4..fe3aeb0 100644 --- a/flamechart-view.tsx +++ b/flamechart-view.tsx @@ -1,18 +1,18 @@ -import { h } from 'preact' -import { css } from 'aphrodite' -import { ReloadableComponent } from './reloadable' +import {h} from 'preact' +import {css} from 'aphrodite' +import {ReloadableComponent} from './reloadable' -import { CallTreeNode } from './profile' -import { Flamechart, FlamechartFrame } from './flamechart' +import {CallTreeNode} from './profile' +import {Flamechart, FlamechartFrame} from './flamechart' -import { Rect, Vec2, AffineTransform, clamp } from './math' -import { cachedMeasureTextWidth } from './utils' -import { FlamechartMinimapView } from './flamechart-minimap-view' +import {Rect, Vec2, AffineTransform, clamp} from './math' +import {cachedMeasureTextWidth} from './utils' +import {FlamechartMinimapView} from './flamechart-minimap-view' -import { style, Sizes } from './flamechart-style' -import { FontSize, FontFamily, Colors } from './style' -import { CanvasContext } from './canvas-context' -import { FlamechartRenderer } from './flamechart-renderer' +import {style, Sizes} from './flamechart-style' +import {FontSize, FontFamily, Colors} from './style' +import {CanvasContext} from './canvas-context' +import {FlamechartRenderer} from './flamechart-renderer' interface FlamechartFrameLabel { configSpaceBounds: Rect @@ -145,7 +145,7 @@ export class FlamechartPanZoomView extends ReloadableComponent { if (!this.container) return - const { width, height } = this.container.getBoundingClientRect() + const {width, height} = this.container.getBoundingClientRect() if (ev.key === '=' || ev.key === '+') { this.zoom(new Vec2(width / 2, height / 2), 0.5) @@ -681,10 +681,10 @@ export class FlamechartView extends ReloadableComponent { samples.push({ - stack: stack.split(';').map(name => ({ key: name, name: name })), + stack: stack.split(';').map(name => ({key: name, name: name})), duration: parseInt(n, 10), }) return match diff --git a/import/chrome.ts b/import/chrome.ts index 29fd9db..ea7fe83 100644 --- a/import/chrome.ts +++ b/import/chrome.ts @@ -1,5 +1,5 @@ -import { Profile, TimeFormatter, FrameInfo } from '../profile' -import { getOrInsert, lastOf } from '../utils' +import {Profile, TimeFormatter, FrameInfo} from '../profile' +import {getOrInsert, lastOf} from '../utils' interface TimelineEvent { pid: number @@ -11,7 +11,7 @@ interface TimelineEvent { dur: number tdur: number tts: number - args: { [key: string]: any } + args: {[key: string]: any} } interface PositionTickInfo { diff --git a/import/stackprof.ts b/import/stackprof.ts index 8944b9c..4fca913 100644 --- a/import/stackprof.ts +++ b/import/stackprof.ts @@ -1,6 +1,6 @@ // https://github.com/tmm1/stackprof -import { Profile, TimeFormatter, FrameInfo } from '../profile' +import {Profile, TimeFormatter, FrameInfo} from '../profile' interface StackprofFrame { name: string @@ -9,7 +9,7 @@ interface StackprofFrame { } export interface StackprofProfile { - frames: { [number: string]: StackprofFrame } + frames: {[number: string]: StackprofFrame} raw: number[] raw_timestamp_deltas: number[] } @@ -18,7 +18,7 @@ export function importFromStackprof(stackprofProfile: StackprofProfile): Profile const duration = stackprofProfile.raw_timestamp_deltas.reduce((a, b) => a + b, 0) const profile = new Profile(duration) - const { frames, raw, raw_timestamp_deltas } = stackprofProfile + const {frames, raw, raw_timestamp_deltas} = stackprofProfile let sampleIndex = 0 for (let i = 0; i < raw.length; ) { const stackHeight = raw[i++] diff --git a/lru-cache.ts b/lru-cache.ts index 53b26be..10348f8 100644 --- a/lru-cache.ts +++ b/lru-cache.ts @@ -139,7 +139,7 @@ export class LRUCache { this.map.delete(this.list.pop()!.data) } const listNode = this.list.prepend(new ListNode(key)) - this.map.set(key, { value, listNode }) + this.map.set(key, {value, listNode}) } getOrInsert(key: K, f: (key: K) => V): V { diff --git a/math.ts b/math.ts index 01b435c..63fb9d9 100644 --- a/math.ts +++ b/math.ts @@ -71,7 +71,7 @@ export class AffineTransform { ) {} withScale(s: Vec2) { - let { m00, m01, m02, m10, m11, m12 } = this + let {m00, m01, m02, m10, m11, m12} = this m00 = s.x m11 = s.y return new AffineTransform(m00, m01, m02, m10, m11, m12) @@ -87,7 +87,7 @@ export class AffineTransform { } withTranslation(t: Vec2) { - let { m00, m01, m02, m10, m11, m12 } = this + let {m00, m01, m02, m10, m11, m12} = this m02 = t.x m12 = t.y return new AffineTransform(m00, m01, m02, m10, m11, m12) @@ -131,12 +131,12 @@ export class AffineTransform { } timesScalar(s: number) { - const { m00, m01, m02, m10, m11, m12 } = this + const {m00, m01, m02, m10, m11, m12} = this return new AffineTransform(s * m00, s * m01, s * m02, s * m10, s * m11, s * m12) } det() { - const { m00, m01, m02, m10, m11, m12 } = this + const {m00, m01, m02, m10, m11, m12} = this const m20 = 0 const m21 = 0 const m22 = 1 @@ -147,7 +147,7 @@ export class AffineTransform { } adj() { - const { m00, m01, m02, m10, m11, m12 } = this + const {m00, m01, m02, m10, m11, m12} = this const m20 = 0 const m21 = 0 const m22 = 1 @@ -222,7 +222,12 @@ export class AffineTransform { flatten(): [number, number, number, number, number, number, number, number, number] { // Flatten into GLSL format - return [this.m00, this.m10, 0, this.m01, this.m11, 0, this.m02, this.m12, 1] + // prettier-ignore + return [ + this.m00, this.m10, 0, + this.m01, this.m11, 0, + this.m02, this.m12, 1, + ] } } diff --git a/overlay-rectangle-renderer.ts b/overlay-rectangle-renderer.ts index 8b23d23..9d3c8b0 100644 --- a/overlay-rectangle-renderer.ts +++ b/overlay-rectangle-renderer.ts @@ -1,5 +1,5 @@ import regl from 'regl' -import { AffineTransform, Rect } from './math' +import {AffineTransform, Rect} from './math' export interface ViewportRectangleRendererProps { configSpaceToPhysicalViewSpace: AffineTransform @@ -118,7 +118,7 @@ export class ViewportRectangleRenderer { } resetStats() { - return Object.assign(this.command.stats, { cpuTime: 0, gpuTime: 0, count: 0 }) + return Object.assign(this.command.stats, {cpuTime: 0, gpuTime: 0, count: 0}) } stats() { return this.command.stats diff --git a/prettier.config.js b/prettier.config.js index a3a29d3..814bd52 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -1,4 +1,5 @@ module.exports = { + bracketSpacing: false, printWidth: 100, semi: false, singleQuote: true, diff --git a/profile.ts b/profile.ts index 9b04b7e..f6590c8 100644 --- a/profile.ts +++ b/profile.ts @@ -1,4 +1,4 @@ -import { lastOf, getOrInsert } from './utils' +import {lastOf, getOrInsert} from './utils' const demangleCppModule = import('./demangle-cpp') // Force eager loading of the module diff --git a/rectangle-batch-renderer.ts b/rectangle-batch-renderer.ts index b1714a0..5944438 100644 --- a/rectangle-batch-renderer.ts +++ b/rectangle-batch-renderer.ts @@ -1,6 +1,6 @@ import regl from 'regl' -import { Rect, Vec2, AffineTransform } from './math' -import { Color } from './color' +import {Rect, Vec2, AffineTransform} from './math' +import {Color} from './color' export class RectangleBatch { private rectCapacity = 1000 @@ -197,7 +197,7 @@ export class RectangleBatchRenderer { } resetStats() { - return Object.assign(this.command.stats, { cpuTime: 0, gpuTime: 0, count: 0 }) + return Object.assign(this.command.stats, {cpuTime: 0, gpuTime: 0, count: 0}) } stats() { return this.command.stats diff --git a/regl.d.ts b/regl.d.ts index 190d672..8f2c906 100644 --- a/regl.d.ts +++ b/regl.d.ts @@ -370,7 +370,7 @@ declare module 'regl' { | AttributeOptions | Buffer | BufferArgs - | { constant: number | vec2 | vec3 | vec4 | mat3 | mat4 } + | {constant: number | vec2 | vec3 | vec4 | mat3 | mat4} interface Computed { (context: Context, props: P, batchId: number): T @@ -427,11 +427,11 @@ declare module 'regl' { /** Source code of fragment shader */ frag?: string - context?: { [contextName: string]: MaybeComputed } + context?: {[contextName: string]: MaybeComputed} - uniforms?: { [uniformName: string]: MaybeComputed } + uniforms?: {[uniformName: string]: MaybeComputed} - attributes?: { [attributeName: string]: MaybeComputed } + attributes?: {[attributeName: string]: MaybeComputed} primitive?: DrawMode @@ -492,8 +492,8 @@ declare module 'regl' { enable?: boolean mask?: number func?: StencilFunction - opFront?: { fail: StencilOp; zfail: StencilOp; pass: StencilOp } - opBack?: { fail: StencilOp; zfail: StencilOp; pass: StencilOp } + opFront?: {fail: StencilOp; zfail: StencilOp; pass: StencilOp} + opBack?: {fail: StencilOp; zfail: StencilOp; pass: StencilOp} } > diff --git a/reloadable.tsx b/reloadable.tsx index 06ea24a..09ebd6a 100644 --- a/reloadable.tsx +++ b/reloadable.tsx @@ -1,13 +1,13 @@ -import { Component } from 'preact' +import {Component} from 'preact' export interface SerializedComponent { state: S - serializedSubcomponents: { [key: string]: any } + serializedSubcomponents: {[key: string]: any} } export abstract class ReloadableComponent extends Component { serialize(): SerializedComponent { - const serializedSubcomponents: { [key: string]: any } = Object.create(null) + const serializedSubcomponents: {[key: string]: any} = Object.create(null) const subcomponents = this.subcomponents() for (const key in subcomponents) { @@ -34,7 +34,7 @@ export abstract class ReloadableComponent extends Component { } }) } - subcomponents(): { [key: string]: any } { + subcomponents(): {[key: string]: any} { return Object.create(null) } } diff --git a/speedscope.tsx b/speedscope.tsx index cc45623..d482591 100644 --- a/speedscope.tsx +++ b/speedscope.tsx @@ -1,5 +1,5 @@ -import { h, render } from 'preact' -import { Application } from './application' +import {h, render} from 'preact' +import {Application} from './application' let app: Application | null = null const retained = (window as any)['__retained__'] as any diff --git a/texture-catched-renderer.ts b/texture-catched-renderer.ts index 15bf667..af313b5 100644 --- a/texture-catched-renderer.ts +++ b/texture-catched-renderer.ts @@ -1,5 +1,5 @@ import regl from 'regl' -import { Vec2, Rect, AffineTransform } from './math' +import {Vec2, Rect, AffineTransform} from './math' export interface TextureRendererProps { texture: regl.Texture @@ -55,7 +55,7 @@ export class TextureRenderer { uniforms: { texture: (context, props) => props.texture, uvTransform: (context, props) => { - const { srcRect, texture } = props + const {srcRect, texture} = props const physicalToUV = AffineTransform.withTranslation(new Vec2(0, 1)) .times(AffineTransform.withScale(new Vec2(1, -1))) .times( @@ -68,7 +68,7 @@ export class TextureRenderer { return AffineTransform.betweenRects(Rect.unit, uvRect).flatten() }, positionTransform: (context, props) => { - const { dstRect } = props + const {dstRect} = props const viewportSize = new Vec2(context.viewportWidth, context.viewportHeight) @@ -91,7 +91,7 @@ export class TextureRenderer { } resetStats() { - return Object.assign(this.command.stats, { cpuTime: 0, gpuTime: 0, count: 0 }) + return Object.assign(this.command.stats, {cpuTime: 0, gpuTime: 0, count: 0}) } stats() { return this.command.stats @@ -118,7 +118,7 @@ export class TextureCachedRenderer { this.textureRenderer = options.textureRenderer this.texture = gl.texture(1, 1) - this.framebuffer = gl.framebuffer({ color: [this.texture] }) + this.framebuffer = gl.framebuffer({color: [this.texture]}) this.withContext = gl({}) } @@ -137,8 +137,8 @@ export class TextureCachedRenderer { this.texture.height !== context.viewportHeight ) { // TODO(jlfwong): Can probably just use this.framebuffer.resize - this.texture({ width: context.viewportWidth, height: context.viewportHeight }) - this.framebuffer({ color: [this.texture] }) + this.texture({width: context.viewportWidth, height: context.viewportHeight}) + this.framebuffer({color: [this.texture]}) needsRender = true } else if (this.lastRenderProps == null) { needsRender = true @@ -160,7 +160,7 @@ export class TextureCachedRenderer { }, framebuffer: this.framebuffer, })(() => { - this.gl.clear({ color: [0, 0, 0, 0] }) + this.gl.clear({color: [0, 0, 0, 0]}) this.renderUncached(props) }) }