remove support code for serialized bitmaps

This ended ~2 years ago, when we switch to only serializing SkImage

Bug: skia:
Change-Id: I38a0bec990a2cc743f86e5ec831019f6bfb588a6
Reviewed-on: https://skia-review.googlesource.com/125750
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This commit is contained in:
Mike Reed 2018-05-03 14:35:13 -04:00 committed by Skia Commit-Bot
parent de81a21f32
commit c6683137e1
3 changed files with 5 additions and 68 deletions

View File

@ -95,12 +95,6 @@ protected:
bool parseBuffer(SkReadBuffer& buffer);
public:
const SkImage* getBitmapAsImage(SkReadBuffer* reader) const {
// images are written base-0, unlike paths, pictures, drawables, etc.
const int index = reader->readInt();
return reader->validateIndex(index, fBitmapImageCount) ? fBitmapImageRefs[index] : nullptr;
}
const SkImage* getImage(SkReadBuffer* reader) const {
// images are written base-0, unlike paths, pictures, drawables, etc.
const int index = reader->readInt();

View File

@ -30,10 +30,10 @@ enum DrawType {
CLIP_RECT,
CLIP_RRECT,
CONCAT,
DRAW_BITMAP,
DRAW_BITMAP_MATRIX, // deprecated, M41 was last Chromium version to write this to an .skp
DRAW_BITMAP_NINE,
DRAW_BITMAP_RECT,
DRAW_BITMAP_RETIRED_2016_REMOVED_2018,
DRAW_BITMAP_MATRIX_RETIRED_2016_REMOVED_2018,
DRAW_BITMAP_NINE_RETIRED_2016_REMOVED_2018,
DRAW_BITMAP_RECT_RETIRED_2016_REMOVED_2018,
DRAW_CLEAR,
DRAW_DATA,
DRAW_OVAL,
@ -47,7 +47,7 @@ enum DrawType {
DRAW_POS_TEXT_H_TOP_BOTTOM, // fast variant of DRAW_POS_TEXT_H
DRAW_RECT,
DRAW_RRECT,
DRAW_SPRITE,
DRAW_SPRITE_RETIRED_2015_REMOVED_2018,
DRAW_TEXT,
DRAW_TEXT_ON_PATH,
DRAW_TEXT_TOP_BOTTOM, // fast variant of DRAW_TEXT
@ -100,9 +100,6 @@ enum DrawType {
LAST_DRAWTYPE_ENUM = FLUSH
};
// In the 'match' method, this constant will match any flavor of DRAW_BITMAP*
static const int kDRAW_BITMAP_FLAVOR = LAST_DRAWTYPE_ENUM+1;
enum DrawVertexFlags {
DRAW_VERTICES_HAS_TEXS = 0x01,
DRAW_VERTICES_HAS_COLORS = 0x02,

View File

@ -270,53 +270,6 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
canvas->drawAtlas(atlas, xform, tex, colors, count, mode, cull, paint);
} break;
case DRAW_BITMAP: {
const SkPaint* paint = fPictureData->getPaint(reader);
const SkImage* image = fPictureData->getBitmapAsImage(reader);
SkPoint loc;
reader->readPoint(&loc);
BREAK_ON_READ_ERROR(reader);
canvas->drawImage(image, loc.fX, loc.fY, paint);
} break;
case DRAW_BITMAP_RECT: {
const SkPaint* paint = fPictureData->getPaint(reader);
const SkImage* image = fPictureData->getBitmapAsImage(reader);
SkRect storage;
const SkRect* src = get_rect_ptr(reader, &storage); // may be null
SkRect dst;
reader->readRect(&dst); // required
SkCanvas::SrcRectConstraint constraint = (SkCanvas::SrcRectConstraint)reader->readInt();
BREAK_ON_READ_ERROR(reader);
if (src) {
canvas->drawImageRect(image, *src, dst, paint, constraint);
} else {
canvas->drawImageRect(image, dst, paint, constraint);
}
} break;
case DRAW_BITMAP_MATRIX: {
const SkPaint* paint = fPictureData->getPaint(reader);
const SkImage* image = fPictureData->getBitmapAsImage(reader);
SkMatrix matrix;
reader->readMatrix(&matrix);
BREAK_ON_READ_ERROR(reader);
SkAutoCanvasRestore acr(canvas, true);
canvas->concat(matrix);
canvas->drawImage(image, 0, 0, paint);
} break;
case DRAW_BITMAP_NINE: {
const SkPaint* paint = fPictureData->getPaint(reader);
const SkImage* image = fPictureData->getBitmapAsImage(reader);
SkIRect src;
reader->readIRect(&src);
SkRect dst;
reader->readRect(&dst);
BREAK_ON_READ_ERROR(reader);
canvas->drawImageNine(image, src, dst, paint);
} break;
case DRAW_CLEAR: {
auto c = reader->readInt();
BREAK_ON_READ_ERROR(reader);
@ -590,13 +543,6 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
canvas->private_draw_shadow_rec(path, rec);
} break;
case DRAW_SPRITE: {
/* const SkPaint* paint = */ fPictureData->getPaint(reader);
/* const SkImage* image = */ fPictureData->getBitmapAsImage(reader);
/* int left = */ reader->readInt();
/* int top = */ reader->readInt();
// drawSprite removed dec-2015
} break;
case DRAW_TEXT: {
const SkPaint* paint = fPictureData->getPaint(reader);
TextContainer text(reader, paint);