simple fix for preabandon valgrind error
authorjoshualitt <joshualitt@chromium.org>
Fri, 24 Apr 2015 16:57:12 +0000 (09:57 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 24 Apr 2015 16:57:12 +0000 (09:57 -0700)
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1106663003

src/gpu/GrAtlasTextContext.cpp

index ad56e89..56ad9d2 100644 (file)
@@ -360,6 +360,11 @@ void GrAtlasTextContext::drawTextBlob(GrRenderTarget* rt, const GrClip& clip,
                                       const SkPaint& skPaint, const SkMatrix& viewMatrix,
                                       const SkTextBlob* blob, SkScalar x, SkScalar y,
                                       SkDrawFilter* drawFilter, const SkIRect& clipBounds) {
+    // If we have been abandoned, then don't draw
+    if (!fContext->getTextTarget()) {
+        return;
+    }
+
     SkAutoTUnref<BitmapTextBlob> cacheBlob;
     SkMaskFilter::BlurRec blurRec;
     BitmapTextBlob::Key key;