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

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

Issue 2656563002: Support cube map dest target for CopyTextureCHROMIUM extension (Closed)
Patch Set: fix nits Created 3 years, 11 months 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
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 6c2986a06d4548ae18e3847bb3dd3a8c91089a69..9720bc989c4825cde670e3934cc9f6642b71bbc9 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -16412,13 +16412,16 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
// then copy from the fbo to dest texture level with glCopyTexImage2D.
// For WebGL 1.0 or OpenGL ES 2.0, DIRECT_DRAW path isn't available for
// dest_level > 0 due to level > 0 isn't supported by glFramebufferTexture2D
- // in ES2 context. Go to DRAW_AND_COPY path in this case.
+ // in ES2 context. DIRECT_DRAW path isn't available for cube map dest texture
+ // either due to it may be cube map incomplete. Go to DRAW_AND_COPY path in
+ // these cases.
// TODO(qiankun.miao@intel.com): for WebGL 2.0 or OpenGL ES 3.0, both
// DIRECT_DRAW path for dest_level > 0 and DIRECT_COPY path for source_level >
// 0 are not available due to a framebuffer completeness bug:
// crbug.com/678526. Once the bug is fixed, the limitation for WebGL 2.0 and
// OpenGL ES 3.0 can be lifted.
- if ((dest_level > 0 && method == DIRECT_DRAW) ||
+ if (((dest_level > 0 || dest_binding_target == GL_TEXTURE_CUBE_MAP) &&
+ method == DIRECT_DRAW) ||
(source_level > 0 && method == DIRECT_COPY)) {
method = DRAW_AND_COPY;
}
@@ -16676,13 +16679,16 @@ void GLES2DecoderImpl::DoCopySubTextureCHROMIUM(
// then copy from the fbo to dest texture level with glCopyTexImage2D.
// For WebGL 1.0 or OpenGL ES 2.0, DIRECT_DRAW path isn't available for
// dest_level > 0 due to level > 0 isn't supported by glFramebufferTexture2D
- // in ES2 context. Go to DRAW_AND_COPY path in this case.
+ // in ES2 context. DIRECT_DRAW path isn't available for cube map dest texture
+ // either due to it may be cube map incomplete. Go to DRAW_AND_COPY path in
+ // these cases.
// TODO(qiankun.miao@intel.com): for WebGL 2.0 or OpenGL ES 3.0, both
// DIRECT_DRAW path for dest_level > 0 and DIRECT_COPY path for source_level >
// 0 are not available due to a framebuffer completeness bug:
// crbug.com/678526. Once the bug is fixed, the limitation for WebGL 2.0 and
// OpenGL ES 3.0 can be lifted.
- if ((dest_level > 0 && method == DIRECT_DRAW) ||
+ if (((dest_level > 0 || dest_binding_target == GL_TEXTURE_CUBE_MAP) &&
+ method == DIRECT_DRAW) ||
(source_level > 0 && method == DIRECT_COPY)) {
method = DRAW_AND_COPY;
}

Powered by Google App Engine
This is Rietveld 408576698