Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Side by Side Diff: content/renderer/webgraphicscontext3d_provider_impl.cc

Issue 1990063004: Move bindToCurrentThread out to the creators of WebGL contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bindwebgl: . Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/common/gpu/client/context_provider_command_buffer.h" 7 #include "content/common/gpu/client/context_provider_command_buffer.h"
8 #include "gpu/command_buffer/client/context_support.h" 8 #include "gpu/command_buffer/client/context_support.h"
9 #include "third_party/WebKit/public/platform/functional/WebFunction.h" 9 #include "third_party/WebKit/public/platform/functional/WebFunction.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 WebGraphicsContext3DProviderImpl::WebGraphicsContext3DProviderImpl( 13 WebGraphicsContext3DProviderImpl::WebGraphicsContext3DProviderImpl(
14 scoped_refptr<ContextProviderCommandBuffer> provider) 14 scoped_refptr<ContextProviderCommandBuffer> provider)
15 : provider_(std::move(provider)) {} 15 : provider_(std::move(provider)) {}
16 16
17 WebGraphicsContext3DProviderImpl::~WebGraphicsContext3DProviderImpl() {} 17 WebGraphicsContext3DProviderImpl::~WebGraphicsContext3DProviderImpl() {}
18 18
19 bool WebGraphicsContext3DProviderImpl::bindToCurrentThread() {
20 return provider_->BindToCurrentThread();
21 }
22
19 gpu::gles2::GLES2Interface* WebGraphicsContext3DProviderImpl::contextGL() { 23 gpu::gles2::GLES2Interface* WebGraphicsContext3DProviderImpl::contextGL() {
20 return provider_->ContextGL(); 24 return provider_->ContextGL();
21 } 25 }
22 26
23 bool WebGraphicsContext3DProviderImpl::bindToCurrentThread() {
24 return provider_->BindToCurrentThread();
25 }
26
27 GrContext* WebGraphicsContext3DProviderImpl::grContext() { 27 GrContext* WebGraphicsContext3DProviderImpl::grContext() {
28 return provider_->GrContext(); 28 return provider_->GrContext();
29 } 29 }
30 30
31 gpu::Capabilities WebGraphicsContext3DProviderImpl::getCapabilities() { 31 gpu::Capabilities WebGraphicsContext3DProviderImpl::getCapabilities() {
32 return provider_->ContextCapabilities(); 32 return provider_->ContextCapabilities();
33 } 33 }
34 34
35 void WebGraphicsContext3DProviderImpl::setLostContextCallback( 35 void WebGraphicsContext3DProviderImpl::setLostContextCallback(
36 blink::WebClosure c) { 36 blink::WebClosure c) {
37 provider_->SetLostContextCallback(c.TakeBaseCallback()); 37 provider_->SetLostContextCallback(c.TakeBaseCallback());
38 } 38 }
39 39
40 void WebGraphicsContext3DProviderImpl::setErrorMessageCallback( 40 void WebGraphicsContext3DProviderImpl::setErrorMessageCallback(
41 blink::WebFunction<void(const char*, int32_t)> c) { 41 blink::WebFunction<void(const char*, int32_t)> c) {
42 provider_->ContextSupport()->SetErrorMessageCallback(c.TakeBaseCallback()); 42 provider_->ContextSupport()->SetErrorMessageCallback(c.TakeBaseCallback());
43 } 43 }
44 44
45 } // namespace content 45 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698