diff options
author | Nicolas Roard <nicolas@android.com> | 2010-11-03 19:49:27 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-05-05 17:06:08 -0700 |
commit | 714b8a5696d6c82268757bc6eb711eddbabc872e (patch) | |
tree | 321d08bc5a37904875bf1b16093c550f67423c6a /WebCore/platform/graphics/android/GLUtils.cpp | |
parent | 2d60bef786645e5b9e2da0e8374d3f06a40d0638 (diff) | |
download | external_webkit-714b8a5696d6c82268757bc6eb711eddbabc872e.zip external_webkit-714b8a5696d6c82268757bc6eb711eddbabc872e.tar.gz external_webkit-714b8a5696d6c82268757bc6eb711eddbabc872e.tar.bz2 |
DO NOT MERGE cursor ring drawing in GL
Cherry pick of 3 CLs:
105851, 105988, 108900
Diffstat (limited to 'WebCore/platform/graphics/android/GLUtils.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/GLUtils.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/android/GLUtils.cpp b/WebCore/platform/graphics/android/GLUtils.cpp index 23bf525..1b0d4be 100644 --- a/WebCore/platform/graphics/android/GLUtils.cpp +++ b/WebCore/platform/graphics/android/GLUtils.cpp @@ -289,6 +289,25 @@ void GLUtils::deleteTexture(GLuint* texture) *texture = 0; } +GLuint GLUtils::createSampleColorTexture(int r, int g, int b) { + GLuint texture; + glGenTextures(1, &texture); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + GLubyte pixels[4 *3] = { + r, g, b, + r, g, b, + r, g, b, + r, g, b + }; + glBindTexture(GL_TEXTURE_2D, texture); + GLUtils::checkGlError("glBindTexture"); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels); + GLUtils::checkGlError("glTexImage2D"); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + return texture; +} + GLuint GLUtils::createSampleTexture() { GLuint texture; |