remove overrides of (dead) onDrawTextRSXform

Bug: skia:
Change-Id: Iebfe7bd322849e73a0e84c1b04ac0f4c922fb746
Reviewed-on: https://skia-review.googlesource.com/c/179561
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2018-12-20 16:05:08 -05:00 committed by Skia Commit-Bot
parent df3d225e80
commit 1332743dcc
26 changed files with 5 additions and 190 deletions

View File

@ -2443,8 +2443,8 @@ protected:
virtual void onDrawPath(const SkPath& path, const SkPaint& paint);
virtual void onDrawRegion(const SkRegion& region, const SkPaint& paint);
virtual void onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cullRect, const SkPaint& paint);
virtual void onDrawTextRSXform(const void*, size_t, const SkRSXform[],
const SkRect*, const SkPaint&) {}
virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint);

View File

@ -31,8 +31,6 @@ protected:
void didSetMatrix(const SkMatrix&) override;
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
void onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cull, const SkPaint& paint) override;
virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) override;

View File

@ -36,8 +36,6 @@ protected:
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) override;
void onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cull, const SkPaint& paint) override;
virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
const SkPoint texCoords[4], SkBlendMode,
const SkPaint& paint) override;

View File

@ -44,8 +44,6 @@ protected:
void onDrawAnnotation(const SkRect&, const char[], SkData*) override {}
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override {}
void onDrawDrawable(SkDrawable*, const SkMatrix*) override {}
void onDrawTextRSXform(const void*, size_t, const SkRSXform[], const SkRect*,
const SkPaint&) override {}
void onDrawTextBlob(const SkTextBlob*, SkScalar, SkScalar, const SkPaint&) override {}
void onDrawPatch(const SkPoint[12], const SkColor[4], const SkPoint[4], SkBlendMode,
const SkPaint&) override {}

View File

@ -98,8 +98,6 @@ protected:
void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
void onDrawDrawable(SkDrawable*, const SkMatrix*) override;
void onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cull, const SkPaint& paint) override;
void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) override;
void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[],

View File

@ -2515,11 +2515,6 @@ void SkCanvas::onDrawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattic
LOOPER_END
}
void SkCanvas::onDrawTextRSXform(const void* text, size_t len, const SkRSXform xform[],
const SkRect* cullRect, const SkPaint& paint) {
SkASSERT(false);
}
void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) {
SkRect storage;

View File

@ -108,11 +108,6 @@ public:
fTarget->drawVertices(vertices, bones, boneCount, mode, fXformer->apply(paint));
}
void onDrawTextRSXform(const void* ptr, size_t len,
const SkRSXform* xforms, const SkRect* cull,
const SkPaint& paint) override {
fTarget->drawTextRSXform(ptr, len, xforms, cull, fXformer->apply(paint));
}
void onDrawTextBlob(const SkTextBlob* blob,
SkScalar x, SkScalar y,
const SkPaint& paint) override {

View File

@ -55,7 +55,7 @@ namespace {
M(DrawPaint) M(DrawPath) M(DrawRect) M(DrawRegion) M(DrawOval) M(DrawArc) \
M(DrawRRect) M(DrawDRRect) M(DrawAnnotation) M(DrawDrawable) M(DrawPicture) \
M(DrawImage) M(DrawImageNine) M(DrawImageRect) M(DrawImageLattice) M(DrawImageSet) \
M(DrawTextRSXform) M(DrawTextBlob) \
M(DrawTextBlob) \
M(DrawPatch) M(DrawPoints) M(DrawVertices) M(DrawAtlas) M(DrawShadowRec)
#define M(T) T,
@ -350,25 +350,6 @@ namespace {
c->experimental_DrawImageSetV1(set.get(), count, quality, xfermode);
}
};
struct DrawTextRSXform final : Op {
static const auto kType = Type::DrawTextRSXform;
DrawTextRSXform(size_t bytes, int xforms, const SkRect* cull, const SkPaint& paint)
: bytes(bytes), xforms(xforms), paint(paint) {
if (cull) { this->cull = *cull; }
}
size_t bytes;
int xforms;
SkRect cull = kUnset;
SkPaint paint;
void draw(SkCanvas* c, const SkMatrix&) const {
// For alignment, the SkRSXforms are first in the pod section, followed by the text.
c->drawTextRSXform(pod<void>(this,xforms*sizeof(SkRSXform)),
bytes,
pod<SkRSXform>(this),
maybe_unset(cull),
paint);
}
};
struct DrawTextBlob final : Op {
static const auto kType = Type::DrawTextBlob;
DrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint)
@ -598,12 +579,6 @@ void SkLiteDL::drawImageSet(const SkCanvas::ImageSetEntry set[], int count,
this->push<DrawImageSet>(0, set, count, filterQuality, mode);
}
void SkLiteDL::drawTextRSXform(const void* text, size_t bytes,
const SkRSXform xforms[], const SkRect* cull, const SkPaint& paint) {
int n = SkFont::LEGACY_ExtractFromPaint(paint).countText(text, bytes, paint.getTextEncoding());
void* pod = this->push<DrawTextRSXform>(bytes+n*sizeof(SkRSXform), bytes, n, cull, paint);
copy_v(pod, xforms,n, (const char*)text,bytes);
}
void SkLiteDL::drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint) {
this->push<DrawTextBlob>(0, blob, x,y, paint);
}

View File

@ -56,7 +56,6 @@ public:
void drawDrawable (SkDrawable*, const SkMatrix*);
void drawPicture (const SkPicture*, const SkMatrix*, const SkPaint*);
void drawTextRSXform(const void*, size_t, const SkRSXform[], const SkRect*, const SkPaint&);
void drawTextBlob (const SkTextBlob*, SkScalar,SkScalar, const SkPaint&);
void drawImage (sk_sp<const SkImage>, SkScalar,SkScalar, const SkPaint*);

View File

@ -95,11 +95,6 @@ void SkLiteRecorder::onDrawAnnotation(const SkRect& rect, const char key[], SkDa
fDL->drawAnnotation(rect, key, val);
}
void SkLiteRecorder::onDrawTextRSXform(const void* text, size_t bytes,
const SkRSXform xform[], const SkRect* cull,
const SkPaint& paint) {
fDL->drawTextRSXform(text, bytes, xform, cull, paint);
}
void SkLiteRecorder::onDrawTextBlob(const SkTextBlob* blob,
SkScalar x, SkScalar y,
const SkPaint& paint) {

View File

@ -49,8 +49,6 @@ public:
void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
void onDrawAnnotation(const SkRect&, const char[], SkData*) override;
void onDrawTextRSXform(const void*, size_t,
const SkRSXform[], const SkRect*, const SkPaint&) override;
void onDrawTextBlob(const SkTextBlob*, SkScalar, SkScalar, const SkPaint&) override;
void onDrawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint*) override;

View File

@ -85,7 +85,7 @@ enum DrawType {
DRAW_ANNOTATION,
DRAW_DRAWABLE,
DRAW_DRAWABLE_MATRIX,
DRAW_TEXT_RSXFORM,
DRAW_TEXT_RSXFORM_DEPRECATED_DEC_2018,
TRANSLATE_Z, // deprecated (M60)

View File

@ -606,7 +606,7 @@ void SkPicturePlayback::handleOp(SkReadBuffer* reader,
BREAK_ON_READ_ERROR(reader);
// no longer supported, so we draw nothing
} break;
case DRAW_TEXT_RSXFORM: {
case DRAW_TEXT_RSXFORM_DEPRECATED_DEC_2018: {
const SkPaint* paint = fPictureData->getPaint(reader);
uint32_t count = reader->readUInt();
uint32_t flags = reader->readUInt();

View File

@ -581,30 +581,6 @@ void SkPictureRecord::onDrawImageSet(const SkCanvas::ImageSetEntry set[], int co
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawTextRSXform(const void* text, size_t byteLength,
const SkRSXform xform[], const SkRect* cull,
const SkPaint& paint) {
const int count = SkFont::LEGACY_ExtractFromPaint(paint).countText(text, byteLength, paint.getTextEncoding());
// [op + paint-index + count + flags + length] + [text] + [xform] + cull
size_t size = 5 * kUInt32Size + SkAlign4(byteLength) + count * sizeof(SkRSXform);
uint32_t flags = 0;
if (cull) {
flags |= DRAW_TEXT_RSXFORM_HAS_CULL;
size += sizeof(SkRect);
}
size_t initialOffset = this->addDraw(DRAW_TEXT_RSXFORM, &size);
this->addPaint(paint);
this->addInt(count);
this->addInt(flags);
this->addText(text, byteLength);
fWriter.write(xform, count * sizeof(SkRSXform));
if (cull) {
fWriter.write(cull, sizeof(SkRect));
}
this->validate(initialOffset, size);
}
void SkPictureRecord::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) {

View File

@ -165,8 +165,6 @@ protected:
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
void onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cull, const SkPaint&) override;
void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) override;

View File

@ -126,7 +126,6 @@ DRAW(DrawRRect, drawRRect(r.rrect, r.paint));
DRAW(DrawRect, drawRect(r.rect, r.paint));
DRAW(DrawRegion, drawRegion(r.region, r.paint));
DRAW(DrawTextBlob, drawTextBlob(r.blob.get(), r.x, r.y, r.paint));
DRAW(DrawTextRSXform, drawTextRSXform(r.text, r.byteLength, r.xforms, r.cull, r.paint));
DRAW(DrawAtlas, drawAtlas(r.atlas.get(),
r.xforms, r.texs, r.colors, r.count, r.mode, r.cull, r.paint));
DRAW(DrawVertices, drawVertices(r.vertices, r.bones, r.boneCount, r.bmode, r.paint));
@ -437,14 +436,6 @@ private:
return this->adjustAndMap(dst, op.paint);
}
Bounds bounds(const DrawTextRSXform& op) const {
if (op.cull) {
return this->adjustAndMap(*op.cull, nullptr);
} else {
return fCullRect;
}
}
Bounds bounds(const DrawTextBlob& op) const {
SkRect dst = op.blob->bounds();
dst.offset(op.x, op.y);

View File

@ -262,16 +262,6 @@ void SkRecorder::onDrawImageSet(const ImageSetEntry set[], int count, SkFilterQu
this->append<SkRecords::DrawImageSet>(std::move(setCopy), count, filterQuality, mode);
}
void SkRecorder::onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cull, const SkPaint& paint) {
this->append<SkRecords::DrawTextRSXform>(
paint,
this->copy((const char*)text, byteLength),
byteLength,
this->copy(xform, SkFont::LEGACY_ExtractFromPaint(paint).countText(text, byteLength, paint.getTextEncoding())),
this->copy(cull));
}
void SkRecorder::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) {
TRY_MINIRECORDER(drawTextBlob, blob, x, y, paint);

View File

@ -68,11 +68,6 @@ public:
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
void onDrawDrawable(SkDrawable*, const SkMatrix*) override;
void onDrawTextRSXform(const void* text,
size_t byteLength,
const SkRSXform[],
const SkRect* cull,
const SkPaint& paint) override;
void onDrawTextBlob(const SkTextBlob* blob,
SkScalar x,
SkScalar y,

View File

@ -65,7 +65,6 @@ namespace SkRecords {
M(DrawPatch) \
M(DrawPicture) \
M(DrawPoints) \
M(DrawTextRSXform) \
M(DrawRRect) \
M(DrawRect) \
M(DrawRegion) \
@ -295,12 +294,6 @@ RECORD(DrawTextBlob, kDraw_Tag|kHasText_Tag|kHasPaint_Tag,
sk_sp<const SkTextBlob> blob;
SkScalar x;
SkScalar y);
RECORD(DrawTextRSXform, kDraw_Tag|kHasText_Tag|kHasPaint_Tag,
SkPaint paint;
PODArray<char> text;
size_t byteLength;
PODArray<SkRSXform> xforms;
Optional<SkRect> cull);
RECORD(DrawPatch, kDraw_Tag|kHasPaint_Tag,
SkPaint paint;
PODArray<SkPoint> cubics;

View File

@ -259,14 +259,6 @@ void SkLuaCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const
}
}
void SkLuaCanvas::onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cull, const SkPaint& paint) {
AUTO_LUA("drawTextRSXform");
lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
// TODO: export other params
lua.pushPaint(paint, "paint");
}
void SkLuaCanvas::onDrawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y,
const SkPaint &paint) {
AUTO_LUA("drawTextBlob");

View File

@ -277,14 +277,6 @@ void SkNWayCanvas::onDrawImageSet(const SkCanvas::ImageSetEntry set[], int count
}
}
void SkNWayCanvas::onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cull, const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawTextRSXform(text, byteLength, xform, cull, paint);
}
}
void SkNWayCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint &paint) {
Iter iter(fList);

View File

@ -220,15 +220,6 @@ void SkPaintFilterCanvas::onDrawDrawable(SkDrawable* drawable, const SkMatrix* m
}
}
void SkPaintFilterCanvas::onDrawTextRSXform(const void* text, size_t byteLength,
const SkRSXform xform[], const SkRect* cull,
const SkPaint& paint) {
AutoPaintFilter apf(this, kText_Type, paint);
if (apf.shouldDraw()) {
this->SkNWayCanvas::onDrawTextRSXform(text, byteLength, xform, cull, *apf.paint());
}
}
void SkPaintFilterCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) {
AutoPaintFilter apf(this, kTextBlob_Type, paint);

View File

@ -411,11 +411,6 @@ void SkDebugCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
this->addDrawCommand(new SkDrawDRRectCommand(outer, inner, paint));
}
void SkDebugCanvas::onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
const SkRect* cull, const SkPaint& paint) {
this->addDrawCommand(new SkDrawTextRSXformCommand(text, byteLength, xform, cull, paint));
}
void SkDebugCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) {
this->addDrawCommand(new SkDrawTextBlobCommand(sk_ref_sp(const_cast<SkTextBlob*>(blob)),

View File

@ -123,8 +123,6 @@ protected:
void onDrawAnnotation(const SkRect&, const char[], SkData*) override;
void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
void onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform[], const SkRect*,
const SkPaint&) override;
void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
const SkPaint& paint) override;

View File

@ -234,7 +234,6 @@ const char* SkDrawCommand::GetCommandString(OpType type) {
case kDrawRegion_OpType: return "DrawRegion";
case kDrawShadow_OpType: return "DrawShadow";
case kDrawTextBlob_OpType: return "DrawTextBlob";
case kDrawTextRSXform_OpType: return "DrawTextRSXform";
case kDrawVertices_OpType: return "DrawVertices";
case kDrawAtlas_OpType: return "DrawAtlas";
case kDrawDrawable_OpType: return "DrawDrawable";
@ -1807,10 +1806,6 @@ Json::Value SkDrawPointsCommand::toJSON(UrlDataManager& urlDataManager) const {
return result;
}
static Json::Value make_json_text(sk_sp<SkData> text) {
return Json::Value((const char*)text->data(), (const char*)text->data() + text->size());
}
SkDrawTextBlobCommand::SkDrawTextBlobCommand(sk_sp<SkTextBlob> blob, SkScalar x, SkScalar y,
const SkPaint& paint)
: INHERITED(kDrawTextBlob_OpType)
@ -2057,29 +2052,6 @@ void SkDrawDrawableCommand::execute(SkCanvas* canvas) const {
///////////////////////////////////////////////////////////////////////////////////////////////////
SkDrawTextRSXformCommand::SkDrawTextRSXformCommand(const void* text, size_t byteLength,
const SkRSXform xform[], const SkRect* cull,
const SkPaint& paint)
: INHERITED(kDrawTextRSXform_OpType)
, fText(SkData::MakeWithCopy(text, byteLength))
, fXform(xform, SkFont::LEGACY_ExtractFromPaint(paint).countText(text, byteLength, paint.getTextEncoding()))
, fCull(cull)
, fPaint(paint) {}
void SkDrawTextRSXformCommand::execute(SkCanvas* canvas) const {
canvas->drawTextRSXform(fText->data(), fText->size(), fXform.begin(), fCull.getMaybeNull(),
fPaint);
}
Json::Value SkDrawTextRSXformCommand::toJSON(UrlDataManager& urlDataManager) const {
Json::Value result = INHERITED::toJSON(urlDataManager);
result[SKDEBUGCANVAS_ATTRIBUTE_TEXT] = make_json_text(fText);
result[SKDEBUGCANVAS_ATTRIBUTE_PAINT] = MakeJsonPaint(fPaint, urlDataManager);
return result;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
SkDrawVerticesCommand::SkDrawVerticesCommand(sk_sp<SkVertices> vertices, SkBlendMode bmode,
const SkPaint& paint)
: INHERITED(kDrawVertices_OpType)

View File

@ -55,7 +55,6 @@ public:
kDrawRegion_OpType,
kDrawShadow_OpType,
kDrawTextBlob_OpType,
kDrawTextRSXform_OpType,
kDrawVertices_OpType,
kDrawAtlas_OpType,
kDrawDrawable_OpType,
@ -493,22 +492,6 @@ private:
typedef SkDrawCommand INHERITED;
};
class SkDrawTextRSXformCommand : public SkDrawCommand {
public:
SkDrawTextRSXformCommand(const void* text, size_t byteLength, const SkRSXform[],
const SkRect*, const SkPaint& paint);
void execute(SkCanvas* canvas) const override;
Json::Value toJSON(UrlDataManager& urlDataManager) const override;
private:
sk_sp<SkData> fText;
SkTDArray<SkRSXform> fXform;
SkTLazy<SkRect> fCull;
SkPaint fPaint;
typedef SkDrawCommand INHERITED;
};
class SkDrawTextBlobCommand : public SkDrawCommand {
public:
SkDrawTextBlobCommand(sk_sp<SkTextBlob> blob, SkScalar x, SkScalar y, const SkPaint& paint);