Don't use GL_REPEAT for image-brush drawing on OpenGL ES2
authorAllan Sandfeld Jensen <allan.jensen@digia.com>
Wed, 23 Apr 2014 13:20:33 +0000 (15:20 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 25 Apr 2014 13:18:29 +0000 (15:18 +0200)
commit8ab1323842433fb6b45e7d6f381b4b9710a81da9
tree9956337e84f7b75d5ff44c56f5cd0c1e0617f175
parent8369f6d3eae93293540ab8ed6f4ff1cc444cb6be
Don't use GL_REPEAT for image-brush drawing on OpenGL ES2

Backport of commit 8dfeb1c374972f06759a92b4edc5d6a18b96ccec in QtGui
to the same class in the QtOpenGL module.

OpenGL ES2 doesn't support NPOT textures in combination with GL_REPEAT,
so for OpenGL ES2 we use a custom program that emulates repeat by taking
the fractional part of the texture coordinates.

This is not enough though, as merely setting GL_TEXTURE_WRAP_x to GL_REPEAT
with a NPOT texture is an error in some implementations, so we have to
guard the call to updateTextureFilter() in updateBrushTexture() with
a check for OpenGL ES2 and use GL_CLAMP_TO_EDGE instead.

Change-Id: Icbdd784c2c6d562849679f87da18b20d5441f389
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp