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 |
| 29 private: |
| 30 // The shader program. |
| 31 int program_; |
| 32 int vertex_shader_; |
| 33 int fragment_shader_; |
| 34 |
| 35 // Shader uniform locations. |
| 36 int texture_uniform_; |
| 37 |
| 38 // The vertex attribute array used to draw a simple quad. |
| 39 unsigned int vertex_buffer_; |
| 40 |
| 41 // The graphics context used for drawing. |
| 42 scoped_ptr<content::GraphicsContext> context_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(DrawContext); |
| 45 }; |
| 46 |
| 47 } // namespace content |
| 48 |
| 49 #endif // CONTENT_SHELL_ANDROID_DRAW_CONTEXT_H_ |
OLD | NEW |