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 gpu { | 13 namespace gpu { |
14 namespace gles2 { | 14 namespace gles2 { |
15 class GLES2Interface; | 15 class GLES2Interface; |
16 } | 16 } |
17 } | 17 } |
18 | 18 |
| 19 namespace ui { |
| 20 class ContextProviderCommandBuffer; |
| 21 } |
| 22 |
19 namespace content { | 23 namespace content { |
20 class ContextProviderCommandBuffer; | |
21 | 24 |
22 class CONTENT_EXPORT WebGraphicsContext3DProviderImpl | 25 class CONTENT_EXPORT WebGraphicsContext3DProviderImpl |
23 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3DProvider) { | 26 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3DProvider) { |
24 public: | 27 public: |
25 explicit WebGraphicsContext3DProviderImpl( | 28 explicit WebGraphicsContext3DProviderImpl( |
26 scoped_refptr<ContextProviderCommandBuffer> provider, | 29 scoped_refptr<ui::ContextProviderCommandBuffer> provider, |
27 bool software_rendering); | 30 bool software_rendering); |
28 ~WebGraphicsContext3DProviderImpl() override; | 31 ~WebGraphicsContext3DProviderImpl() override; |
29 | 32 |
30 // WebGraphicsContext3DProvider implementation. | 33 // WebGraphicsContext3DProvider implementation. |
31 bool bindToCurrentThread() override; | 34 bool bindToCurrentThread() override; |
32 gpu::gles2::GLES2Interface* contextGL() override; | 35 gpu::gles2::GLES2Interface* contextGL() override; |
33 GrContext* grContext() override; | 36 GrContext* grContext() override; |
34 gpu::Capabilities getCapabilities() override; | 37 gpu::Capabilities getCapabilities() override; |
35 bool isSoftwareRendering() const override; | 38 bool isSoftwareRendering() const override; |
36 void setLostContextCallback(const base::Closure&) override; | 39 void setLostContextCallback(const base::Closure&) override; |
37 void setErrorMessageCallback( | 40 void setErrorMessageCallback( |
38 const base::Callback<void(const char*, int32_t)>&) override; | 41 const base::Callback<void(const char*, int32_t)>&) override; |
39 void signalQuery(uint32_t, const base::Closure&) override; | 42 void signalQuery(uint32_t, const base::Closure&) override; |
40 | 43 |
41 ContextProviderCommandBuffer* context_provider() const { | 44 ui::ContextProviderCommandBuffer* context_provider() const { |
42 return provider_.get(); | 45 return provider_.get(); |
43 } | 46 } |
44 | 47 |
45 private: | 48 private: |
46 scoped_refptr<ContextProviderCommandBuffer> provider_; | 49 scoped_refptr<ui::ContextProviderCommandBuffer> provider_; |
47 const bool software_rendering_; | 50 const bool software_rendering_; |
48 }; | 51 }; |
49 | 52 |
50 } // namespace content | 53 } // namespace content |
51 | 54 |
52 #endif // CONTENT_RENDERER_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_ | 55 #endif // CONTENT_RENDERER_WEBGRAPHICSCONTEXT3D_PROVIDER_IMPL_H_ |
OLD | NEW |