OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ |
| 7 |
| 8 #include "gpu/command_buffer/service/gl_utils.h" |
| 9 |
| 10 // This class encapsulates the resources required to implement the |
| 11 // GL_CHROMIUM_copy_texture extension. The copy operation is performed |
| 12 // via a blit to a framebuffer object. |
| 13 class CopyTextureCHROMIUMResourceManager { |
| 14 public: |
| 15 CopyTextureCHROMIUMResourceManager() {} |
| 16 ~CopyTextureCHROMIUMResourceManager(); |
| 17 |
| 18 void Initialize(); |
| 19 |
| 20 void DoCopyTexture(GLenum target,GLuint source_id, GLuint dest_id, |
| 21 GLint level, bool flip_y, bool premultiply_alpha); |
| 22 |
| 23 private: |
| 24 void FreeResources(); |
| 25 |
| 26 static const int kNumShaders = 5; |
| 27 static const int kNumPrograms = 4; |
| 28 GLuint shaders_[kNumShaders]; |
| 29 GLuint programs_[kNumPrograms]; |
| 30 GLuint buffer_ids_[2]; |
| 31 GLuint framebuffer_; |
| 32 |
| 33 GLuint position_locations_[kNumPrograms]; |
| 34 GLuint texture_coordinate_locations_[kNumPrograms]; |
| 35 GLuint sampler_locations_[kNumPrograms]; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); |
| 38 }; |
| 39 |
| 40 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ |
OLD | NEW |