| 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..893e6397e96e16261fb71f70720162c847194164
|
| --- /dev/null
|
| +++ b/content/common/gpu/media/gles2_external_texture_copier.h
|
| @@ -0,0 +1,57 @@
|
| +// 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.
|
| +// TODO(dwkang): consider using CopyTextureCHROMIUMResourceManager once it
|
| +// supports GL_TEXTURE_EXTERNAL_OES.
|
| +class Gles2ExternalTextureCopier {
|
| + 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();
|
| +
|
| + void SaveState();
|
| + void RestoreState();
|
| +
|
| + 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_;
|
| +
|
| + GLuint previous_framebuffer_id_;
|
| + GLuint previous_renderbuffer_id_;
|
| + GLuint previous_texture_id_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(Gles2ExternalTextureCopier);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_
|
|
|