Skip to content

Commit

Permalink
Bug 1621212 - Don't default to square texture cache pages when the sm…
Browse files Browse the repository at this point in the history
…allest extent is 32 pixels or less. r=gw

The code that picks the texture cache slab size does not consider snapped extents under 64 pixels for rectangular pages, causing for example a 16x500 request to go into a 512x512 page.
This commit allows very thin requests to get a 64x512 page.

Differential Revision: https://phabricator.services.mozilla.com/D66187

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/03f0fbdc04416190d45e13e9aa67d9895db8240e
  • Loading branch information
nical authored and github-sync committed Mar 11, 2020
1 parent daabdde commit d5ace07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webrender/src/texture_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1483,12 +1483,12 @@ impl SlabSize {

let (width, height) = match (x_size, y_size) {
// Special cased rectangular slab pages.
(512, 256) => (512, 256),
(512, 0..=64) => (512, 64),
(512, 128) => (512, 128),
(512, 64) => (512, 64),
(256, 512) => (256, 512),
(512, 256) => (512, 256),
(0..=64, 512) => (64, 512),
(128, 512) => (128, 512),
( 64, 512) => ( 64, 512),
(256, 512) => (256, 512),

// If none of those fit, use a square slab size.
(x_size, y_size) => {
Expand Down

0 comments on commit d5ace07

Please sign in to comment.