aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-05-03 14:35:13 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-03 19:13:32 +0000
commitc6683137e1744ac6ba2933ff605eeafcb0ce7212 (patch)
treec3266e31dd498988350b672762497f0f7507eb67
parentde81a21f32a58e6734e1ff5bf7039da9d4a55972 (diff)
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>
-rw-r--r--src/core/SkPictureData.h6
-rw-r--r--src/core/SkPictureFlat.h13
-rw-r--r--src/core/SkPicturePlayback.cpp54
3 files changed, 5 insertions, 68 deletions
diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h
index 26fdca912c..3d54a47a79 100644
--- a/src/core/SkPictureData.h
+++ b/src/core/SkPictureData.h
@@ -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();
diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h
index ed9d0684fd..e48272d982 100644
--- a/src/core/SkPictureFlat.h
+++ b/src/core/SkPictureFlat.h
@@ -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,
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 9964c748fa..f28843e0d6 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -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);