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

Side by Side Diff: services/surfaces/context_provider_mojo.h

Issue 1536863002: Delete the Surfaces service. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-4
Patch Set: rebase Created 4 years, 10 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/surfaces/BUILD.gn ('k') | services/surfaces/context_provider_mojo.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_SURFACES_CONTEXT_PROVIDER_MOJO_H_
6 #define SERVICES_SURFACES_CONTEXT_PROVIDER_MOJO_H_
7
8 #include <MGL/mgl.h>
9
10 #include "base/macros.h"
11 #include "base/synchronization/lock.h"
12 #include "cc/output/context_provider.h"
13 #include "gpu/command_buffer/client/gles2_interface.h"
14 #include "mojo/gpu/mojo_context_support.h"
15 #include "mojo/public/cpp/system/core.h"
16
17 namespace mojo {
18
19 class MojoContextSupport;
20 class MojoGLES2Impl;
21
22 class ContextProviderMojo : public cc::ContextProvider {
23 public:
24 explicit ContextProviderMojo(ScopedMessagePipeHandle command_buffer_handle);
25
26 // cc::ContextProvider implementation.
27 bool BindToCurrentThread() override;
28 gpu::gles2::GLES2Interface* ContextGL() override;
29 gpu::ContextSupport* ContextSupport() override;
30 class GrContext* GrContext() override;
31 Capabilities ContextCapabilities() override;
32 bool IsContextLost() override;
33 void VerifyContexts() override {}
34 void DeleteCachedResources() override {}
35 bool DestroyedOnMainThread() override;
36 void SetLostContextCallback(
37 const LostContextCallback& lost_context_callback) override;
38 void SetMemoryPolicyChangedCallback(
39 const MemoryPolicyChangedCallback& memory_policy_changed_callback)
40 override {}
41 void SetupLock() override;
42 base::Lock* GetLock() override;
43
44 protected:
45 friend class base::RefCountedThreadSafe<ContextProviderMojo>;
46 ~ContextProviderMojo() override;
47
48 private:
49 static void ContextLostThunk(void* closure) {
50 static_cast<ContextProviderMojo*>(closure)->ContextLost();
51 }
52 void ContextLost();
53
54 cc::ContextProvider::Capabilities capabilities_;
55 ScopedMessagePipeHandle command_buffer_handle_;
56 MGLContext context_;
57 scoped_ptr<MojoGLES2Impl> gles2_impl_;
58 scoped_ptr<MojoContextSupport> context_support_;
59 bool context_lost_;
60 LostContextCallback lost_context_callback_;
61
62 base::Lock context_lock_;
63
64 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo);
65 };
66
67 } // namespace mojo
68
69 #endif // SERVICES_SURFACES_CONTEXT_PROVIDER_MOJO_H_
OLDNEW
« no previous file with comments | « services/surfaces/BUILD.gn ('k') | services/surfaces/context_provider_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698