Template:ItemBox: Difference between revisions

Add lowGraphics flag bundling the cheap layers and a 1x icon request, so callers rendering many cards set one parameter (with help from vergir-bot LLM)
Test whether the paper blend is what keeps picture cache tiles invalid: drop it from lowGraphics (with help from vergir-bot LLM)
Line 23: Line 23:
     lowGraphics=true is the setting for callers that place dozens of cards on
     lowGraphics=true is the setting for callers that place dozens of cards on
     one page. It bundles the cheap variants below and drops the icon request to
     one page. It bundles the cheap variants below and drops the icon request to
     1:1 with the card, which is the single largest saving: at the default 160px
     1:1 with the card. The paper blend is dropped too: mix-blend-mode stops
     the browser's 2x pick exceeds the source image and it decodes the original
     WebRender caching those regions as static tiles, so every scrolled frame
     PNG rather than a thumbnail. Each piece is a render pass, a backdrop read or
     re-rasterises and re-uploads them. That is measured as ~93 ms/s of memcpy
     a texture upload the GPU would otherwise repeat for every card on screen.
     inside the render thread and ~76 picture cache invalidations per second.
-->{{#vardefine:lowGraphics|{{#ifeq:{{{lowGraphics|}}}|true|itembox-ramp-wear itembox-flat-icon itembox-force-tex-3}}}}<!--
-->{{#vardefine:lowGraphics|{{#ifeq:{{{lowGraphics|}}}|true|itembox-ramp-wear itembox-flat-icon itembox-no-texture}}}}<!--
-->{{#vardefine:iconPx|{{#ifeq:{{{lowGraphics|}}}|true|{{#expr: 80 * {{#if:{{{size|}}}|{{{size}}}|1}} }}|160}}}}<!--
-->{{#vardefine:iconPx|{{#ifeq:{{{lowGraphics|}}}|true|{{#expr: 80 * {{#if:{{{size|}}}|{{{size}}}|1}} }}|160}}}}<!--