Chromium Code Reviews| Index: blimp/client/feature/compositor/blimp_context_provider.cc |
| diff --git a/blimp/client/feature/compositor/blimp_context_provider.cc b/blimp/client/feature/compositor/blimp_context_provider.cc |
| index 8c68d7b9b957b7a060788544f76756f3903aaa3b..0b21bfc2cdaae0195a461b1995fb845908303ba2 100644 |
| --- a/blimp/client/feature/compositor/blimp_context_provider.cc |
| +++ b/blimp/client/feature/compositor/blimp_context_provider.cc |
| @@ -7,6 +7,7 @@ |
| #include "base/bind.h" |
| #include "base/callback_helpers.h" |
| #include "base/lazy_instance.h" |
| +#include "cc/output/context_cache_controller.h" |
| #include "gpu/command_buffer/client/gl_in_process_context.h" |
| #include "gpu/command_buffer/client/gles2_implementation.h" |
| #include "gpu/command_buffer/client/gles2_lib.h" |
| @@ -48,6 +49,9 @@ BlimpContextProvider::BlimpContextProvider( |
| gpu_memory_buffer_manager, nullptr /* memory_limits */)); |
| context_->GetImplementation()->SetLostContextCallback( |
| base::Bind(&BlimpContextProvider::OnLostContext, base::Unretained(this))); |
| + |
| + cache_controller_.reset( |
| + new cc::ContextCacheController(context_->GetImplementation())); |
| } |
| BlimpContextProvider::~BlimpContextProvider() { |
| @@ -87,9 +91,15 @@ class GrContext* BlimpContextProvider::GrContext() { |
| gr_context_.reset(new skia_bindings::GrContextForGLES2Interface(ContextGL())); |
| + cache_controller_->SetGrContext(gr_context_->get()); |
|
danakj
2016/08/26 23:49:08
nit: prefer this grouped with the gr_context_reset
ericrk
2016/08/29 22:43:22
Done.
|
| return gr_context_->get(); |
| } |
| +cc::ContextCacheController* BlimpContextProvider::CacheController() { |
| + DCHECK(context_thread_checker_.CalledOnValidThread()); |
| + return cache_controller_.get(); |
| +} |
| + |
| void BlimpContextProvider::InvalidateGrContext(uint32_t state) { |
| DCHECK(context_thread_checker_.CalledOnValidThread()); |
| @@ -103,13 +113,6 @@ base::Lock* BlimpContextProvider::GetLock() { |
| return nullptr; |
| } |
| -void BlimpContextProvider::DeleteCachedResources() { |
| - DCHECK(context_thread_checker_.CalledOnValidThread()); |
| - |
| - if (gr_context_) |
| - gr_context_->FreeGpuResources(); |
| -} |
| - |
| void BlimpContextProvider::SetLostContextCallback( |
| const LostContextCallback& lost_context_callback) { |
| DCHECK(context_thread_checker_.CalledOnValidThread()); |