summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorreveman <reveman@chromium.org>2014-11-03 12:56:51 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-03 20:57:05 +0000
commit00f53a49a90a56c22d412a8e0e27e3a4a6ae5155 (patch)
treebfa250bb10bdd8ff9bb10b5bae80607c27186d94 /cc
parenta1104b88763dad9bb171b4a3b7a7a7fee9b27d70 (diff)
downloadchromium_src-00f53a49a90a56c22d412a8e0e27e3a4a6ae5155.zip
chromium_src-00f53a49a90a56c22d412a8e0e27e3a4a6ae5155.tar.gz
chromium_src-00f53a49a90a56c22d412a8e0e27e3a4a6ae5155.tar.bz2
cc: Handle GrContext::wrapBackendTexture failures properly.
GrContext::wrapBackendTexture will return null in case of failure but the compositor assumes that this will never happen. This will make GetSkSurface early out if the return value of GrContext::wrapBackendTexture is null. BUG=419136 Review URL: https://codereview.chromium.org/696353003 Cr-Commit-Position: refs/heads/master@{#302477}
Diffstat (limited to 'cc')
-rw-r--r--cc/resources/resource_provider.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 58023831..023a1cd 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -1125,6 +1125,8 @@ SkSurface* ResourceProvider::ScopedWriteLockGr::GetSkSurface(
desc.fTextureHandle = resource_->gl_id;
skia::RefPtr<GrTexture> gr_texture =
skia::AdoptRef(gr_context->wrapBackendTexture(desc));
+ if (!gr_texture)
+ return nullptr;
SkSurface::TextRenderMode text_render_mode =
use_distance_field_text ? SkSurface::kDistanceField_TextRenderMode
: SkSurface::kStandard_TextRenderMode;