0eb97b7d377d54df7384da8a403a84bee02a8d60
[platform/framework/web/crosswalk-tizen.git] /
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.
4
5 #ifndef CONTENT_BROWSER_COMPOSITOR_EVASGL_CONTEXT_PROVIDER_H_
6 #define CONTENT_BROWSER_COMPOSITOR_EVASGL_CONTEXT_PROVIDER_H_
7
8 #include "gpu/command_buffer/client/gles2_implementation_efl.h"
9
10 #include "base/compiler_specific.h"
11 #include "cc/output/context_provider.h"
12 #include "content/common/content_export.h"
13
14 namespace content {
15
16 class CONTENT_EXPORT EvasGLContextProvider : public cc::ContextProvider {
17  public:
18   EvasGLContextProvider(Evas_GL_API* evas_gl_api);
19
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;
30
31  private:
32   ~EvasGLContextProvider() override;
33
34   gpu::Capabilities capabilities_;
35   ::gpu::gles2::GLES2ImplementationEfl evasgl_implementation_;
36   std::unique_ptr<cc::ContextCacheController> cache_controller_;
37
38   DISALLOW_COPY_AND_ASSIGN(EvasGLContextProvider);
39 };
40
41 }  // namespace content
42
43 #endif  // CONTENT_BROWSER_COMPOSITOR_EVASGL_CONTEXT_PROVIDER_H_