Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc

Issue 760173002: Revert of gpu: fix CopyTextureCHROMIUM for immutable texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
index 49bba9b49de15d8c691c0c5a99253c2555b7b22e..ffb9370bca76f071a1a3619a96e9a858007bafda 100644
--- a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
+++ b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
@@ -218,6 +218,7 @@
GLuint source_id,
GLuint dest_id,
GLint dest_level,
+ GLenum dest_internal_format,
GLsizei width,
GLsizei height,
GLuint framebuffer) {
@@ -230,8 +231,14 @@
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glCopyTexSubImage2D(GL_TEXTURE_2D, dest_level, 0 /* xoffset */,
- 0 /* yoffset */, 0 /* x */, 0 /* y */, width, height);
+ glCopyTexImage2D(GL_TEXTURE_2D,
+ dest_level,
+ dest_internal_format,
+ 0 /* x */,
+ 0 /* y */,
+ width,
+ height,
+ 0 /* border */);
}
decoder->RestoreTextureState(source_id);
@@ -325,15 +332,16 @@
bool source_format_contain_superset_of_dest_format =
source_internal_format == dest_internal_format ||
(source_internal_format == GL_RGBA && dest_internal_format == GL_RGB);
- bool source_target_allowed = source_target == GL_TEXTURE_2D ||
- source_target == GL_TEXTURE_RECTANGLE_ARB;
- if (source_target_allowed && !flip_y && !premultiply_alpha_change &&
+ // GL_TEXTURE_RECTANGLE_ARB on FBO is supported by OpenGL, not GLES2,
+ // so restrict this to GL_TEXTURE_2D.
+ if (source_target == GL_TEXTURE_2D && !flip_y && !premultiply_alpha_change &&
source_format_contain_superset_of_dest_format) {
DoCopyTexImage2D(decoder,
source_target,
source_id,
dest_id,
dest_level,
+ dest_internal_format,
width,
height,
framebuffer_);
« no previous file with comments | « no previous file | gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698