summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2012-04-11 15:40:20 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2012-04-11 15:55:36 -0700
commit9b0332227d1f5d644e78f417c54ae1ec86ecaa1c (patch)
tree38b7f49c62a7f5d4568b2a1c660e2586999919c6
parent9c2247ca3b85ced69521299cc63d666b2eefe782 (diff)
downloadexternal_webkit-9b0332227d1f5d644e78f417c54ae1ec86ecaa1c.zip
external_webkit-9b0332227d1f5d644e78f417c54ae1ec86ecaa1c.tar.gz
external_webkit-9b0332227d1f5d644e78f417c54ae1ec86ecaa1c.tar.bz2
We shall restore the FBO id instead of setting it back to 0.
bug:6283539 Change-Id: I84b8d5e0a984cb98cedc43d755b04be521d675ca
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp10
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp4
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TransferQueue.h1
3 files changed, 3 insertions, 12 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
index 26bd55d..9435065 100644
--- a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
@@ -578,16 +578,6 @@ void GLUtils::createTextureWithBitmap(GLuint texture, const SkBitmap& bitmap, GL
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
-
- // The following is a workaround -- remove when EGLImage texture upload is fixed.
- GLuint fboID;
- glGenFramebuffers(1, &fboID);
- glBindFramebuffer(GL_FRAMEBUFFER, fboID);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
- glCheckFramebufferStatus(GL_FRAMEBUFFER); // should return GL_FRAMEBUFFER_COMPLETE
-
- glBindFramebuffer(GL_FRAMEBUFFER, 0); // rebind the standard FBO
- glDeleteFramebuffers(1, &fboID);
}
void GLUtils::updateTextureWithBitmap(GLuint texture, const SkBitmap& bitmap,
diff --git a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp
index ec0d9e7..5ede167 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp
@@ -203,7 +203,6 @@ void TransferQueue::blitTileFromQueue(GLuint fboID, TileTexture* destTex,
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
ALOGV("Error: glCheckFramebufferStatus failed");
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
return;
}
@@ -426,7 +425,6 @@ void TransferQueue::updateDirtyTiles()
// dynamic switch possible. Moving this out from the loop can save some
// milli-seconds.
if (usedFboForUpload) {
- glBindFramebuffer(GL_FRAMEBUFFER, 0); // rebind the standard FBO
restoreGLState();
GLUtils::checkGlError("updateDirtyTiles");
}
@@ -593,6 +591,7 @@ void TransferQueue::cleanupPendingDiscard()
void TransferQueue::saveGLState()
{
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, m_GLStateBeforeBlit.bufferId);
glGetIntegerv(GL_VIEWPORT, m_GLStateBeforeBlit.viewport);
glGetBooleanv(GL_SCISSOR_TEST, m_GLStateBeforeBlit.scissor);
glGetBooleanv(GL_DEPTH_TEST, m_GLStateBeforeBlit.depth);
@@ -616,6 +615,7 @@ void TransferQueue::setGLStateForCopy(int width, int height)
void TransferQueue::restoreGLState()
{
+ glBindFramebuffer(GL_FRAMEBUFFER, m_GLStateBeforeBlit.bufferId[0]);
glViewport(m_GLStateBeforeBlit.viewport[0],
m_GLStateBeforeBlit.viewport[1],
m_GLStateBeforeBlit.viewport[2],
diff --git a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.h b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.h
index 65ff116..d1024a4 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.h
+++ b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.h
@@ -40,6 +40,7 @@ class Tile;
class TileTexture;
struct GLState {
+ GLint bufferId[1];
GLint viewport[4];
GLboolean scissor[1];
GLboolean depth[1];