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..4050db9271585b09a91d76db0ba3a75608feda78 |
| --- /dev/null |
| +++ b/content/common/gpu/media/gles2_external_texture_copier.h |
| @@ -0,0 +1,48 @@ |
| +// 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 "ui/gl/gl_bindings.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/02/13 18:07:11
What's the status of using glCopyTextureChromium?
dwkang1
2013/02/14 01:38:51
I've asked it also to Gregg(gman@), and cced you,
Ami GONE FROM CHROMIUM
2013/02/14 16:43:25
I remember that thread but thought it ended w/ gma
dwkang1
2013/02/16 11:30:31
Unfortunately, CopyTextureCHROMIUMResourceManager
|
| + public: |
| + Gles2ExternalTextureCopier(); |
| + virtual ~Gles2ExternalTextureCopier(); |
| + |
| + bool Init(int32 width, int32 height); |
| + |
| + bool Copy(GLuint source_texture_id, GLuint destination_texture_id, |
| + const float transfrom_matrix[16]); |
| + |
| + 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_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(Gles2ExternalTextureCopier); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_ |