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

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

Issue 1240353002: ozone: rename to GpuMemoryBuffer(Factory|Impl)OzoneNativePixmap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits in comments Created 5 years, 5 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_demo.cc ('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 GpuMemoryBufferFactoryOzoneNativeBuffer; 16 class GpuMemoryBufferFactoryOzoneNativePixmap;
17 17
18 class SurfacelessGlRenderer : public GlRenderer { 18 class SurfacelessGlRenderer : public GlRenderer {
19 public: 19 public:
20 SurfacelessGlRenderer( 20 SurfacelessGlRenderer(
21 gfx::AcceleratedWidget widget, 21 gfx::AcceleratedWidget widget,
22 const gfx::Size& size, 22 const gfx::Size& size,
23 GpuMemoryBufferFactoryOzoneNativeBuffer* buffer_factory); 23 GpuMemoryBufferFactoryOzoneNativePixmap* buffer_factory);
24 ~SurfacelessGlRenderer() override; 24 ~SurfacelessGlRenderer() override;
25 25
26 // Renderer: 26 // Renderer:
27 bool Initialize() override; 27 bool Initialize() override;
28 28
29 private: 29 private:
30 // GlRenderer: 30 // GlRenderer:
31 void RenderFrame() override; 31 void RenderFrame() override;
32 scoped_refptr<gfx::GLSurface> CreateSurface() override; 32 scoped_refptr<gfx::GLSurface> CreateSurface() override;
33 33
34 class BufferWrapper { 34 class BufferWrapper {
35 public: 35 public:
36 BufferWrapper(); 36 BufferWrapper();
37 ~BufferWrapper(); 37 ~BufferWrapper();
38 38
39 bool Initialize(GpuMemoryBufferFactoryOzoneNativeBuffer* buffer_factory, 39 bool Initialize(GpuMemoryBufferFactoryOzoneNativePixmap* buffer_factory,
40 gfx::AcceleratedWidget widget, 40 gfx::AcceleratedWidget widget,
41 const gfx::Size& size); 41 const gfx::Size& size);
42 void BindFramebuffer(); 42 void BindFramebuffer();
43 void SchedulePlane(); 43 void SchedulePlane();
44 44
45 private: 45 private:
46 gfx::AcceleratedWidget widget_ = gfx::kNullAcceleratedWidget; 46 gfx::AcceleratedWidget widget_ = gfx::kNullAcceleratedWidget;
47 gfx::Size size_; 47 gfx::Size size_;
48 48
49 scoped_refptr<gfx::GLImage> image_; 49 scoped_refptr<gfx::GLImage> image_;
50 unsigned int gl_fb_ = 0; 50 unsigned int gl_fb_ = 0;
51 unsigned int gl_tex_ = 0; 51 unsigned int gl_tex_ = 0;
52 }; 52 };
53 53
54 GpuMemoryBufferFactoryOzoneNativeBuffer* buffer_factory_; 54 GpuMemoryBufferFactoryOzoneNativePixmap* buffer_factory_;
55 55
56 BufferWrapper buffers_[2]; 56 BufferWrapper buffers_[2];
57 int back_buffer_ = 0; 57 int back_buffer_ = 0;
58 58
59 base::WeakPtrFactory<SurfacelessGlRenderer> weak_ptr_factory_; 59 base::WeakPtrFactory<SurfacelessGlRenderer> weak_ptr_factory_;
60 60
61 DISALLOW_COPY_AND_ASSIGN(SurfacelessGlRenderer); 61 DISALLOW_COPY_AND_ASSIGN(SurfacelessGlRenderer);
62 }; 62 };
63 63
64 } // namespace ui 64 } // namespace ui
65 65
66 #endif // UI_OZONE_DEMO_SURFACELESS_GL_RENDERER_H_ 66 #endif // UI_OZONE_DEMO_SURFACELESS_GL_RENDERER_H_
OLDNEW
« no previous file with comments | « ui/ozone/demo/ozone_demo.cc ('k') | ui/ozone/demo/surfaceless_gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698