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

Unified Diff: cc/resources/scoped_gpu_raster.cc

Issue 1135743004: cc: Add null checks for GrContext created by ContextProviderCommandBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: cc/resources/scoped_gpu_raster.cc
diff --git a/cc/resources/scoped_gpu_raster.cc b/cc/resources/scoped_gpu_raster.cc
index 2f5c5c9c3426a42eca7532cb8919611884a983d1..b816d1de3d19ce716b1561c57be212ba5bf9b99d 100644
--- a/cc/resources/scoped_gpu_raster.cc
+++ b/cc/resources/scoped_gpu_raster.cc
@@ -30,12 +30,14 @@ void ScopedGpuRaster::BeginGpuRaster() {
gl->PushGroupMarkerEXT(0, "GpuRasterization");
class GrContext* gr_context = context_provider_->GrContext();
- gr_context->resetContext();
+ if (gr_context)
+ gr_context->resetContext();
}
void ScopedGpuRaster::EndGpuRaster() {
class GrContext* gr_context = context_provider_->GrContext();
- gr_context->flush();
+ if (gr_context)
+ gr_context->flush();
GLES2Interface* gl = context_provider_->ContextGL();

Powered by Google App Engine
This is Rietveld 408576698