Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Side by Side Diff: content/common/gpu/media/gles2_external_texture_copier.h

Issue 11973010: AndroidVDA by using Android's MediaCodec API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using CopyTextureCHROMIUMResourceManager Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_
6 #define CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_
7
8 #include "base/basictypes.h"
9 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h"
10 #include "ui/gl/gl_bindings.h"
11
12 namespace content {
13
14 // A utility class which copies the given external texture
15 // (GL_TEXTURE_EXTERNAL_OES) to the target texture (GL_TEXTURE_2D).
16 class Gles2ExternalTextureCopier {
17 public:
18 Gles2ExternalTextureCopier(int32 width, int32 height);
19 virtual ~Gles2ExternalTextureCopier();
20
21 bool Copy(GLuint source_texture_id, GLuint destination_texture_id_);
22
23 private:
24 void SaveState();
25 void RestoreState();
26 void SaveStateForAttrib(GLuint attrib, int index);
27 void RestoreStateForAttrib(GLuint attrib, int index);
28
29 int32 width_;
30 int32 height_;
31
32 GLint previous_framebuffer_id_;
33 GLint previous_renderbuffer_id_;
34 GLint previous_texture_2d_id_;
35 GLint previous_program_;
36 GLint previous_viewport_[4];
37 GLint vertex_array_buffer_binding_;
38 GLint index_array_buffer_binding_;
39
40 struct {
41 GLint enabled;
42 GLint size;
43 GLint type;
44 GLint normalized;
45 GLint stride;
46 GLvoid* pointer;
47 } previous_vertex_attrib_[2];
48
49 CopyTextureCHROMIUMResourceManager copier_;
50
51 DISALLOW_COPY_AND_ASSIGN(Gles2ExternalTextureCopier);
52 };
53
54 } // namespace content
55
56 #endif // CONTENT_COMMON_GPU_MEDIA_GLES2_EXTERNAL_TEXTURE_COPIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698