summaryrefslogtreecommitdiffstats
path: root/cc/output
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2014-09-24 08:50:45 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-24 15:50:57 +0000
commit3af9f604e16585ae3a8e858631f394108df5f4ce (patch)
tree2a177b094829b86cf7eff8e253c551bfcbe2cf37 /cc/output
parent9cebaadae0237f7fcf7285cbb74903732ab1c194 (diff)
downloadchromium_src-3af9f604e16585ae3a8e858631f394108df5f4ce.zip
chromium_src-3af9f604e16585ae3a8e858631f394108df5f4ce.tar.gz
chromium_src-3af9f604e16585ae3a8e858631f394108df5f4ce.tar.bz2
cc: Null-check the result of GrContext::wrapBackendTexture.
This function can return NULL if it fails to attach a stencil buffer, or if it fails to allocate a GrGLTexture object. R=enne@chromium.org BUG=416795 Review URL: https://codereview.chromium.org/596343002 Cr-Commit-Position: refs/heads/master@{#296425}
Diffstat (limited to 'cc/output')
-rw-r--r--cc/output/gl_renderer.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index e039947..6bb6f43 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",