[Mac] Fix bug where sometimes a tab's close button stays highlighted.
[chromium-blink-merge.git] / mojo / cc / context_provider_mojo.h
blob014b9734e0fe9a0e33899c519773fb01d348b7bf
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 "cc/output/context_provider.h"
10 #include "mojo/public/c/gles2/gles2.h"
11 #include "mojo/public/cpp/system/core.h"
13 namespace mojo {
15 class ContextProviderMojo : public cc::ContextProvider {
16 public:
17 explicit ContextProviderMojo(ScopedMessagePipeHandle command_buffer_handle);
19 // cc::ContextProvider implementation.
20 bool BindToCurrentThread() override;
21 gpu::gles2::GLES2Interface* ContextGL() override;
22 gpu::ContextSupport* ContextSupport() override;
23 class GrContext* GrContext() override;
24 Capabilities ContextCapabilities() override;
25 bool IsContextLost() override;
26 void VerifyContexts() override {}
27 void DeleteCachedResources() override {}
28 bool DestroyedOnMainThread() override;
29 void SetLostContextCallback(
30 const LostContextCallback& lost_context_callback) override {}
31 void SetMemoryPolicyChangedCallback(
32 const MemoryPolicyChangedCallback& memory_policy_changed_callback)
33 override {}
35 protected:
36 friend class base::RefCountedThreadSafe<ContextProviderMojo>;
37 ~ContextProviderMojo() override;
39 private:
40 static void ContextLostThunk(void* closure) {
41 static_cast<ContextProviderMojo*>(closure)->ContextLost();
43 void ContextLost();
45 cc::ContextProvider::Capabilities capabilities_;
46 ScopedMessagePipeHandle command_buffer_handle_;
47 MojoGLES2Context context_;
48 bool context_lost_;
50 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo);
53 } // namespace mojo
55 #endif // MOJO_CC_CONTEXT_PROVIDER_MOJO_H_