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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « gpu/command_buffer/service/feature_info_unittest.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.h » ('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 @@ void DoCopyTexImage2D(const gpu::gles2::GLES2Decoder* decoder,
GLuint source_id,
GLuint dest_id,
GLint dest_level,
+ GLenum dest_internal_format,
GLsizei width,
GLsizei height,
GLuint framebuffer) {
@@ -230,8 +231,14 @@ void DoCopyTexImage2D(const gpu::gles2::GLES2Decoder* decoder,
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 @@ void CopyTextureCHROMIUMResourceManager::DoCopyTexture(
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 | « gpu/command_buffer/service/feature_info_unittest.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698