1 // Copyright 2015 Samsung Electronics. 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 CONTENT_BROWSER_COMPOSITOR_EVASGL_CONTEXT_PROVIDER_H_
6 #define CONTENT_BROWSER_COMPOSITOR_EVASGL_CONTEXT_PROVIDER_H_
8 #include "gpu/command_buffer/client/gles2_implementation_efl.h"
10 #include "base/compiler_specific.h"
11 #include "cc/output/context_provider.h"
12 #include "content/common/content_export.h"
16 class CONTENT_EXPORT EvasGLContextProvider : public cc::ContextProvider {
18 EvasGLContextProvider(Evas_GL_API* evas_gl_api);
20 bool BindToCurrentThread() override;
21 void DetachFromThread() override;
22 gpu::Capabilities ContextCapabilities() override;
23 gpu::gles2::GLES2Interface* ContextGL() override;
24 gpu::ContextSupport* ContextSupport() override;
25 class GrContext* GrContext() override;
26 cc::ContextCacheController* CacheController() override;
27 void InvalidateGrContext(uint32_t state) override;
28 base::Lock* GetLock() override;
29 void SetLostContextCallback(const LostContextCallback& cb) override;
32 ~EvasGLContextProvider() override;
34 gpu::Capabilities capabilities_;
35 ::gpu::gles2::GLES2ImplementationEfl evasgl_implementation_;
36 std::unique_ptr<cc::ContextCacheController> cache_controller_;
38 DISALLOW_COPY_AND_ASSIGN(EvasGLContextProvider);
41 } // namespace content
43 #endif // CONTENT_BROWSER_COMPOSITOR_EVASGL_CONTEXT_PROVIDER_H_