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

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

Issue 2479513002: Reland of Extend CopyTextureCHROMIUM to more ES 3.0 texture formats. (Closed)
Patch Set: fix compressed formats Created 4 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
Index: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h
diff --git a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h
index dd705323badecb1833e85a8da0353fb8b1dbd7f3..e8664b1a4449bd3da46c57395e9e6046475d4461 100644
--- a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h
+++ b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h
@@ -18,6 +18,28 @@ namespace gles2 {
class GLES2Decoder;
+enum CopyTextureMethod {
+ // Use CopyTex{Sub}Image2D to copy from the source to the destination.
+ DIRECT_COPY,
+ // Draw from the source to the destination texture.
+ DIRECT_DRAW,
+ // Draw to an intermediate texture, and then copy to the destination texture.
+ DRAW_AND_COPY,
+ // CopyTexture isn't available.
+ NOT_COPYABLE
+};
+
+// TODOs(qiankun.miao@intel.com):
+// 1. Add readback path for RGB9_E5 and float formats (if extension isn't
+// available and they are not color-renderable).
+// 2. Support faces of cube map texture as valid dest target. The cube map
+// texture may be incomplete currently.
+// 3. Add support for levels other than 0.
+// 4. Support ALPHA, LUMINANCE and LUMINANCE_ALPHA formats on core profile.
+// 5. Update the extension doc after the whole work is done
+// in gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt. We probably
+// will need a ES2 version and a ES3 version.
+
// This class encapsulates the resources required to implement the
// GL_CHROMIUM_copy_texture extension. The copy operation is performed
// via glCopyTexImage2D() or a blit to a framebuffer object.
@@ -42,7 +64,8 @@ class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
GLsizei height,
bool flip_y,
bool premultiply_alpha,
- bool unpremultiply_alpha);
+ bool unpremultiply_alpha,
+ CopyTextureMethod method);
void DoCopySubTexture(const gles2::GLES2Decoder* decoder,
GLenum source_target,
@@ -63,7 +86,8 @@ class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
GLsizei source_height,
bool flip_y,
bool premultiply_alpha,
- bool unpremultiply_alpha);
+ bool unpremultiply_alpha,
+ CopyTextureMethod method);
void DoCopySubTextureWithTransform(const gles2::GLES2Decoder* decoder,
GLenum source_target,
@@ -94,8 +118,10 @@ class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder,
GLenum source_target,
GLuint source_id,
+ GLenum source_format,
GLenum dest_target,
GLuint dest_id,
+ GLenum dest_format,
GLsizei width,
GLsizei height,
bool flip_y,
@@ -136,8 +162,10 @@ class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
void DoCopyTextureInternal(const gles2::GLES2Decoder* decoder,
GLenum source_target,
GLuint source_id,
+ GLenum source_format,
GLenum dest_target,
GLuint dest_id,
+ GLenum dest_format,
GLint xoffset,
GLint yoffset,
GLint x,

Powered by Google App Engine
This is Rietveld 408576698