OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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_SHELL_ANDROID_DRAW_CONTEXT_H_ | |
6 #define CONTENT_SHELL_ANDROID_DRAW_CONTEXT_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/synchronization/lock.h" | |
10 #include "ui/gfx/native_widget_types.h" | |
11 | |
12 #include <GLES2/gl2.h> | |
13 | |
14 namespace content { | |
15 class GraphicsContext; | |
16 | |
17 // Helper class for drawing content textures to the UI window surface. | |
18 class DrawContext { | |
19 public: | |
20 DrawContext(ANativeWindow* window); | |
21 ~DrawContext(); | |
22 | |
23 // Draws the given texture to the UI and returns a | |
24 // SyncPoint identifier. | |
25 uint32 Draw(int texture); | |
26 | |
27 void Reshape(int width, int height); | |
28 private: | |
jam
2012/07/31 22:46:15
nit: blank line above
| |
29 // The shader program. | |
30 int program_; | |
31 int vertex_shader_; | |
32 int fragment_shader_; | |
33 | |
34 // Shader uniform locations. | |
35 int texture_uniform_; | |
36 | |
37 // The vertex attribute array used to draw a simple quad. | |
38 unsigned int vertex_buffer_; | |
39 | |
40 // The graphics context used for drawing. | |
41 scoped_ptr<content::GraphicsContext> context_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(DrawContext); | |
44 }; | |
45 | |
46 } // namespace content | |
47 | |
48 #endif // CONTENT_SHELL_ANDROID_DRAW_CONTEXT_H_ | |
OLD | NEW |