| 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> |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 const blink::WGC3Duint* v) override; | 930 const blink::WGC3Duint* v) override; |
| 931 void vertexAttribIPointer(blink::WGC3Duint index, | 931 void vertexAttribIPointer(blink::WGC3Duint index, |
| 932 blink::WGC3Dint size, | 932 blink::WGC3Dint size, |
| 933 blink::WGC3Denum type, | 933 blink::WGC3Denum type, |
| 934 blink::WGC3Dsizei stride, | 934 blink::WGC3Dsizei stride, |
| 935 blink::WGC3Dintptr pointer) override; | 935 blink::WGC3Dintptr pointer) override; |
| 936 void waitSync(blink::WGC3Dsync sync, | 936 void waitSync(blink::WGC3Dsync sync, |
| 937 blink::WGC3Dbitfield flags, | 937 blink::WGC3Dbitfield flags, |
| 938 blink::WGC3Duint64 timeout) override; | 938 blink::WGC3Duint64 timeout) override; |
| 939 | 939 |
| 940 bool isContextLost() override; | |
| 941 blink::WGC3Denum getGraphicsResetStatusARB() override; | 940 blink::WGC3Denum getGraphicsResetStatusARB() override; |
| 942 | 941 |
| 942 // WebGraphicsContext3D implementation. |
| 943 ::gpu::gles2::GLES2Interface* getGLES2Interface() override; |
| 944 |
| 943 ::gpu::gles2::GLES2Interface* GetGLInterface() { | 945 ::gpu::gles2::GLES2Interface* GetGLInterface() { |
| 944 return gl_; | 946 return gl_; |
| 945 } | 947 } |
| 946 | 948 |
| 947 // Convert WebGL context creation attributes into command buffer / EGL size | 949 // Convert WebGL context creation attributes into command buffer / EGL size |
| 948 // requests. | 950 // requests. |
| 949 static void ConvertAttributes( | 951 static void ConvertAttributes( |
| 950 const blink::WebGraphicsContext3D::Attributes& attributes, | 952 const blink::WebGraphicsContext3D::Attributes& attributes, |
| 951 ::gpu::gles2::ContextCreationAttribHelper* output_attribs); | 953 ::gpu::gles2::ContextCreationAttribHelper* output_attribs); |
| 952 | 954 |
| 953 protected: | 955 protected: |
| 954 friend class WebGraphicsContext3DErrorMessageCallback; | 956 friend class WebGraphicsContext3DErrorMessageCallback; |
| 955 | 957 |
| 956 WebGraphicsContext3DImpl(); | 958 WebGraphicsContext3DImpl(); |
| 957 | 959 |
| 958 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* | 960 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* |
| 959 getErrorMessageCallback(); | 961 getErrorMessageCallback(); |
| 960 virtual void OnErrorMessage(const std::string& message, int id); | 962 virtual void OnErrorMessage(const std::string& message, int id); |
| 961 | 963 |
| 962 void setGLInterface(::gpu::gles2::GLES2Interface* gl) { | 964 void SetGLInterface(::gpu::gles2::GLES2Interface* gl) { gl_ = gl; } |
| 963 gl_ = gl; | |
| 964 } | |
| 965 | 965 |
| 966 bool initialized_; | 966 bool initialized_; |
| 967 bool initialize_failed_; | 967 bool initialize_failed_; |
| 968 | 968 |
| 969 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; | 969 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; |
| 970 | 970 |
| 971 WebGraphicsContext3D::WebGraphicsErrorMessageCallback* | 971 WebGraphicsContext3D::WebGraphicsErrorMessageCallback* |
| 972 error_message_callback_; | 972 error_message_callback_; |
| 973 scoped_ptr<WebGraphicsContext3DErrorMessageCallback> | 973 scoped_ptr<WebGraphicsContext3DErrorMessageCallback> |
| 974 client_error_message_callback_; | 974 client_error_message_callback_; |
| 975 | 975 |
| 976 // Errors raised by synthesizeGLError(). | 976 // Errors raised by synthesizeGLError(). |
| 977 std::vector<blink::WGC3Denum> synthetic_errors_; | 977 std::vector<blink::WGC3Denum> synthetic_errors_; |
| 978 | 978 |
| 979 ::gpu::gles2::GLES2Interface* gl_; | 979 ::gpu::gles2::GLES2Interface* gl_; |
| 980 bool lose_context_when_out_of_memory_; | 980 bool lose_context_when_out_of_memory_; |
| 981 uint32_t flush_id_; | 981 uint32_t flush_id_; |
| 982 }; | 982 }; |
| 983 | 983 |
| 984 } // namespace gpu_blink | 984 } // namespace gpu_blink |
| 985 | 985 |
| 986 #endif // GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_ | 986 #endif // GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_ |
| OLD | NEW |