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

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 reviewers commnets 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 a blit to a framebuffer object.
reveman 2014/07/10 18:13:18 Please update this comment. Blit to FBO is no long
dshwang 2014/07/10 19:45:34 yes, Done.
24 class GPU_EXPORT CopyTextureCHROMIUMResourceManager { 24 class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
25 public: 25 public:
26 CopyTextureCHROMIUMResourceManager(); 26 CopyTextureCHROMIUMResourceManager();
27 ~CopyTextureCHROMIUMResourceManager(); 27 ~CopyTextureCHROMIUMResourceManager();
28 28
29 void Initialize(const gles2::GLES2Decoder* decoder); 29 void Initialize(const gles2::GLES2Decoder* decoder);
30 void Destroy(); 30 void Destroy();
31 31
32 void DoCopyTexture(const gles2::GLES2Decoder* decoder, GLenum source_target, 32 void DoCopyTexture(const gles2::GLES2Decoder* decoder, GLenum source_target,
33 GLenum dest_target, GLuint source_id, GLuint dest_id, 33 GLuint source_id, GLuint dest_id, GLint level,
34 GLint level, GLsizei width, GLsizei height, 34 GLenum internal_format, GLsizei width, GLsizei height,
35 bool flip_y, bool premultiply_alpha, 35 bool flip_y, bool premultiply_alpha,
36 bool unpremultiply_alpha); 36 bool unpremultiply_alpha);
reveman 2014/07/10 18:13:18 can you "cl format" this file to clean up these pa
dshwang 2014/07/10 19:45:34 I wanted to run "cl format" but it changes many li
reveman 2014/07/10 20:20:49 Yes, I think that was a good call. Thanks.
37 37
38 // This will apply a transform on the source texture before copying to 38 // This will apply a transform on the source texture before copying to
39 // destination texture. 39 // destination texture.
40 void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder, 40 void DoCopyTextureWithTransform(const gles2::GLES2Decoder* decoder,
41 GLenum source_target, GLenum dest_target, 41 GLenum source_target, GLuint source_id,
42 GLuint source_id, GLuint dest_id, GLint level, 42 GLuint dest_id, GLint level,
43 GLenum internal_format,
43 GLsizei width, GLsizei height, bool flip_y, 44 GLsizei width, GLsizei height, bool flip_y,
44 bool premultiply_alpha, 45 bool premultiply_alpha,
45 bool unpremultiply_alpha, 46 bool unpremultiply_alpha,
46 const GLfloat transform_matrix[16]); 47 const GLfloat transform_matrix[16]);
47 48
48 // The attributes used during invocation of the extension. 49 // The attributes used during invocation of the extension.
49 static const GLuint kVertexPositionAttrib = 0; 50 static const GLuint kVertexPositionAttrib = 0;
50 51
51 private: 52 private:
52 struct ProgramInfo { 53 struct ProgramInfo {
(...skipping 18 matching lines...) Expand all
71 ProgramMap programs_; 72 ProgramMap programs_;
72 GLuint buffer_id_; 73 GLuint buffer_id_;
73 GLuint framebuffer_; 74 GLuint framebuffer_;
74 75
75 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); 76 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager);
76 }; 77 };
77 78
78 } // namespace gpu. 79 } // namespace gpu.
79 80
80 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ 81 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698