OLD | NEW |
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 "gpu/command_buffer/service/gl_utils.h" | 8 #include "gpu/command_buffer/service/gl_utils.h" |
9 | 9 |
10 // This class encapsulates the resources required to implement the | 10 // This class encapsulates the resources required to implement the |
11 // GL_CHROMIUM_copy_texture extension. The copy operation is performed | 11 // GL_CHROMIUM_copy_texture extension. The copy operation is performed |
12 // via a blit to a framebuffer object. | 12 // via a blit to a framebuffer object. |
13 class CopyTextureCHROMIUMResourceManager { | 13 class CopyTextureCHROMIUMResourceManager { |
14 public: | 14 public: |
15 CopyTextureCHROMIUMResourceManager() : initialized_(false) {} | 15 CopyTextureCHROMIUMResourceManager() : initialized_(false) {} |
16 | 16 |
17 void Initialize(); | 17 void Initialize(); |
18 void Destroy(); | 18 void Destroy(); |
19 | 19 |
20 void DoCopyTexture(GLenum target, GLuint source_id, GLuint dest_id, | 20 void DoCopyTexture(GLenum target, GLuint source_id, GLuint dest_id, |
21 GLint level, bool flip_y, bool premultiply_alpha, | 21 GLint level, bool flip_y, bool premultiply_alpha, |
22 bool unpremultiply_alpha); | 22 bool unpremultiply_alpha, bool is_source_external_oes); |
23 | 23 |
24 // The attributes used during invocation of the extension. | 24 // The attributes used during invocation of the extension. |
25 static const GLuint kVertexPositionAttrib = 0; | 25 static const GLuint kVertexPositionAttrib = 0; |
26 static const GLuint kVertexTextureAttrib = 1; | 26 static const GLuint kVertexTextureAttrib = 1; |
27 | 27 |
28 private: | 28 private: |
29 bool initialized_; | 29 bool initialized_; |
30 | 30 |
31 static const int kNumPrograms = 6; | 31 static const int kNumPrograms = 12; |
32 GLuint programs_[kNumPrograms]; | 32 GLuint programs_[kNumPrograms]; |
33 GLuint buffer_ids_[2]; | 33 GLuint buffer_ids_[2]; |
34 GLuint framebuffer_; | 34 GLuint framebuffer_; |
35 GLuint sampler_locations_[kNumPrograms]; | 35 GLuint sampler_locations_[kNumPrograms]; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); | 37 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); |
38 }; | 38 }; |
39 | 39 |
40 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ | 40 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ |
41 | 41 |
42 | 42 |
OLD | NEW |