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

Side by Side Diff: ui/ozone/demo/surfaceless_gl_renderer.h

Issue 1258713002: ozone: unify GpuMemoryBufferFactoryOzoneNativePixmap in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix linux_chromium_gn_dgb build Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « ui/ozone/demo/ozone_demos.gyp ('k') | ui/ozone/demo/surfaceless_gl_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SURFACELESS_GL_RENDERER_H_ 5 #ifndef UI_OZONE_DEMO_SURFACELESS_GL_RENDERER_H_
6 #define UI_OZONE_DEMO_SURFACELESS_GL_RENDERER_H_ 6 #define UI_OZONE_DEMO_SURFACELESS_GL_RENDERER_H_
7 7
8 #include "ui/ozone/demo/gl_renderer.h" 8 #include "ui/ozone/demo/gl_renderer.h"
9 9
10 namespace gfx { 10 namespace gfx {
11 class GLImage; 11 class GLImage;
12 } // namespace gfx 12 } // namespace gfx
13 13
14 namespace ui { 14 namespace ui {
15 15
16 class GpuMemoryBufferFactoryOzoneNativePixmap;
17
18 class SurfacelessGlRenderer : public GlRenderer { 16 class SurfacelessGlRenderer : public GlRenderer {
19 public: 17 public:
20 SurfacelessGlRenderer( 18 SurfacelessGlRenderer(gfx::AcceleratedWidget widget, const gfx::Size& size);
21 gfx::AcceleratedWidget widget,
22 const gfx::Size& size,
23 GpuMemoryBufferFactoryOzoneNativePixmap* buffer_factory);
24 ~SurfacelessGlRenderer() override; 19 ~SurfacelessGlRenderer() override;
25 20
26 // Renderer: 21 // Renderer:
27 bool Initialize() override; 22 bool Initialize() override;
28 23
29 private: 24 private:
30 // GlRenderer: 25 // GlRenderer:
31 void RenderFrame() override; 26 void RenderFrame() override;
32 scoped_refptr<gfx::GLSurface> CreateSurface() override; 27 scoped_refptr<gfx::GLSurface> CreateSurface() override;
33 28
34 class BufferWrapper { 29 class BufferWrapper {
35 public: 30 public:
36 BufferWrapper(); 31 BufferWrapper();
37 ~BufferWrapper(); 32 ~BufferWrapper();
38 33
39 bool Initialize(GpuMemoryBufferFactoryOzoneNativePixmap* buffer_factory, 34 bool Initialize(gfx::AcceleratedWidget widget, const gfx::Size& size);
40 gfx::AcceleratedWidget widget,
41 const gfx::Size& size);
42 void BindFramebuffer(); 35 void BindFramebuffer();
43 void SchedulePlane(); 36 void SchedulePlane();
44 37
45 private: 38 private:
46 gfx::AcceleratedWidget widget_ = gfx::kNullAcceleratedWidget; 39 gfx::AcceleratedWidget widget_ = gfx::kNullAcceleratedWidget;
47 gfx::Size size_; 40 gfx::Size size_;
48 41
49 scoped_refptr<gfx::GLImage> image_; 42 scoped_refptr<gfx::GLImage> image_;
50 unsigned int gl_fb_ = 0; 43 unsigned int gl_fb_ = 0;
51 unsigned int gl_tex_ = 0; 44 unsigned int gl_tex_ = 0;
52 }; 45 };
53 46
54 GpuMemoryBufferFactoryOzoneNativePixmap* buffer_factory_;
55
56 BufferWrapper buffers_[2]; 47 BufferWrapper buffers_[2];
57 int back_buffer_ = 0; 48 int back_buffer_ = 0;
58 49
59 base::WeakPtrFactory<SurfacelessGlRenderer> weak_ptr_factory_; 50 base::WeakPtrFactory<SurfacelessGlRenderer> weak_ptr_factory_;
60 51
61 DISALLOW_COPY_AND_ASSIGN(SurfacelessGlRenderer); 52 DISALLOW_COPY_AND_ASSIGN(SurfacelessGlRenderer);
62 }; 53 };
63 54
64 } // namespace ui 55 } // namespace ui
65 56
66 #endif // UI_OZONE_DEMO_SURFACELESS_GL_RENDERER_H_ 57 #endif // UI_OZONE_DEMO_SURFACELESS_GL_RENDERER_H_
OLDNEW
« no previous file with comments | « ui/ozone/demo/ozone_demos.gyp ('k') | ui/ozone/demo/surfaceless_gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698