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

Unified Diff: cc/resources/resource_provider.cc

Issue 375303002: cc: Refactor ResourceProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing typing error in build.gn Created 6 years, 5 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/resources/resource_provider.h ('k') | cc/resources/scoped_gpu_raster.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index cf79940c44f36c87384c99fc9730c20d19e9411c..1f2f598a0c247987131b2adc5bd75cfdf13359ba 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -1015,30 +1015,6 @@ base::TimeTicks ResourceProvider::EstimatedUploadCompletionTime(
return gfx::FrameTime::Now() + upload_one_texture_time * total_uploads;
}
-void ResourceProvider::Flush() {
- DCHECK(thread_checker_.CalledOnValidThread());
- GLES2Interface* gl = ContextGL();
- if (gl)
- gl->Flush();
-}
-
-void ResourceProvider::Finish() {
- DCHECK(thread_checker_.CalledOnValidThread());
- GLES2Interface* gl = ContextGL();
- if (gl)
- gl->Finish();
-}
-
-bool ResourceProvider::ShallowFlushIfSupported() {
- DCHECK(thread_checker_.CalledOnValidThread());
- GLES2Interface* gl = ContextGL();
- if (!gl)
- return false;
-
- gl->ShallowFlushCHROMIUM();
- return true;
-}
-
ResourceProvider::Resource* ResourceProvider::GetResource(ResourceId id) {
DCHECK(thread_checker_.CalledOnValidThread());
ResourceMap::iterator it = resources_.find(id);
@@ -1229,16 +1205,6 @@ ResourceProvider::ScopedWriteLockSoftware::~ScopedWriteLockSoftware() {
resource_provider_->UnlockForWrite(resource_id_);
}
-ResourceProvider::ScopedGpuRaster::ScopedGpuRaster(
- ResourceProvider* resource_provider)
- : resource_provider_(resource_provider) {
- resource_provider_->BeginGpuRaster();
-}
-
-ResourceProvider::ScopedGpuRaster::~ScopedGpuRaster() {
- resource_provider_->EndGpuRaster();
-}
-
ResourceProvider::ResourceProvider(OutputSurface* output_surface,
SharedBitmapManager* shared_bitmap_manager,
int highp_threshold_min,
@@ -1331,7 +1297,7 @@ void ResourceProvider::CleanUpGLIfNeeded() {
texture_uploader_.reset();
texture_id_allocator_.reset();
buffer_id_allocator_.reset();
- Finish();
+ gl->Finish();
}
int ResourceProvider::CreateChild(const ReturnCallback& return_callback) {
@@ -2283,32 +2249,4 @@ class GrContext* ResourceProvider::GrContext() const {
return context_provider ? context_provider->GrContext() : NULL;
}
-void ResourceProvider::BeginGpuRaster() {
- GLES2Interface* gl = ContextGL();
- DCHECK(gl);
-
- // TODO(alokp): Use a trace macro to push/pop markers.
- // Using push/pop functions directly incurs cost to evaluate function
- // arguments even when tracing is disabled.
- gl->PushGroupMarkerEXT(0, "GpuRasterization");
-
- class GrContext* gr_context = GrContext();
- if (gr_context)
- gr_context->resetContext();
-}
-
-void ResourceProvider::EndGpuRaster() {
- GLES2Interface* gl = ContextGL();
- DCHECK(gl);
-
- class GrContext* gr_context = GrContext();
- if (gr_context)
- gr_context->flush();
-
- // TODO(alokp): Use a trace macro to push/pop markers.
- // Using push/pop functions directly incurs cost to evaluate function
- // arguments even when tracing is disabled.
- gl->PopGroupMarkerEXT();
-}
-
} // namespace cc
« no previous file with comments | « cc/resources/resource_provider.h ('k') | cc/resources/scoped_gpu_raster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698