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 #include "content/renderer/webgraphicscontext3d_provider_impl.h" | 5 #include "content/renderer/webgraphicscontext3d_provider_impl.h" |
6 | 6 |
7 #include "cc/blink/context_provider_web_context.h" | 7 #include "cc/blink/context_provider_web_context.h" |
8 #include "third_party/WebKit/public/platform/callback/WebClosure.h" | 8 #include "gpu/command_buffer/client/context_support.h" |
| 9 #include "third_party/WebKit/public/platform/functional/WebFunction.h" |
9 | 10 |
10 namespace content { | 11 namespace content { |
11 | 12 |
12 WebGraphicsContext3DProviderImpl::WebGraphicsContext3DProviderImpl( | 13 WebGraphicsContext3DProviderImpl::WebGraphicsContext3DProviderImpl( |
13 scoped_refptr<cc_blink::ContextProviderWebContext> provider) | 14 scoped_refptr<cc_blink::ContextProviderWebContext> provider) |
14 : provider_(provider) { | 15 : provider_(provider) { |
15 } | 16 } |
16 | 17 |
17 WebGraphicsContext3DProviderImpl::~WebGraphicsContext3DProviderImpl() {} | 18 WebGraphicsContext3DProviderImpl::~WebGraphicsContext3DProviderImpl() {} |
18 | 19 |
19 blink::WebGraphicsContext3D* WebGraphicsContext3DProviderImpl::context3d() { | 20 blink::WebGraphicsContext3D* WebGraphicsContext3DProviderImpl::context3d() { |
20 return provider_->WebContext3D(); | 21 return provider_->WebContext3D(); |
21 } | 22 } |
22 | 23 |
23 gpu::gles2::GLES2Interface* WebGraphicsContext3DProviderImpl::contextGL() { | 24 gpu::gles2::GLES2Interface* WebGraphicsContext3DProviderImpl::contextGL() { |
24 return provider_->ContextGL(); | 25 return provider_->ContextGL(); |
25 } | 26 } |
26 | 27 |
27 GrContext* WebGraphicsContext3DProviderImpl::grContext() { | 28 GrContext* WebGraphicsContext3DProviderImpl::grContext() { |
28 return provider_->GrContext(); | 29 return provider_->GrContext(); |
29 } | 30 } |
30 | 31 |
31 void WebGraphicsContext3DProviderImpl::setLostContextCallback( | 32 void WebGraphicsContext3DProviderImpl::setLostContextCallback( |
32 blink::WebClosure c) { | 33 blink::WebClosure c) { |
33 provider_->SetLostContextCallback(c.TakeBaseClosure()); | 34 provider_->SetLostContextCallback(c.TakeBaseCallback()); |
| 35 } |
| 36 |
| 37 void WebGraphicsContext3DProviderImpl::setErrorMessageCallback( |
| 38 blink::WebFunction<void(const char*, int32_t)> c) { |
| 39 provider_->ContextSupport()->SetErrorMessageCallback(c.TakeBaseCallback()); |
34 } | 40 } |
35 | 41 |
36 } // namespace content | 42 } // namespace content |
OLD | NEW |