| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_OZONE_DEMO_GL_RENDERER_H_ | 5 #ifndef UI_OZONE_DEMO_GL_RENDERER_H_ |
| 6 #define UI_OZONE_DEMO_GL_RENDERER_H_ | 6 #define UI_OZONE_DEMO_GL_RENDERER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "ui/ozone/demo/renderer_base.h" | 10 #include "ui/ozone/demo/renderer_base.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class GLContext; | 13 class GLContext; |
| 14 class GLSurface; | 14 class GLSurface; |
| 15 } // namespace gfx | 15 } // namespace gfx |
| 16 | 16 |
| 17 namespace ui { | 17 namespace ui { |
| 18 | 18 |
| 19 class GlRenderer : public RendererBase { | 19 class GlRenderer : public RendererBase { |
| 20 public: | 20 public: |
| 21 GlRenderer(gfx::AcceleratedWidget widget, const gfx::Size& size); | 21 GlRenderer(gfx::AcceleratedWidget widget, const gfx::Size& size); |
| 22 ~GlRenderer() override; | 22 ~GlRenderer() override; |
| 23 | 23 |
| 24 // Renderer: | 24 // Renderer: |
| 25 bool Initialize() override; | 25 bool Initialize() override; |
| 26 void RenderFrame() override; | 26 void RenderFrame() override; |
| 27 | 27 |
| 28 protected: | 28 protected: |
| 29 virtual scoped_refptr<gfx::GLSurface> CreateSurface(); |
| 30 |
| 29 scoped_refptr<gfx::GLSurface> surface_; | 31 scoped_refptr<gfx::GLSurface> surface_; |
| 30 scoped_refptr<gfx::GLContext> context_; | 32 scoped_refptr<gfx::GLContext> context_; |
| 31 | 33 |
| 32 DISALLOW_COPY_AND_ASSIGN(GlRenderer); | 34 DISALLOW_COPY_AND_ASSIGN(GlRenderer); |
| 33 }; | 35 }; |
| 34 | 36 |
| 35 } // namespace ui | 37 } // namespace ui |
| 36 | 38 |
| 37 #endif // UI_OZONE_DEMO_GL_RENDERER_H_ | 39 #endif // UI_OZONE_DEMO_GL_RENDERER_H_ |
| OLD | NEW |