| Index: gpu/blink/webgraphicscontext3d_impl.cc
|
| diff --git a/gpu/blink/webgraphicscontext3d_impl.cc b/gpu/blink/webgraphicscontext3d_impl.cc
|
| index 256d19a7d23b873955ce5d933d933e5d3f9035e1..5a5cdbd1fcacc165bc1ea17a55f163ed3bb1c02b 100644
|
| --- a/gpu/blink/webgraphicscontext3d_impl.cc
|
| +++ b/gpu/blink/webgraphicscontext3d_impl.cc
|
| @@ -26,6 +26,27 @@
|
|
|
| namespace gpu_blink {
|
|
|
| +class WebGraphicsContext3DErrorMessageCallback
|
| + : public ::gpu::gles2::GLES2ImplementationErrorMessageCallback {
|
| + public:
|
| + WebGraphicsContext3DErrorMessageCallback(
|
| + WebGraphicsContext3DImpl* context)
|
| + : graphics_context_(context) {
|
| + }
|
| +
|
| + void OnErrorMessage(const char* msg, int id) override;
|
| +
|
| + private:
|
| + WebGraphicsContext3DImpl* graphics_context_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(WebGraphicsContext3DErrorMessageCallback);
|
| +};
|
| +
|
| +void WebGraphicsContext3DErrorMessageCallback::OnErrorMessage(
|
| + const char* msg, int id) {
|
| + graphics_context_->OnErrorMessage(msg, id);
|
| +}
|
| +
|
| WebGraphicsContext3DImpl::WebGraphicsContext3DImpl()
|
| : initialized_(false),
|
| initialize_failed_(false),
|
| @@ -47,4 +68,21 @@
|
| context_lost_callback_ = cb;
|
| }
|
|
|
| +::gpu::gles2::GLES2ImplementationErrorMessageCallback*
|
| + WebGraphicsContext3DImpl::getErrorMessageCallback() {
|
| + if (!client_error_message_callback_) {
|
| + client_error_message_callback_.reset(
|
| + new WebGraphicsContext3DErrorMessageCallback(this));
|
| + }
|
| + return client_error_message_callback_.get();
|
| +}
|
| +
|
| +void WebGraphicsContext3DImpl::OnErrorMessage(
|
| + const std::string& message, int id) {
|
| + if (error_message_callback_) {
|
| + blink::WebString str = blink::WebString::fromUTF8(message.c_str());
|
| + error_message_callback_->onErrorMessage(str, id);
|
| + }
|
| +}
|
| +
|
| } // namespace gpu_blink
|
|
|