From 18ff51c46d2b4cb9277f26293e718e303079d7e8 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Thu, 1 Feb 2018 15:52:58 -0500 Subject: [PATCH] signal on bad picture op, simplify other ops Bug: skia:7569 Change-Id: Iec5d7472e6cdb0fe87a634209c5349085c9ebfbd Reviewed-on: https://skia-review.googlesource.com/102424 Reviewed-by: Robert Phillips Commit-Queue: Mike Reed --- src/core/SkPicturePlayback.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp index 69542bbd4a..f0d454a5ff 100644 --- a/src/core/SkPicturePlayback.cpp +++ b/src/core/SkPicturePlayback.cpp @@ -684,8 +684,6 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader, break; case ROTATE: { auto deg = reader->readScalar(); - BREAK_ON_READ_ERROR(reader); - canvas->rotate(deg); } break; case SAVE: @@ -734,34 +732,27 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader, case SCALE: { SkScalar sx = reader->readScalar(); SkScalar sy = reader->readScalar(); - BREAK_ON_READ_ERROR(reader); - canvas->scale(sx, sy); } break; case SET_MATRIX: { SkMatrix matrix; reader->readMatrix(&matrix); - BREAK_ON_READ_ERROR(reader); - matrix.postConcat(initialMatrix); canvas->setMatrix(matrix); } break; case SKEW: { SkScalar sx = reader->readScalar(); SkScalar sy = reader->readScalar(); - BREAK_ON_READ_ERROR(reader); - canvas->skew(sx, sy); } break; case TRANSLATE: { SkScalar dx = reader->readScalar(); SkScalar dy = reader->readScalar(); - BREAK_ON_READ_ERROR(reader); - canvas->translate(dx, dy); } break; default: - SkASSERTF(false, "Unknown draw type: %d", op); + reader->validate(false); // unknown op + break; } #undef BREAK_ON_READ_ERROR