Index: content/common/gpu/media/gl_renderer.h |
diff --git a/content/common/gpu/media/gl_renderer.h b/content/common/gpu/media/gl_renderer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a82f904b3fca6bca673f39a79f7855d824fc69a5 |
--- /dev/null |
+++ b/content/common/gpu/media/gl_renderer.h |
@@ -0,0 +1,48 @@ |
+// Copyright 2014 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_COMMON_GPU_MEDIA_GL_RENDERER_H_ |
+#define CONTENT_COMMON_GPU_MEDIA_GL_RENDERER_H_ |
+ |
+#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
+#include "ui/gfx/geometry/size.h" |
+#include "ui/gfx/native_widget_types.h" |
+ |
+namespace gfx { |
+class GLContext; |
+class GLSurface; |
+} // namespace gfx |
+ |
+namespace content { |
+ |
+class GlRenderer { |
+ public: |
+ GlRenderer(gfx::AcceleratedWidget widget, const gfx::Size& size); |
+ virtual ~GlRenderer(); |
+ |
+ virtual bool Initialize(); |
+ virtual bool MakeCurrent(); |
+ virtual void SwapBuffers(); |
+ virtual bool IsFlipped(); |
+ |
+ virtual void BindFramebuffer(uint32_t fbo); |
+ virtual void UnbindFramebuffer(); |
+ |
+ scoped_refptr<gfx::GLContext> gl_context() const { return context_; } |
+ scoped_refptr<gfx::GLSurface> gl_surface() const { return surface_; } |
+ |
+ protected: |
+ scoped_refptr<gfx::GLSurface> surface_; |
+ scoped_refptr<gfx::GLContext> context_; |
+ |
+ gfx::AcceleratedWidget widget_; |
+ gfx::Size size_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(GlRenderer); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_GPU_MEDIA_GL_RENDERER_H_ |