From b5fd657c0d95dbf8fe39a1676f5bfe0be765540e Mon Sep 17 00:00:00 2001 From: Sukwon Suh Date: Thu, 13 Jun 2013 11:31:09 +0900 Subject: [PATCH] fix bug in CanvasTexture::Update method Change-Id: Ia3d13740574a4731e4f7b82d979ad0e1b41271b6 Signed-off-by: Sukwon Suh --- src/graphics/opengl/FGrp_CanvasTexture.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/graphics/opengl/FGrp_CanvasTexture.cpp b/src/graphics/opengl/FGrp_CanvasTexture.cpp index b540439..0251dd1 100644 --- a/src/graphics/opengl/FGrp_CanvasTexture.cpp +++ b/src/graphics/opengl/FGrp_CanvasTexture.cpp @@ -215,8 +215,8 @@ _CanvasTexture::UpdateTexture(void) EGLContext eglContext = eglGetCurrentContext(); if (this->__eglDisplay != eglDisplay - || this->__eglSurface == eglSurface - || this->__eglContext == eglContext) + || this->__eglSurface != eglSurface + || this->__eglContext != eglContext) { needMakeCurrent = true; eglMakeCurrent(this->__eglDisplay, this->__eglSurface, this->__eglSurface, this->__eglContext); @@ -266,6 +266,11 @@ _CanvasTexture::UpdateTexture(void) _GlTexSubImage2D_2(GL_TEXTURE_2D, 0, 0, 0, __bufferInfo.width, __bufferInfo.height , __textureFormat, GL_UNSIGNED_BYTE, pPixels); } + + if (needMakeCurrent) + { + eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext); + } } }}} // Tizen::Graphics::Opengl -- 2.7.4