| Index: cc/raster/staging_buffer_pool.cc
|
| diff --git a/cc/raster/staging_buffer_pool.cc b/cc/raster/staging_buffer_pool.cc
|
| index cb14f8224ba83db03c468ee26c9ccb7ba790da68..99fb43843105ece60a3ac000cbd3236ce601c003 100644
|
| --- a/cc/raster/staging_buffer_pool.cc
|
| +++ b/cc/raster/staging_buffer_pool.cc
|
| @@ -120,22 +120,13 @@ void StagingBuffer::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
|
| pmd->AddOwnershipEdge(buffer_dump->guid(), shared_buffer_guid, kImportance);
|
| }
|
|
|
| -// static
|
| -std::unique_ptr<StagingBufferPool> StagingBufferPool::Create(
|
| - base::SequencedTaskRunner* task_runner,
|
| - ResourceProvider* resource_provider,
|
| - bool use_partial_raster,
|
| - int max_staging_buffer_usage_in_bytes) {
|
| - return base::WrapUnique(
|
| - new StagingBufferPool(task_runner, resource_provider, use_partial_raster,
|
| - max_staging_buffer_usage_in_bytes));
|
| -}
|
| -
|
| StagingBufferPool::StagingBufferPool(base::SequencedTaskRunner* task_runner,
|
| + ContextProvider* worker_context_provider,
|
| ResourceProvider* resource_provider,
|
| bool use_partial_raster,
|
| int max_staging_buffer_usage_in_bytes)
|
| : task_runner_(task_runner),
|
| + worker_context_provider_(worker_context_provider),
|
| resource_provider_(resource_provider),
|
| use_partial_raster_(use_partial_raster),
|
| max_staging_buffer_usage_in_bytes_(max_staging_buffer_usage_in_bytes),
|
| @@ -145,6 +136,7 @@ StagingBufferPool::StagingBufferPool(base::SequencedTaskRunner* task_runner,
|
| base::TimeDelta::FromMilliseconds(kStagingBufferExpirationDelayMs)),
|
| reduce_memory_usage_pending_(false),
|
| weak_ptr_factory_(this) {
|
| + DCHECK(worker_context_provider_);
|
| base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
|
| this, "cc::StagingBufferPool", base::ThreadTaskRunnerHandle::Get());
|
| reduce_memory_usage_callback_ = base::Bind(
|
| @@ -243,11 +235,7 @@ std::unique_ptr<StagingBuffer> StagingBufferPool::AcquireStagingBuffer(
|
|
|
| std::unique_ptr<StagingBuffer> staging_buffer;
|
|
|
| - ContextProvider* context_provider =
|
| - resource_provider_->output_surface()->worker_context_provider();
|
| - DCHECK(context_provider);
|
| -
|
| - ContextProvider::ScopedContextLock scoped_context(context_provider);
|
| + ContextProvider::ScopedContextLock scoped_context(worker_context_provider_);
|
|
|
| gpu::gles2::GLES2Interface* gl = scoped_context.ContextGL();
|
| DCHECK(gl);
|
| @@ -392,12 +380,8 @@ void StagingBufferPool::ReduceMemoryUsage() {
|
| void StagingBufferPool::ReleaseBuffersNotUsedSince(base::TimeTicks time) {
|
| lock_.AssertAcquired();
|
|
|
| - ContextProvider* context_provider =
|
| - resource_provider_->output_surface()->worker_context_provider();
|
| - DCHECK(context_provider);
|
| -
|
| {
|
| - ContextProvider::ScopedContextLock scoped_context(context_provider);
|
| + ContextProvider::ScopedContextLock scoped_context(worker_context_provider_);
|
|
|
| gpu::gles2::GLES2Interface* gl = scoped_context.ContextGL();
|
| DCHECK(gl);
|
|
|