check for newSurface failure
BUG=skia: Review URL: https://codereview.chromium.org/622063003
This commit is contained in:
parent
d1f0ebd0e2
commit
337c2dd420
@ -38,6 +38,13 @@ protected:
|
||||
const SkRect fullCanvasRect = SkRect::MakeWH(
|
||||
SkIntToScalar(kSurfaceWidth), SkIntToScalar(kSurfaceHeight));
|
||||
SkAutoTUnref<SkSurface> surface(canvas->newSurface(info));
|
||||
|
||||
// newSurface() can return NULL for several reasons, so we need to check
|
||||
if (NULL == surface.get()) {
|
||||
SkDebugf("DeferredSurfaceCopyBench newSurface failed, bench results are meaningless\n");
|
||||
return; // should we signal the caller that we hit an error?
|
||||
}
|
||||
|
||||
SkAutoTUnref<SkDeferredCanvas> drawingCanvas(SkDeferredCanvas::Create(surface));
|
||||
|
||||
for (int iteration = 0; iteration < loops; iteration++) {
|
||||
|
Loading…
Reference in New Issue
Block a user