| Index: content/browser/android/in_process/context_provider_in_process.cc
|
| diff --git a/content/browser/android/in_process/context_provider_in_process.cc b/content/browser/android/in_process/context_provider_in_process.cc
|
| index 71f8010390fc96cb47e1e09449ad2680a4f860b4..fda13aaddc58c8d09833d51b2bd3014ac706df10 100644
|
| --- a/content/browser/android/in_process/context_provider_in_process.cc
|
| +++ b/content/browser/android/in_process/context_provider_in_process.cc
|
| @@ -22,11 +22,11 @@
|
| public:
|
| explicit LostContextCallbackProxy(ContextProviderInProcess* provider)
|
| : provider_(provider) {
|
| - provider_->WebContext3DImpl()->setContextLostCallback(this);
|
| + provider_->context3d_->setContextLostCallback(this);
|
| }
|
|
|
| virtual ~LostContextCallbackProxy() {
|
| - provider_->WebContext3DImpl()->setContextLostCallback(NULL);
|
| + provider_->context3d_->setContextLostCallback(NULL);
|
| }
|
|
|
| virtual void onContextLost() {
|
| @@ -49,12 +49,10 @@
|
| ContextProviderInProcess::ContextProviderInProcess(
|
| scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d,
|
| const std::string& debug_name)
|
| - : debug_name_(debug_name) {
|
| + : context3d_(context3d.Pass()),
|
| + debug_name_(debug_name) {
|
| DCHECK(main_thread_checker_.CalledOnValidThread());
|
| - DCHECK(context3d);
|
| - gr_interface_ = skia::AdoptRef(new GrGLInterfaceForWebGraphicsContext3D(
|
| - context3d.Pass()));
|
| - DCHECK(gr_interface_->WebContext3D());
|
| + DCHECK(context3d_);
|
| context_thread_checker_.DetachFromThread();
|
| }
|
|
|
| @@ -67,20 +65,11 @@
|
| DCHECK(lost_context_callback_proxy_); // Is bound to thread.
|
| DCHECK(context_thread_checker_.CalledOnValidThread());
|
|
|
| - return WebContext3DImpl();
|
| -}
|
| -
|
| -gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl*
|
| - ContextProviderInProcess::WebContext3DImpl() {
|
| - DCHECK(gr_interface_->WebContext3D());
|
| -
|
| - return
|
| - static_cast<gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl*>(
|
| - gr_interface_->WebContext3D());
|
| + return context3d_.get();
|
| }
|
|
|
| bool ContextProviderInProcess::BindToCurrentThread() {
|
| - DCHECK(WebContext3DImpl());
|
| + DCHECK(context3d_);
|
|
|
| // This is called on the thread the context will be used.
|
| DCHECK(context_thread_checker_.CalledOnValidThread());
|
| @@ -88,15 +77,14 @@
|
| if (lost_context_callback_proxy_)
|
| return true;
|
|
|
| - if (!WebContext3DImpl()->InitializeOnCurrentThread())
|
| + if (!context3d_->InitializeOnCurrentThread())
|
| return false;
|
|
|
| - gr_interface_->BindToCurrentThread();
|
| InitializeCapabilities();
|
|
|
| const std::string unique_context_name =
|
| - base::StringPrintf("%s-%p", debug_name_.c_str(), WebContext3DImpl());
|
| - WebContext3DImpl()->traceBeginCHROMIUM("gpu_toplevel",
|
| + base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get());
|
| + context3d_->traceBeginCHROMIUM("gpu_toplevel",
|
| unique_context_name.c_str());
|
|
|
| lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this));
|
| @@ -108,9 +96,9 @@
|
| }
|
|
|
| void ContextProviderInProcess::InitializeCapabilities() {
|
| - capabilities_.gpu = WebContext3DImpl()->GetImplementation()->capabilities();
|
| + capabilities_.gpu = context3d_->GetImplementation()->capabilities();
|
|
|
| - size_t mapped_memory_limit = WebContext3DImpl()->GetMappedMemoryLimit();
|
| + size_t mapped_memory_limit = context3d_->GetMappedMemoryLimit();
|
| capabilities_.max_transfer_buffer_usage_bytes =
|
| mapped_memory_limit ==
|
| WebGraphicsContext3DInProcessCommandBufferImpl::kNoLimit
|
| @@ -126,21 +114,21 @@
|
| }
|
|
|
| ::gpu::gles2::GLES2Interface* ContextProviderInProcess::ContextGL() {
|
| - DCHECK(WebContext3DImpl());
|
| + DCHECK(context3d_);
|
| DCHECK(lost_context_callback_proxy_); // Is bound to thread.
|
| DCHECK(context_thread_checker_.CalledOnValidThread());
|
|
|
| - return WebContext3DImpl()->GetGLInterface();
|
| + return context3d_->GetGLInterface();
|
| }
|
|
|
| ::gpu::ContextSupport* ContextProviderInProcess::ContextSupport() {
|
| - DCHECK(WebContext3DImpl());
|
| + DCHECK(context3d_);
|
| if (!lost_context_callback_proxy_)
|
| return NULL; // Not bound to anything.
|
|
|
| DCHECK(context_thread_checker_.CalledOnValidThread());
|
|
|
| - return WebContext3DImpl()->GetContextSupport();
|
| + return context3d_->GetContextSupport();
|
| }
|
|
|
| class GrContext* ContextProviderInProcess::GrContext() {
|
| @@ -150,7 +138,7 @@
|
| if (gr_context_)
|
| return gr_context_->get();
|
|
|
| - gr_context_.reset(new GrContextForWebGraphicsContext3D(gr_interface_));
|
| + gr_context_.reset(new GrContextForWebGraphicsContext3D(context3d_.get()));
|
| return gr_context_->get();
|
| }
|
|
|
| @@ -163,7 +151,7 @@
|
| }
|
|
|
| void ContextProviderInProcess::SetupLock() {
|
| - WebContext3DImpl()->SetLock(&context_lock_);
|
| + context3d_->SetLock(&context_lock_);
|
| }
|
|
|
| base::Lock* ContextProviderInProcess::GetLock() {
|
|
|