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

Side by Side Diff: mojo/cc/context_provider_mojo.h

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
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 MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ 5 #ifndef MOJO_CC_CONTEXT_PROVIDER_MOJO_H_
6 #define MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ 6 #define MOJO_CC_CONTEXT_PROVIDER_MOJO_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/synchronization/lock.h"
9 #include "cc/output/context_provider.h" 10 #include "cc/output/context_provider.h"
10 #include "mojo/public/c/gles2/gles2.h" 11 #include "mojo/public/c/gles2/gles2.h"
11 #include "mojo/public/cpp/system/core.h" 12 #include "mojo/public/cpp/system/core.h"
12 13
13 namespace mojo { 14 namespace mojo {
14 15
15 class ContextProviderMojo : public cc::ContextProvider { 16 class ContextProviderMojo : public cc::ContextProvider {
16 public: 17 public:
17 explicit ContextProviderMojo(ScopedMessagePipeHandle command_buffer_handle); 18 explicit ContextProviderMojo(ScopedMessagePipeHandle command_buffer_handle);
18 19
19 // cc::ContextProvider implementation. 20 // cc::ContextProvider implementation.
20 bool BindToCurrentThread() override; 21 bool BindToCurrentThread() override;
21 gpu::gles2::GLES2Interface* ContextGL() override; 22 gpu::gles2::GLES2Interface* ContextGL() override;
22 gpu::ContextSupport* ContextSupport() override; 23 gpu::ContextSupport* ContextSupport() override;
23 class GrContext* GrContext() override; 24 class GrContext* GrContext() override;
24 Capabilities ContextCapabilities() override; 25 Capabilities ContextCapabilities() override;
25 bool IsContextLost() override; 26 bool IsContextLost() override;
26 void VerifyContexts() override {} 27 void VerifyContexts() override {}
27 void DeleteCachedResources() override {} 28 void DeleteCachedResources() override {}
28 bool DestroyedOnMainThread() override; 29 bool DestroyedOnMainThread() override;
29 void SetLostContextCallback( 30 void SetLostContextCallback(
30 const LostContextCallback& lost_context_callback) override {} 31 const LostContextCallback& lost_context_callback) override {}
31 void SetMemoryPolicyChangedCallback( 32 void SetMemoryPolicyChangedCallback(
32 const MemoryPolicyChangedCallback& memory_policy_changed_callback) 33 const MemoryPolicyChangedCallback& memory_policy_changed_callback)
33 override {} 34 override {}
35 void SetupLock() override;
36 base::Lock* GetLock() override;
34 37
35 protected: 38 protected:
36 friend class base::RefCountedThreadSafe<ContextProviderMojo>; 39 friend class base::RefCountedThreadSafe<ContextProviderMojo>;
37 ~ContextProviderMojo() override; 40 ~ContextProviderMojo() override;
38 41
39 private: 42 private:
40 static void ContextLostThunk(void* closure) { 43 static void ContextLostThunk(void* closure) {
41 static_cast<ContextProviderMojo*>(closure)->ContextLost(); 44 static_cast<ContextProviderMojo*>(closure)->ContextLost();
42 } 45 }
43 void ContextLost(); 46 void ContextLost();
44 47
45 cc::ContextProvider::Capabilities capabilities_; 48 cc::ContextProvider::Capabilities capabilities_;
46 ScopedMessagePipeHandle command_buffer_handle_; 49 ScopedMessagePipeHandle command_buffer_handle_;
47 MojoGLES2Context context_; 50 MojoGLES2Context context_;
48 bool context_lost_; 51 bool context_lost_;
49 52
53 base::Lock context_lock_;
54
50 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo); 55 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo);
51 }; 56 };
52 57
53 } // namespace mojo 58 } // namespace mojo
54 59
55 #endif // MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ 60 #endif // MOJO_CC_CONTEXT_PROVIDER_MOJO_H_
OLDNEW
« no previous file with comments | « mojo/android/javatests/src/org/chromium/mojo/MojoTestCase.java ('k') | mojo/cc/context_provider_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698