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

Unified Diff: content/shell/android/draw_context.h

Issue 10823051: ContentShell rendering support on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address jam's comments Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/android/graphics_context.h ('k') | content/shell/android/draw_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/android/draw_context.h
diff --git a/content/shell/android/draw_context.h b/content/shell/android/draw_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6f5094f5399eedf61a7e7e25a24ee9ba644a7e6
--- /dev/null
+++ b/content/shell/android/draw_context.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2012 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_SHELL_ANDROID_DRAW_CONTEXT_H_
+#define CONTENT_SHELL_ANDROID_DRAW_CONTEXT_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/lock.h"
+#include "ui/gfx/native_widget_types.h"
+
+#include <GLES2/gl2.h>
+
+namespace content {
+class GraphicsContext;
+
+// Helper class for drawing content textures to the UI window surface.
+class DrawContext {
+ public:
+ DrawContext(ANativeWindow* window);
+ ~DrawContext();
+
+ // Draws the given texture to the UI and returns a
+ // SyncPoint identifier.
+ uint32 Draw(int texture);
+
+ void Reshape(int width, int height);
+
+ private:
+ // The shader program.
+ int program_;
+ int vertex_shader_;
+ int fragment_shader_;
+
+ // Shader uniform locations.
+ int texture_uniform_;
+
+ // The vertex attribute array used to draw a simple quad.
+ unsigned int vertex_buffer_;
+
+ // The graphics context used for drawing.
+ scoped_ptr<content::GraphicsContext> context_;
+
+ DISALLOW_COPY_AND_ASSIGN(DrawContext);
+};
+
+} // namespace content
+
+#endif // CONTENT_SHELL_ANDROID_DRAW_CONTEXT_H_
« no previous file with comments | « content/public/browser/android/graphics_context.h ('k') | content/shell/android/draw_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698