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

Unified Diff: cc/raster/staging_buffer_pool.cc

Issue 2007593005: Remove the concept of OutputSurface from ResourceProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resourceprovider-no-outputsurface: moreccptcompile 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/raster/staging_buffer_pool.h ('k') | cc/resources/resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « cc/raster/staging_buffer_pool.h ('k') | cc/resources/resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698