Add ICU message format support
[chromium-blink-merge.git] / ui / ozone / demo / surfaceless_gl_renderer.h
blob1563a856124a1361b9e4a54b5c7aaeb556596bdd
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
3 // found in the LICENSE file.
5 #ifndef UI_OZONE_DEMO_SURFACELESS_GL_RENDERER_H_
6 #define UI_OZONE_DEMO_SURFACELESS_GL_RENDERER_H_
8 #include "ui/ozone/demo/gl_renderer.h"
10 namespace gfx {
11 class GLImage;
12 } // namespace gfx
14 namespace ui {
16 class SurfacelessGlRenderer : public GlRenderer {
17 public:
18 SurfacelessGlRenderer(gfx::AcceleratedWidget widget, const gfx::Size& size);
19 ~SurfacelessGlRenderer() override;
21 // Renderer:
22 bool Initialize() override;
24 private:
25 // GlRenderer:
26 void RenderFrame() override;
27 scoped_refptr<gfx::GLSurface> CreateSurface() override;
29 class BufferWrapper {
30 public:
31 BufferWrapper();
32 ~BufferWrapper();
34 bool Initialize(gfx::AcceleratedWidget widget, const gfx::Size& size);
35 void BindFramebuffer();
36 void SchedulePlane();
38 private:
39 gfx::AcceleratedWidget widget_ = gfx::kNullAcceleratedWidget;
40 gfx::Size size_;
42 scoped_refptr<gfx::GLImage> image_;
43 unsigned int gl_fb_ = 0;
44 unsigned int gl_tex_ = 0;
47 BufferWrapper buffers_[2];
48 int back_buffer_ = 0;
50 base::WeakPtrFactory<SurfacelessGlRenderer> weak_ptr_factory_;
52 DISALLOW_COPY_AND_ASSIGN(SurfacelessGlRenderer);
55 } // namespace ui
57 #endif // UI_OZONE_DEMO_SURFACELESS_GL_RENDERER_H_