Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / mojo / cc / context_provider_mojo.h
blob2102ef26d7ec178d7c4ff58f6be5562a6de59da8
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.
5 #ifndef MOJO_CC_CONTEXT_PROVIDER_MOJO_H_
6 #define MOJO_CC_CONTEXT_PROVIDER_MOJO_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/synchronization/lock.h"
11 #include "cc/output/context_provider.h"
12 #include "third_party/mojo/src/mojo/public/c/gles2/gles2.h"
13 #include "third_party/mojo/src/mojo/public/cpp/system/core.h"
15 namespace mojo {
17 class ContextProviderMojo : public cc::ContextProvider {
18 public:
19 explicit ContextProviderMojo(ScopedMessagePipeHandle command_buffer_handle);
21 // cc::ContextProvider implementation.
22 bool BindToCurrentThread() override;
23 gpu::gles2::GLES2Interface* ContextGL() override;
24 gpu::ContextSupport* ContextSupport() override;
25 class GrContext* GrContext() override;
26 void InvalidateGrContext(uint32_t state) override;
27 void SetupLock() override;
28 base::Lock* GetLock() override;
29 Capabilities ContextCapabilities() override;
30 bool IsContextLost() override;
31 void VerifyContexts() override {}
32 void DeleteCachedResources() override {}
33 bool DestroyedOnMainThread() override;
34 void SetLostContextCallback(
35 const LostContextCallback& lost_context_callback) override {}
36 void SetMemoryPolicyChangedCallback(
37 const MemoryPolicyChangedCallback& memory_policy_changed_callback)
38 override {}
40 protected:
41 friend class base::RefCountedThreadSafe<ContextProviderMojo>;
42 ~ContextProviderMojo() override;
44 private:
45 static void ContextLostThunk(void* closure) {
46 static_cast<ContextProviderMojo*>(closure)->ContextLost();
48 void ContextLost();
50 cc::ContextProvider::Capabilities capabilities_;
51 ScopedMessagePipeHandle command_buffer_handle_;
52 MojoGLES2Context context_;
53 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_;
54 bool context_lost_;
56 base::Lock context_lock_;
58 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo);
61 } // namespace mojo
63 #endif // MOJO_CC_CONTEXT_PROVIDER_MOJO_H_