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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h

Issue 374193002: gpu: Optimize and cleanup code used for CHROMIUM_copy_texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
11 #include "gpu/command_buffer/service/gl_utils.h" 11 #include "gpu/command_buffer/service/gl_utils.h"
12 #include "gpu/gpu_export.h" 12 #include "gpu/gpu_export.h"
13 13
14 namespace gpu { 14 namespace gpu {
15 namespace gles2 { 15 namespace gles2 {
16 16
17 class GLES2Decoder; 17 class GLES2Decoder;
18 18
19 } // namespace gles2. 19 } // namespace gles2.
20 20
21 // This class encapsulates the resources required to implement the 21 // This class encapsulates the resources required to implement the
22 // GL_CHROMIUM_copy_texture extension. The copy operation is performed 22 // GL_CHROMIUM_copy_texture extension. The copy operation is performed
23 // via a blit to a framebuffer object. 23 // via glCopyTexImage2D() or a blit to a framebuffer object.
24 // The target of |dest_id| texture must be GL_TEXTURE_2D.
24 class GPU_EXPORT CopyTextureCHROMIUMResourceManager { 25 class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
25 public: 26 public:
26 CopyTextureCHROMIUMResourceManager(); 27 CopyTextureCHROMIUMResourceManager();
27 ~CopyTextureCHROMIUMResourceManager(); 28 ~CopyTextureCHROMIUMResourceManager();
28 29
29 void Initialize(const gles2::GLES2Decoder* decoder); 30 void Initialize(const gles2::GLES2Decoder* decoder);
30 void Destroy(); 31 void Destroy();
31 32
32 void DoCopyTexture(const gles2::GLES2Decoder* decoder, GLenum source_target, 33 void DoCopyTexture(const gles2::GLES2Decoder* decoder,
33 GLenum dest_target, GLuint source_id, GLuint dest_id, 34 GLenum source_target,
34 GLint level, GLsizei width, GLsizei height, 35 GLuint source_id,
35 bool flip_y, bool premultiply_alpha, 36 GLuint dest_id,
37 GLint dest_level,
38 GLenum dest_internal_format,
39 GLsizei width,
40 GLsizei height,
41 bool flip_y,
42 bool premultiply_alpha,
36 bool unpremultiply_alpha); 43 bool unpremultiply_alpha);
37 44
38 // This will apply a transform on the source texture before copying to 45 // This will apply a transform on the source texture before copying to
39 // destination texture. 46 // destination texture.
40 void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder, 47 void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder,
41 GLenum source_target, GLenum dest_target, 48 GLenum source_target,
42 GLuint source_id, GLuint dest_id, GLint level, 49 GLuint source_id,
43 GLsizei width, GLsizei height, bool flip_y, 50 GLuint dest_id,
51 GLint dest_level,
dshwang 2014/07/10 22:08:22 DoCopyTextureWithTransform don't need |dest_intern
52 GLsizei width,
53 GLsizei height,
54 bool flip_y,
44 bool premultiply_alpha, 55 bool premultiply_alpha,
45 bool unpremultiply_alpha, 56 bool unpremultiply_alpha,
46 const GLfloat transform_matrix[16]); 57 const GLfloat transform_matrix[16]);
47 58
48 // The attributes used during invocation of the extension. 59 // The attributes used during invocation of the extension.
49 static const GLuint kVertexPositionAttrib = 0; 60 static const GLuint kVertexPositionAttrib = 0;
50 61
51 private: 62 private:
52 struct ProgramInfo { 63 struct ProgramInfo {
53 ProgramInfo() 64 ProgramInfo()
(...skipping 17 matching lines...) Expand all
71 ProgramMap programs_; 82 ProgramMap programs_;
72 GLuint buffer_id_; 83 GLuint buffer_id_;
73 GLuint framebuffer_; 84 GLuint framebuffer_;
74 85
75 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); 86 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager);
76 }; 87 };
77 88
78 } // namespace gpu. 89 } // namespace gpu.
79 90
80 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ 91 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698