mirror of
https://github.com/servo/servo.git
synced 2025-06-06 00:25:37 +00:00
Auto merge of #11801 - mbrubeck:snaptopix, r=pcwalton
webrender: Don't use OpenGL round() for snapping pixels Fixes #11751. See servo/webrender#294 for some details. r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11801) <!-- Reviewable:end -->
This commit is contained in:
commit
461d7c4eeb
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