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

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

Issue 2479513002: Reland of Extend CopyTextureCHROMIUM to more ES 3.0 texture formats. (Closed)
Patch Set: fix windows and mac bot Created 4 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
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 e6e3035c9e868ccbd11a5107ad5e919d9d4fca64..9e4925f920ebacb9944c4a386e85cb9dd9e17fde 100644
--- a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
+++ b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc
@@ -259,15 +259,15 @@ bool BindFramebufferTexture2D(GLenum target,
return true;
}
-void DoCopyTexImage2D(const gpu::gles2::GLES2Decoder* decoder,
- GLenum source_target,
- GLuint source_id,
- GLenum dest_target,
- GLuint dest_id,
- GLenum dest_internal_format,
- GLsizei width,
- GLsizei height,
- GLuint framebuffer) {
+void DoCopyTexImage2DInternal(const gpu::gles2::GLES2Decoder* decoder,
+ GLenum source_target,
+ GLuint source_id,
+ GLenum dest_target,
+ GLuint dest_id,
+ GLenum dest_internal_format,
+ GLsizei width,
+ GLsizei height,
+ GLuint framebuffer) {
DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), source_target);
DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), dest_target);
if (BindFramebufferTexture2D(source_target, source_id, framebuffer)) {
@@ -287,18 +287,18 @@ void DoCopyTexImage2D(const gpu::gles2::GLES2Decoder* decoder,
decoder->RestoreFramebufferBindings();
}
-void DoCopyTexSubImage2D(const gpu::gles2::GLES2Decoder* decoder,
- GLenum source_target,
- GLuint source_id,
- GLenum dest_target,
- GLuint dest_id,
- GLint xoffset,
- GLint yoffset,
- GLint source_x,
- GLint source_y,
- GLsizei source_width,
- GLsizei source_height,
- GLuint framebuffer) {
+void DoCopyTexSubImage2DInternal(const gpu::gles2::GLES2Decoder* decoder,
+ GLenum source_target,
+ GLuint source_id,
+ GLenum dest_target,
+ GLuint dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint source_x,
+ GLint source_y,
+ GLsizei source_width,
+ GLsizei source_height,
+ GLuint framebuffer) {
DCHECK(source_target == GL_TEXTURE_2D ||
source_target == GL_TEXTURE_RECTANGLE_ARB);
DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), dest_target);
@@ -434,15 +434,15 @@ void CopyTextureCHROMIUMResourceManager::DoCopyTexture(
if (source_target == GL_TEXTURE_2D && dest_target == GL_TEXTURE_2D &&
!flip_y && !premultiply_alpha_change &&
source_format_contain_superset_of_dest_format) {
- DoCopyTexImage2D(decoder,
- source_target,
- source_id,
- dest_target,
- dest_id,
- dest_internal_format,
- width,
- height,
- framebuffer_);
+ DoCopyTexImage2DInternal(decoder,
+ source_target,
+ source_id,
+ dest_target,
+ dest_id,
+ dest_internal_format,
+ width,
+ height,
+ framebuffer_);
return;
}
@@ -452,6 +452,27 @@ void CopyTextureCHROMIUMResourceManager::DoCopyTexture(
unpremultiply_alpha, kIdentityMatrix);
}
+void CopyTextureCHROMIUMResourceManager::DoCopyTexImage2D(
+ const gpu::gles2::GLES2Decoder* decoder,
+ GLenum source_target,
+ GLuint source_id,
+ GLenum dest_target,
+ GLuint dest_id,
+ GLenum dest_internal_format,
+ GLsizei width,
+ GLsizei height) {
+ DoCopyTexImage2DInternal(decoder,
+ source_target,
+ source_id,
+ dest_target,
+ dest_id,
+ dest_internal_format,
+ width,
+ height,
+ framebuffer_);
+ return;
+}
+
void CopyTextureCHROMIUMResourceManager::DoCopySubTexture(
const gles2::GLES2Decoder* decoder,
GLenum source_target,
@@ -495,8 +516,9 @@ void CopyTextureCHROMIUMResourceManager::DoCopySubTexture(
if (use_gl_copy_tex_sub_image_2d && source_target == GL_TEXTURE_2D &&
dest_target == GL_TEXTURE_2D && !flip_y && !premultiply_alpha_change &&
source_format_contain_superset_of_dest_format) {
- DoCopyTexSubImage2D(decoder, source_target, source_id, dest_target, dest_id,
- xoffset, yoffset, x, y, width, height, framebuffer_);
+ DoCopyTexSubImage2DInternal(decoder, source_target, source_id, dest_target,
+ dest_id, xoffset, yoffset, x, y, width, height,
+ framebuffer_);
return;
}
@@ -507,6 +529,23 @@ void CopyTextureCHROMIUMResourceManager::DoCopySubTexture(
premultiply_alpha, unpremultiply_alpha, kIdentityMatrix);
}
+void CopyTextureCHROMIUMResourceManager::DoCopyTexSubImage2D(
+ const gpu::gles2::GLES2Decoder* decoder,
+ GLenum source_target,
+ GLuint source_id,
+ GLenum dest_target,
+ GLuint dest_id,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height) {
+ DoCopyTexSubImage2DInternal(decoder, source_target, source_id, dest_target,
+ dest_id, xoffset, yoffset, x, y, width, height,
+ framebuffer_);
+}
+
void CopyTextureCHROMIUMResourceManager::DoCopySubTextureWithTransform(
const gles2::GLES2Decoder* decoder,
GLenum source_target,

Powered by Google App Engine
This is Rietveld 408576698