Skip to content

Commit

Permalink
use GL_LINEAR when scaling or when subsampling
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@3908 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jul 20, 2013
1 parent 55298ea commit c3e916f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/xpra/client/gl/gl_window_backing.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def gl_paint_yuv(self, img, x, y, enc_width, enc_height, width, height, callback
return
try:
try:
self.update_texture_yuv(x, y, enc_width, enc_height, img, pixel_format)
self.update_texture_yuv(x, y, enc_width, enc_height, img, pixel_format, scaling=(enc_width!=width or enc_height!=height))
if self.paint_screen:
# Update FBO texture
self.render_yuv_update(x, y, enc_width, enc_height, x_scale=width/enc_width, y_scale=height/enc_height)
Expand All @@ -361,7 +361,7 @@ def gl_paint_yuv(self, img, x, y, enc_width, enc_height, width, height, callback
finally:
drawable.gl_end()

def update_texture_yuv(self, x, y, width, height, img, pixel_format):
def update_texture_yuv(self, x, y, width, height, img, pixel_format, scaling=False):
assert x==0 and y==0
assert self.textures is not None, "no OpenGL textures!"
debug("update_texture_yuv(%s)", (x, y, width, height, img, pixel_format))
Expand All @@ -381,7 +381,7 @@ def update_texture_yuv(self, x, y, width, height, img, pixel_format):
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, self.textures[index])
glEnable(GL_TEXTURE_RECTANGLE_ARB)
mag_filter = GL_NEAREST
if div_w > 1 or div_h > 1:
if scaling or (div_w > 1 or div_h > 1):
mag_filter = GL_LINEAR
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, mag_filter)
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
Expand Down

0 comments on commit c3e916f

Please sign in to comment.