OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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_COMMON_GPU_MEDIA_GL_RENDERER_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_GL_RENDERER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "ui/gfx/geometry/size.h" |
| 11 #include "ui/gfx/native_widget_types.h" |
| 12 |
| 13 namespace gfx { |
| 14 class GLContext; |
| 15 class GLSurface; |
| 16 } // namespace gfx |
| 17 |
| 18 namespace content { |
| 19 |
| 20 class GlRenderer { |
| 21 public: |
| 22 GlRenderer(gfx::AcceleratedWidget widget, const gfx::Size& size); |
| 23 virtual ~GlRenderer(); |
| 24 |
| 25 virtual bool Initialize(); |
| 26 virtual bool MakeCurrent(); |
| 27 virtual void SwapBuffers(); |
| 28 virtual bool IsFlipped(); |
| 29 |
| 30 virtual void BindFramebuffer(uint32_t fbo); |
| 31 virtual void UnbindFramebuffer(); |
| 32 |
| 33 scoped_refptr<gfx::GLContext> gl_context() const { return context_; } |
| 34 scoped_refptr<gfx::GLSurface> gl_surface() const { return surface_; } |
| 35 |
| 36 protected: |
| 37 scoped_refptr<gfx::GLSurface> surface_; |
| 38 scoped_refptr<gfx::GLContext> context_; |
| 39 |
| 40 gfx::AcceleratedWidget widget_; |
| 41 gfx::Size size_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(GlRenderer); |
| 44 }; |
| 45 |
| 46 } // namespace content |
| 47 |
| 48 #endif // CONTENT_COMMON_GPU_MEDIA_GL_RENDERER_H_ |
OLD | NEW |