mirror of
https://github.com/servo/servo.git
synced 2025-06-06 00:25:37 +00:00
parent
bc2f4c3450
commit
6c00058c5d
6 changed files with 42 additions and 2 deletions
|
@ -65,6 +65,6 @@ vec2 SnapToPixels(vec2 pos)
|
|||
// Snap the vertex to pixel position to guarantee correct texture
|
||||
// sampling when using bilinear filtering.
|
||||
|
||||
// TODO(gw): ES2 doesn't have round(). Do we ever get negative coords here?
|
||||
// TODO(gw): Do we ever get negative coords here?
|
||||
return floor(0.5 + pos * uDevicePixelRatio) / uDevicePixelRatio;
|
||||
}
|
||||
|
|
|
@ -62,5 +62,8 @@ vec2 SnapToPixels(vec2 pos)
|
|||
{
|
||||
// Snap the vertex to pixel position to guarantee correct texture
|
||||
// sampling when using bilinear filtering.
|
||||
return round(pos * uDevicePixelRatio) / uDevicePixelRatio;
|
||||
|
||||
// Don't use round() because its behavior is implementation-defined on 0.5.
|
||||
// TODO: Do we ever get negative coords here?
|
||||
return floor(0.5 + pos * uDevicePixelRatio) / uDevicePixelRatio;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue