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

Side by Side Diff: services/ui/surfaces/direct_output_surface_ozone.h

Issue 2280723004: services/ui: Remove unwanted gpu dependency from services/ui/surfaces. (Closed)
Patch Set: . Created 4 years, 3 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 | « services/ui/surfaces/BUILD.gn ('k') | services/ui/surfaces/direct_output_surface_ozone.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 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 SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ 5 #ifndef SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_
6 #define SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ 6 #define SERVICES_UI_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 "components/display_compositor/gl_helper.h" 13 #include "components/display_compositor/gl_helper.h"
14 #include "ui/gfx/geometry/size.h" 14 #include "ui/gfx/geometry/size.h"
15 #include "ui/gfx/native_widget_types.h" 15 #include "ui/gfx/native_widget_types.h"
16 #include "ui/gfx/swap_result.h" 16 #include "ui/gfx/swap_result.h"
17 #include "ui/gl/gl_surface.h" 17 #include "ui/gl/gl_surface.h"
18 18
19 namespace cc {
20 class CompositorFrame;
21 class SyntheticBeginFrameSource;
22 }
23
19 namespace display_compositor { 24 namespace display_compositor {
20 class BufferQueue; 25 class BufferQueue;
21 } 26 }
22 27
23 namespace ui { 28 namespace gpu {
24 class LatencyInfo; 29 class GpuMemoryBufferManager;
25 } // namespace ui 30 }
26
27 namespace cc {
28 class CompositorFrame;
29 class SyntheticBeginFrameSource;
30 } // namespace cc
31 31
32 namespace ui { 32 namespace ui {
33 33
34 class SurfacesContextProvider; 34 class SurfacesContextProvider;
35 35
36 // An OutputSurface implementation that directly draws and swap to a GL 36 // An OutputSurface implementation that directly draws and swap to a GL
37 // "surfaceless" surface (aka one backed by a buffer managed explicitly in 37 // "surfaceless" surface (aka one backed by a buffer managed explicitly in
38 // mus/ozone. This class is adapted from 38 // mus/ozone. This class is adapted from
39 // GpuSurfacelessBrowserCompositorOutputSurface. 39 // GpuSurfacelessBrowserCompositorOutputSurface.
40 class DirectOutputSurfaceOzone : public cc::OutputSurface { 40 class DirectOutputSurfaceOzone : public cc::OutputSurface {
41 public: 41 public:
42 DirectOutputSurfaceOzone( 42 DirectOutputSurfaceOzone(
43 scoped_refptr<SurfacesContextProvider> context_provider, 43 scoped_refptr<SurfacesContextProvider> context_provider,
44 gfx::AcceleratedWidget widget, 44 gfx::AcceleratedWidget widget,
45 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source, 45 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source,
46 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
46 uint32_t target, 47 uint32_t target,
47 uint32_t internalformat); 48 uint32_t internalformat);
48 49
49 ~DirectOutputSurfaceOzone() override; 50 ~DirectOutputSurfaceOzone() override;
50 51
51 // TODO(rjkroege): Implement the equivalent of Reflector. 52 // TODO(rjkroege): Implement the equivalent of Reflector.
52 53
53 private: 54 private:
54 // cc::OutputSurface implementation. 55 // cc::OutputSurface implementation.
55 void SwapBuffers(cc::CompositorFrame frame) override; 56 void SwapBuffers(cc::CompositorFrame frame) override;
(...skipping 17 matching lines...) Expand all
73 display_compositor::GLHelper gl_helper_; 74 display_compositor::GLHelper gl_helper_;
74 std::unique_ptr<display_compositor::BufferQueue> buffer_queue_; 75 std::unique_ptr<display_compositor::BufferQueue> buffer_queue_;
75 cc::SyntheticBeginFrameSource* const synthetic_begin_frame_source_; 76 cc::SyntheticBeginFrameSource* const synthetic_begin_frame_source_;
76 77
77 base::WeakPtrFactory<DirectOutputSurfaceOzone> weak_ptr_factory_; 78 base::WeakPtrFactory<DirectOutputSurfaceOzone> weak_ptr_factory_;
78 }; 79 };
79 80
80 } // namespace ui 81 } // namespace ui
81 82
82 #endif // SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_ 83 #endif // SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_OZONE_H_
OLDNEW
« no previous file with comments | « services/ui/surfaces/BUILD.gn ('k') | services/ui/surfaces/direct_output_surface_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698