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: services/ui/public/cpp/context_provider.h

Issue 2257693002: services/ui: Use a gpu::GpuChannelHost when creating ui::OutputSurface. (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/demo/mus_demo.cc ('k') | services/ui/public/cpp/context_provider.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_CONTEXT_PROVIDER_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_CONTEXT_PROVIDER_H_
6 #define SERVICES_UI_PUBLIC_CPP_CONTEXT_PROVIDER_H_ 6 #define SERVICES_UI_PUBLIC_CPP_CONTEXT_PROVIDER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "cc/output/context_provider.h" 13 #include "cc/output/context_provider.h"
14 #include "mojo/public/cpp/system/core.h" 14 #include "mojo/public/cpp/system/core.h"
15 15
16 namespace gpu {
17 class GpuChannelHost;
18 }
19
16 namespace shell { 20 namespace shell {
17 class Connector; 21 class Connector;
18 } 22 }
19 23
20 namespace ui { 24 namespace ui {
21 25
22 class GLES2Context; 26 class GLES2Context;
23 class GpuService;
24 27
25 class ContextProvider : public cc::ContextProvider { 28 class ContextProvider : public cc::ContextProvider {
26 public: 29 public:
27 explicit ContextProvider(GpuService* gpu_service); 30 explicit ContextProvider(scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
28 31
29 // cc::ContextProvider implementation. 32 // cc::ContextProvider implementation.
30 bool BindToCurrentThread() override; 33 bool BindToCurrentThread() override;
31 gpu::gles2::GLES2Interface* ContextGL() override; 34 gpu::gles2::GLES2Interface* ContextGL() override;
32 gpu::ContextSupport* ContextSupport() override; 35 gpu::ContextSupport* ContextSupport() override;
33 class GrContext* GrContext() override; 36 class GrContext* GrContext() override;
34 void InvalidateGrContext(uint32_t state) override; 37 void InvalidateGrContext(uint32_t state) override;
35 base::Lock* GetLock() override; 38 base::Lock* GetLock() override;
36 gpu::Capabilities ContextCapabilities() override; 39 gpu::Capabilities ContextCapabilities() override;
37 void DeleteCachedResources() override {} 40 void DeleteCachedResources() override {}
38 void SetLostContextCallback( 41 void SetLostContextCallback(
39 const LostContextCallback& lost_context_callback) override {} 42 const LostContextCallback& lost_context_callback) override {}
40 43
41 protected: 44 protected:
42 friend class base::RefCountedThreadSafe<ContextProvider>; 45 friend class base::RefCountedThreadSafe<ContextProvider>;
43 ~ContextProvider() override; 46 ~ContextProvider() override;
44 47
45 private: 48 private:
46 std::unique_ptr<GLES2Context> context_; 49 std::unique_ptr<GLES2Context> context_;
47 GpuService* gpu_service_; 50 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host_;
48 51
49 DISALLOW_COPY_AND_ASSIGN(ContextProvider); 52 DISALLOW_COPY_AND_ASSIGN(ContextProvider);
50 }; 53 };
51 54
52 } // namespace ui 55 } // namespace ui
53 56
54 #endif // SERVICES_UI_PUBLIC_CPP_CONTEXT_PROVIDER_H_ 57 #endif // SERVICES_UI_PUBLIC_CPP_CONTEXT_PROVIDER_H_
OLDNEW
« no previous file with comments | « services/ui/demo/mus_demo.cc ('k') | services/ui/public/cpp/context_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698