OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_ | 5 #ifndef GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_ |
6 #define GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_ | 6 #define GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "gpu/blink/gpu_blink_export.h" | 15 #include "gpu/blink/gpu_blink_export.h" |
16 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 16 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
17 #include "third_party/WebKit/public/platform/WebString.h" | 17 #include "third_party/WebKit/public/platform/WebString.h" |
18 | 18 |
19 namespace gpu { | 19 namespace gpu { |
20 | 20 |
21 namespace gles2 { | 21 namespace gles2 { |
22 class GLES2Interface; | 22 class GLES2Interface; |
23 class GLES2ImplementationErrorMessageCallback; | |
24 struct ContextCreationAttribHelper; | 23 struct ContextCreationAttribHelper; |
25 } | 24 } |
26 } | 25 } |
27 | 26 |
28 namespace gpu_blink { | 27 namespace gpu_blink { |
29 | 28 |
30 class WebGraphicsContext3DErrorMessageCallback; | |
31 | |
32 class GPU_BLINK_EXPORT WebGraphicsContext3DImpl | 29 class GPU_BLINK_EXPORT WebGraphicsContext3DImpl |
33 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3D) { | 30 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3D) { |
34 public: | 31 public: |
35 ~WebGraphicsContext3DImpl() override; | 32 ~WebGraphicsContext3DImpl() override; |
36 | 33 |
37 //---------------------------------------------------------------------- | 34 //---------------------------------------------------------------------- |
38 // WebGraphicsContext3D methods | 35 // WebGraphicsContext3D methods |
39 | 36 |
40 void setContextLostCallback( | 37 void setContextLostCallback( |
41 WebGraphicsContext3D::WebGraphicsContextLostCallback* callback); | 38 WebGraphicsContext3D::WebGraphicsContextLostCallback* callback); |
42 | 39 |
43 void setErrorMessageCallback( | |
44 WebGraphicsContext3D::WebGraphicsErrorMessageCallback* callback) override; | |
45 | |
46 ::gpu::gles2::GLES2Interface* GetGLInterface() { | 40 ::gpu::gles2::GLES2Interface* GetGLInterface() { |
47 return gl_; | 41 return gl_; |
48 } | 42 } |
49 | 43 |
50 protected: | 44 protected: |
51 friend class WebGraphicsContext3DErrorMessageCallback; | |
52 | |
53 WebGraphicsContext3DImpl(); | 45 WebGraphicsContext3DImpl(); |
54 | 46 |
55 void SetGLInterface(::gpu::gles2::GLES2Interface* gl) { gl_ = gl; } | 47 void SetGLInterface(::gpu::gles2::GLES2Interface* gl) { gl_ = gl; } |
56 | 48 |
57 bool initialized_; | 49 bool initialized_; |
58 bool initialize_failed_; | 50 bool initialize_failed_; |
59 | 51 |
60 WebGraphicsContextLostCallback* context_lost_callback_; | 52 WebGraphicsContextLostCallback* context_lost_callback_; |
61 WebGraphicsErrorMessageCallback* error_message_callback_; | |
62 | 53 |
63 ::gpu::gles2::GLES2Interface* gl_; | 54 ::gpu::gles2::GLES2Interface* gl_; |
64 bool lose_context_when_out_of_memory_; | 55 bool lose_context_when_out_of_memory_; |
65 }; | 56 }; |
66 | 57 |
67 } // namespace gpu_blink | 58 } // namespace gpu_blink |
68 | 59 |
69 #endif // GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_ | 60 #endif // GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_ |
OLD | NEW |