| 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..3155f8e748316e0e2939a2b873c71b0c374b8491
|
| --- /dev/null
|
| +++ b/content/common/gpu/media/gles2_external_texture_copier.h
|
| @@ -0,0 +1,50 @@
|
| +// 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 {
|
| + public:
|
| + Gles2ExternalTextureCopier();
|
| + virtual ~Gles2ExternalTextureCopier();
|
| +
|
| + bool Init(int32 width, int32 height);
|
| +
|
| + bool Copy(GLuint source_texture_id, GLenum source_target,
|
| + float transfrom_matrix[16],
|
| + GLuint destination_texture_id, GLenum destination_target);
|
| +
|
| + private:
|
| + bool SetupGraphics();
|
| + void RenderFrame(int32 width, int32 height, GLuint texture_id);
|
| + 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_
|
|
|