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

Unified Diff: cc/output/gl_renderer.cc

Issue 596343002: cc: Null-check the result of GrContext::wrapBackendTexture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: null: . Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index e039947695c967740fc7ba88ba0e7df11abea869..6bb6f439ed849eb831c38c3287eaa776d4160f6d 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -637,6 +637,12 @@ static skia::RefPtr<SkImage> ApplyImageFilter(
skia::RefPtr<GrTexture> texture =
skia::AdoptRef(use_gr_context->context()->wrapBackendTexture(
backend_texture_description));
+ if (!texture) {
+ TRACE_EVENT_INSTANT0("cc",
+ "ApplyImageFilter wrap background texture failed",
+ TRACE_EVENT_SCOPE_THREAD);
+ return skia::RefPtr<SkImage>();
+ }
SkImageInfo info =
SkImageInfo::MakeN32Premul(source_texture_resource->size().width(),
@@ -660,7 +666,7 @@ static skia::RefPtr<SkImage> ApplyImageFilter(
use_gr_context->context(), desc, GrContext::kExact_ScratchTexMatch);
skia::RefPtr<GrTexture> backing_store =
skia::AdoptRef(scratch_texture.detach());
- if (backing_store.get() == NULL) {
+ if (!backing_store) {
TRACE_EVENT_INSTANT0("cc",
"ApplyImageFilter scratch texture allocation failed",
TRACE_EVENT_SCOPE_THREAD);
@@ -741,6 +747,13 @@ static skia::RefPtr<SkImage> ApplyBlendModeWithBackdrop(
skia::RefPtr<GrTexture> source_texture =
skia::AdoptRef(use_gr_context->context()->wrapBackendTexture(
backend_texture_description));
+ if (!source_texture) {
+ TRACE_EVENT_INSTANT0(
+ "cc",
+ "ApplyBlendModeWithBackdrop wrap source texture failed",
+ TRACE_EVENT_SCOPE_THREAD);
+ return skia::RefPtr<SkImage>();
+ }
backend_texture_description.fWidth = background_size.width();
backend_texture_description.fHeight = background_size.height();
@@ -748,6 +761,13 @@ static skia::RefPtr<SkImage> ApplyBlendModeWithBackdrop(
skia::RefPtr<GrTexture> background_texture =
skia::AdoptRef(use_gr_context->context()->wrapBackendTexture(
backend_texture_description));
+ if (!background_texture) {
+ TRACE_EVENT_INSTANT0(
+ "cc",
+ "ApplyBlendModeWithBackdrop wrap background texture failed",
+ TRACE_EVENT_SCOPE_THREAD);
+ return skia::RefPtr<SkImage>();
+ }
SkImageInfo source_info =
SkImageInfo::MakeN32Premul(source_size.width(), source_size.height());
@@ -780,7 +800,7 @@ static skia::RefPtr<SkImage> ApplyBlendModeWithBackdrop(
use_gr_context->context(), desc, GrContext::kExact_ScratchTexMatch);
skia::RefPtr<GrTexture> backing_store =
skia::AdoptRef(scratch_texture.detach());
- if (backing_store.get() == NULL) {
+ if (!backing_store) {
TRACE_EVENT_INSTANT0(
"cc",
"ApplyBlendModeWithBackdrop scratch texture allocation failed",
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698