Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upChange texture creation to use nearest filtering. Fixes several reftests #91
Conversation
|
Where does this actually matter? Is zooming still going to be using bilinear? |
|
Several of the reftests fail on my machine without this change - due to a single pixel border at the edge of the tile getting some bilinear filtering. This seems to be due to the way tiles are different sizes since the removal of the quadtree. I can dig a bit deeper and see if we can get pixel perfect blitting though, so we can retain the bilinear filtering, if we do need it? |
|
We should probably modify the renderer to use nearest when there is a scale of 1 and use linear otherwise. |
| @@ -530,7 +542,8 @@ impl Render for Tile { | |||
| } | |||
| } | |||
|
|
|||
| pub fn render_scene<T>(root_layer: Rc<Layer<T>>, render_context: RenderContext, scene: &Scene<T>) { | |||
| pub fn render_scene<T>(root_layer: Rc<Layer<T>>, render_context: RenderContext, | |||
| scene: &Scene<T>, has_scale: bool) { | |||
This comment has been minimized.
This comment has been minimized.
zwarich
Jul 29, 2014
Contributor
Why doesn't it suffice to get the scale from the Scene's transform?
This comment has been minimized.
This comment has been minimized.
glennw
Jul 29, 2014
Author
Member
We could do, but it's often the case that with FP accuracy the scale isn't exactly 1.0 by the time it gets to the transform matrix, so it seems safer to check it earlier.
I can change it to just extract it from the matrix though if you'd prefer.
This comment has been minimized.
This comment has been minimized.
zwarich
Jul 29, 2014
Contributor
I'd rather just extract it from the matrix. If that doesn't work in our testing config, then we probably have another bug.
Down the road if we have to do more tests of transforms we'll probably have to adopt the slightly disappointing solution of a fixed epsilon value.
This comment has been minimized.
This comment has been minimized.
| @@ -415,6 +415,16 @@ pub fn bind_and_render_quad(render_context: RenderContext, | |||
|
|
|||
| use_program(program_id); | |||
| active_texture(TEXTURE0); | |||
|
|
|||
| let has_scale = transform.m11 as uint != texture.size.width || | |||
| transform.m22 as uint != texture.size.height; | |||
This comment has been minimized.
This comment has been minimized.
zwarich
Jul 29, 2014
Contributor
Technically speaking, don't we want to check that transform is a 2D affine transform and there is no skew or nonrectilinear rotation? I'd feel cruel asking you to implement this, given that it doesn't matter right now, but can you at least add a FIXME to that effect?
This comment has been minimized.
This comment has been minimized.
glennw
Jul 29, 2014
Author
Member
Yep - which can make it tricky to extract the scale exactly. But I've added a FIXME which will do for now.
one, and linear otherwise.
Change texture creation to use nearest filtering. Fixes several reftests
glennw commentedJul 29, 2014
due to the different texture sizes that are created now with the removal
of the quadtree code.