Chromium Code Reviews| Index: content/common/gpu/media/gles2_external_texture_copier.h |
| diff --git a/content/common/gpu/media/gles2_external_texture_copier.h b/content/common/gpu/media/gles2_external_texture_copier.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2e3c9e8faedd22aeb1f8ebbd6f444c382d89dce1 |
| --- /dev/null |
| +++ b/content/common/gpu/media/gles2_external_texture_copier.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_ |
| +#define CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "third_party/angle/include/GLES2/gl2.h" |
| +#include "third_party/angle/include/GLES2/gl2ext.h" |
| + |
| +namespace content { |
| + |
| +// A utility class which copies the given external texture |
| +// (GL_TEXTURE_EXTERNAL_OES) to the target texture (GL_TEXTURE_2D) by using |
| +// framebuffer. |
| +class Gles2ExternalTextureCopier { |
|
Ami GONE FROM CHROMIUM
2013/01/23 01:32:32
Can this class be more or less replaced with a cal
dwkang1
2013/01/28 14:54:30
IIRC, it looks like a call which is supposed to be
|
| + public: |
| + Gles2ExternalTextureCopier(); |
| + virtual ~Gles2ExternalTextureCopier(); |
| + |
| + bool Init(int32 width, int32 height); |
| + |
| + bool Copy(GLuint source_texture_id, GLenum source_target, |
| + const float transfrom_matrix[16], |
| + GLuint destination_texture_id, GLenum destination_target); |
|
Ami GONE FROM CHROMIUM
2013/01/23 01:32:32
Drop the _target params as they are specified cons
dwkang1
2013/01/28 14:54:30
Done.
|
| + |
| + private: |
| + bool SetupGraphics(); |
| + void RenderFrame(int32 width, int32 height, GLuint texture_id, |
| + const float transfrom_matrix[16]); |
| + bool SetupFrameBuffer(); |
| + |
| + bool initialized_; |
| + int32 width_; |
| + int32 height_; |
| + GLuint framebuffer_id_; |
| + GLuint renderbuffer_id_; |
| + GLuint program_; |
| + GLuint position_handle_; |
| + GLuint st_matrix_handle_; |
| + GLuint mvp_matrix_handle_; |
| + GLuint texture_handle_; |
| + GLfloat st_matrix_[16]; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(Gles2ExternalTextureCopier); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_ |