OLD | NEW |
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 "cc/output/context_provider.h" | 9 #include "cc/output/context_provider.h" |
9 #include "mojo/public/c/gles2/gles2.h" | 10 #include "mojo/public/c/gles2/gles2.h" |
10 #include "mojo/public/cpp/system/core.h" | 11 #include "mojo/public/cpp/system/core.h" |
11 | 12 |
12 namespace mojo { | 13 namespace mojo { |
13 | 14 |
14 class ContextProviderMojo : public cc::ContextProvider { | 15 class ContextProviderMojo : public cc::ContextProvider { |
15 public: | 16 public: |
16 explicit ContextProviderMojo(ScopedMessagePipeHandle command_buffer_handle); | 17 explicit ContextProviderMojo(ScopedMessagePipeHandle command_buffer_handle); |
17 | 18 |
18 // cc::ContextProvider implementation. | 19 // cc::ContextProvider implementation. |
19 virtual bool BindToCurrentThread() OVERRIDE; | 20 virtual bool BindToCurrentThread() override; |
20 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; | 21 virtual gpu::gles2::GLES2Interface* ContextGL() override; |
21 virtual gpu::ContextSupport* ContextSupport() OVERRIDE; | 22 virtual gpu::ContextSupport* ContextSupport() override; |
22 virtual class GrContext* GrContext() OVERRIDE; | 23 virtual class GrContext* GrContext() override; |
23 virtual Capabilities ContextCapabilities() OVERRIDE; | 24 virtual Capabilities ContextCapabilities() override; |
24 virtual bool IsContextLost() OVERRIDE; | 25 virtual bool IsContextLost() override; |
25 virtual void VerifyContexts() OVERRIDE {} | 26 virtual void VerifyContexts() override {} |
26 virtual void DeleteCachedResources() OVERRIDE {} | 27 virtual void DeleteCachedResources() override {} |
27 virtual bool DestroyedOnMainThread() OVERRIDE; | 28 virtual bool DestroyedOnMainThread() override; |
28 virtual void SetLostContextCallback( | 29 virtual void SetLostContextCallback( |
29 const LostContextCallback& lost_context_callback) OVERRIDE {} | 30 const LostContextCallback& lost_context_callback) override {} |
30 virtual void SetMemoryPolicyChangedCallback( | 31 virtual void SetMemoryPolicyChangedCallback( |
31 const MemoryPolicyChangedCallback& memory_policy_changed_callback) | 32 const MemoryPolicyChangedCallback& memory_policy_changed_callback) |
32 OVERRIDE {} | 33 override {} |
33 | 34 |
34 protected: | 35 protected: |
35 friend class base::RefCountedThreadSafe<ContextProviderMojo>; | 36 friend class base::RefCountedThreadSafe<ContextProviderMojo>; |
36 virtual ~ContextProviderMojo(); | 37 virtual ~ContextProviderMojo(); |
37 | 38 |
38 private: | 39 private: |
39 static void ContextLostThunk(void* closure) { | 40 static void ContextLostThunk(void* closure) { |
40 static_cast<ContextProviderMojo*>(closure)->ContextLost(); | 41 static_cast<ContextProviderMojo*>(closure)->ContextLost(); |
41 } | 42 } |
42 void ContextLost(); | 43 void ContextLost(); |
43 | 44 |
44 cc::ContextProvider::Capabilities capabilities_; | 45 cc::ContextProvider::Capabilities capabilities_; |
45 ScopedMessagePipeHandle command_buffer_handle_; | 46 ScopedMessagePipeHandle command_buffer_handle_; |
46 MojoGLES2Context context_; | 47 MojoGLES2Context context_; |
47 bool context_lost_; | 48 bool context_lost_; |
48 | 49 |
49 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo); | 50 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo); |
50 }; | 51 }; |
51 | 52 |
52 } // namespace mojo | 53 } // namespace mojo |
53 | 54 |
54 #endif // MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ | 55 #endif // MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ |
OLD | NEW |