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

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: 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
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..26f09d306edcc2515f8dbccb0a75f267bf40703e
--- /dev/null
+++ b/content/shell/android/draw_context.h
@@ -0,0 +1,47 @@
+// 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 {
jam 2012/07/27 20:46:29 nit: all new code in content should be in the cont
no sievers 2012/07/31 01:28:44 Done.
+ 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);
+};
+
+#endif // CONTENT_SHELL_ANDROID_DRAW_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698