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

Side by Side Diff: components/mus/surfaces/direct_output_surface_ozone.h

Issue 2029323004: Get rid of virtual Display::CreateScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onscreendisplayclient
Patch Set: displaytest: unusedvar Created 4 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ 5 #ifndef COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_
6 #define COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ 6 #define COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "cc/output/context_provider.h" 11 #include "cc/output/context_provider.h"
12 #include "cc/output/output_surface.h" 12 #include "cc/output/output_surface.h"
13 #include "cc/scheduler/begin_frame_source.h"
14 #include "components/display_compositor/gl_helper.h" 13 #include "components/display_compositor/gl_helper.h"
15 #include "components/mus/surfaces/ozone_gpu_memory_buffer_manager.h" 14 #include "components/mus/surfaces/ozone_gpu_memory_buffer_manager.h"
16 #include "ui/gfx/geometry/size.h" 15 #include "ui/gfx/geometry/size.h"
17 #include "ui/gfx/native_widget_types.h" 16 #include "ui/gfx/native_widget_types.h"
18 #include "ui/gfx/swap_result.h" 17 #include "ui/gfx/swap_result.h"
19 #include "ui/gl/gl_surface.h" 18 #include "ui/gl/gl_surface.h"
20 19
21 namespace display_compositor { 20 namespace display_compositor {
22 class BufferQueue; 21 class BufferQueue;
23 } 22 }
24 23
25 namespace ui { 24 namespace ui {
26 class LatencyInfo; 25 class LatencyInfo;
27 } // namespace ui 26 } // namespace ui
28 27
29 namespace cc { 28 namespace cc {
30 class CompositorFrame; 29 class CompositorFrame;
30 class SyntheticBeginFrameSource;
31 } // namespace cc 31 } // namespace cc
32 32
33 namespace mus { 33 namespace mus {
34 34
35 class SurfacesContextProvider; 35 class SurfacesContextProvider;
36 36
37 // An OutputSurface implementation that directly draws and swap to a GL 37 // An OutputSurface implementation that directly draws and swap to a GL
38 // "surfaceless" surface (aka one backed by a buffer managed explicitly in 38 // "surfaceless" surface (aka one backed by a buffer managed explicitly in
39 // mus/ozone. This class is adapted from 39 // mus/ozone. This class is adapted from
40 // GpuSurfacelessBrowserCompositorOutputSurface. 40 // GpuSurfacelessBrowserCompositorOutputSurface.
41 class DirectOutputSurfaceOzone : public cc::OutputSurface { 41 class DirectOutputSurfaceOzone : public cc::OutputSurface {
42 public: 42 public:
43 DirectOutputSurfaceOzone( 43 DirectOutputSurfaceOzone(
44 scoped_refptr<SurfacesContextProvider> context_provider, 44 scoped_refptr<SurfacesContextProvider> context_provider,
45 gfx::AcceleratedWidget widget, 45 gfx::AcceleratedWidget widget,
46 base::SingleThreadTaskRunner* task_runner, 46 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source,
47 uint32_t target, 47 uint32_t target,
48 uint32_t internalformat); 48 uint32_t internalformat);
49 49
50 ~DirectOutputSurfaceOzone() override; 50 ~DirectOutputSurfaceOzone() override;
51 51
52 // TODO(rjkroege): Implement the equivalent of Reflector. 52 // TODO(rjkroege): Implement the equivalent of Reflector.
53 53
54 private: 54 private:
55 // cc::OutputSurface implementation. 55 // cc::OutputSurface implementation.
56 void SwapBuffers(cc::CompositorFrame* frame) override; 56 void SwapBuffers(cc::CompositorFrame* frame) override;
57 void BindFramebuffer() override; 57 void BindFramebuffer() override;
58 void Reshape(const gfx::Size& size, float scale_factor, bool alpha) override; 58 void Reshape(const gfx::Size& size, float scale_factor, bool alpha) override;
59 bool IsDisplayedAsOverlayPlane() const override; 59 bool IsDisplayedAsOverlayPlane() const override;
60 unsigned GetOverlayTextureId() const override; 60 unsigned GetOverlayTextureId() const override;
61 bool BindToClient(cc::OutputSurfaceClient* client) override; 61 bool BindToClient(cc::OutputSurfaceClient* client) override;
62 62
63 // Taken from BrowserCompositor specific API. 63 // Taken from BrowserCompositor specific API.
64 void OnUpdateVSyncParametersFromGpu(base::TimeTicks timebase, 64 void OnUpdateVSyncParametersFromGpu(base::TimeTicks timebase,
65 base::TimeDelta interval); 65 base::TimeDelta interval);
66 66
67 // Called when a swap completion is sent from the GPU process. 67 // Called when a swap completion is sent from the GPU process.
68 void OnGpuSwapBuffersCompleted(gfx::SwapResult result); 68 void OnGpuSwapBuffersCompleted(gfx::SwapResult result);
69 69
70 display_compositor::GLHelper gl_helper_; 70 display_compositor::GLHelper gl_helper_;
71 std::unique_ptr<OzoneGpuMemoryBufferManager> ozone_gpu_memory_buffer_manager_; 71 std::unique_ptr<OzoneGpuMemoryBufferManager> ozone_gpu_memory_buffer_manager_;
72 std::unique_ptr<display_compositor::BufferQueue> buffer_queue_; 72 std::unique_ptr<display_compositor::BufferQueue> buffer_queue_;
73 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; 73 cc::SyntheticBeginFrameSource* const synthetic_begin_frame_source_;
74 74
75 base::WeakPtrFactory<DirectOutputSurfaceOzone> weak_ptr_factory_; 75 base::WeakPtrFactory<DirectOutputSurfaceOzone> weak_ptr_factory_;
76 }; 76 };
77 77
78 } // namespace mus 78 } // namespace mus
79 79
80 #endif // COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ 80 #endif // COMPONENTS_MUS_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_
OLDNEW
« no previous file with comments | « components/mus/surfaces/direct_output_surface.cc ('k') | components/mus/surfaces/direct_output_surface_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698