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 CONTENT_RENDERER_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_ |
6 #define CONTENT_RENDERER_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_ | 6 #define CONTENT_RENDERER_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h" | 11 #include "third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h" |
12 | 12 |
13 namespace cc_blink { | |
14 class ContextProviderWebContext; | |
15 } | |
16 | |
17 namespace gpu { | 13 namespace gpu { |
18 namespace gles2 { | 14 namespace gles2 { |
19 class GLES2Interface; | 15 class GLES2Interface; |
20 } | 16 } |
21 } | 17 } |
22 | 18 |
23 namespace content { | 19 namespace content { |
| 20 class ContextProviderCommandBuffer; |
24 | 21 |
25 class CONTENT_EXPORT WebGraphicsContext3DProviderImpl | 22 class CONTENT_EXPORT WebGraphicsContext3DProviderImpl |
26 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3DProvider) { | 23 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3DProvider) { |
27 public: | 24 public: |
28 explicit WebGraphicsContext3DProviderImpl( | 25 explicit WebGraphicsContext3DProviderImpl( |
29 scoped_refptr<cc_blink::ContextProviderWebContext> provider); | 26 scoped_refptr<ContextProviderCommandBuffer> provider); |
30 ~WebGraphicsContext3DProviderImpl() override; | 27 ~WebGraphicsContext3DProviderImpl() override; |
31 | 28 |
32 // WebGraphicsContext3DProvider implementation. | 29 // WebGraphicsContext3DProvider implementation. |
33 blink::WebGraphicsContext3D* context3d() override; | 30 blink::WebGraphicsContext3D* context3d() override; |
34 gpu::gles2::GLES2Interface* contextGL() override; | 31 gpu::gles2::GLES2Interface* contextGL() override; |
35 GrContext* grContext() override; | 32 GrContext* grContext() override; |
36 gpu::Capabilities getCapabilities() override; | 33 gpu::Capabilities getCapabilities() override; |
37 void setLostContextCallback(blink::WebClosure) override; | 34 void setLostContextCallback(blink::WebClosure) override; |
38 void setErrorMessageCallback( | 35 void setErrorMessageCallback( |
39 blink::WebFunction<void(const char*, int32_t)>) override; | 36 blink::WebFunction<void(const char*, int32_t)>) override; |
40 | 37 |
| 38 ContextProviderCommandBuffer* context_provider() const { |
| 39 return provider_.get(); |
| 40 } |
| 41 |
41 private: | 42 private: |
42 scoped_refptr<cc_blink::ContextProviderWebContext> provider_; | 43 scoped_refptr<ContextProviderCommandBuffer> provider_; |
43 }; | 44 }; |
44 | 45 |
45 } // namespace content | 46 } // namespace content |
46 | 47 |
47 #endif // CONTENT_RENDERER_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_ | 48 #endif // CONTENT_RENDERER_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_ |
OLD | NEW |