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

Side by Side Diff: services/ui/public/cpp/output_surface.h

Issue 2233003003: services/ui: Inject GpuService instance where needed, instead of singleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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 | « services/ui/public/cpp/gles2_context.cc ('k') | services/ui/public/cpp/output_surface.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 SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_
6 #define SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ 6 #define SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "cc/output/output_surface.h" 9 #include "cc/output/output_surface.h"
10 #include "cc/surfaces/surface_id.h" 10 #include "cc/surfaces/surface_id.h"
11 #include "mojo/public/cpp/bindings/binding.h" 11 #include "mojo/public/cpp/bindings/binding.h"
12 #include "services/ui/public/cpp/window_surface.h" 12 #include "services/ui/public/cpp/window_surface.h"
13 #include "services/ui/public/cpp/window_surface_client.h" 13 #include "services/ui/public/cpp/window_surface_client.h"
14 14
15 namespace ui { 15 namespace ui {
16 16
17 class GpuService;
18
17 class OutputSurface : public cc::OutputSurface, public WindowSurfaceClient { 19 class OutputSurface : public cc::OutputSurface, public WindowSurfaceClient {
18 public: 20 public:
19 explicit OutputSurface(std::unique_ptr<WindowSurface> surface); 21 OutputSurface(GpuService* gpu_service,
22 std::unique_ptr<WindowSurface> surface);
20 ~OutputSurface() override; 23 ~OutputSurface() override;
21 24
22 // cc::OutputSurface implementation. 25 // cc::OutputSurface implementation.
23 void SwapBuffers(cc::CompositorFrame frame) override; 26 void SwapBuffers(cc::CompositorFrame frame) override;
24 bool BindToClient(cc::OutputSurfaceClient* client) override; 27 bool BindToClient(cc::OutputSurfaceClient* client) override;
25 void DetachFromClient() override; 28 void DetachFromClient() override;
26 void BindFramebuffer() override; 29 void BindFramebuffer() override;
27 uint32_t GetFramebufferCopyTextureFormat() override; 30 uint32_t GetFramebufferCopyTextureFormat() override;
28 31
29 private: 32 private:
30 // WindowSurfaceClient implementation: 33 // WindowSurfaceClient implementation:
31 void OnResourcesReturned( 34 void OnResourcesReturned(
32 WindowSurface* surface, 35 WindowSurface* surface,
33 mojo::Array<cc::ReturnedResource> resources) override; 36 mojo::Array<cc::ReturnedResource> resources) override;
34 37
35 void SwapBuffersComplete(); 38 void SwapBuffersComplete();
36 39
37 std::unique_ptr<WindowSurface> surface_; 40 std::unique_ptr<WindowSurface> surface_;
38 41
39 DISALLOW_COPY_AND_ASSIGN(OutputSurface); 42 DISALLOW_COPY_AND_ASSIGN(OutputSurface);
40 }; 43 };
41 44
42 } // namespace ui 45 } // namespace ui
43 46
44 #endif // SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ 47 #endif // SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_
OLDNEW
« no previous file with comments | « services/ui/public/cpp/gles2_context.cc ('k') | services/ui/public/cpp/output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698