Index: gm/textblobgeometrychange.cpp |
diff --git a/gm/textblobgeometrychange.cpp b/gm/textblobgeometrychange.cpp |
index b1c5b179880663716864060e1d812a58c719fa0f..b02bc07bf090bf50f9b1ce03656c607d74572a88 100644 |
--- a/gm/textblobgeometrychange.cpp |
+++ b/gm/textblobgeometrychange.cpp |
@@ -47,28 +47,24 @@ protected: |
uint32_t allowSRGBInputs = canvas->getProps(&canvasProps) |
? canvasProps.flags() & SkSurfaceProps::kAllowSRGBInputs_Flag : 0; |
SkSurfaceProps props(allowSRGBInputs, kUnknown_SkPixelGeometry); |
- auto surface(canvas->makeSurface(info, &props)); |
- if (surface) { |
- SkCanvas* c = surface->getCanvas(); |
- |
- // LCD text on white background |
- SkRect rect = SkRect::MakeLTRB(0.f, 0.f, SkIntToScalar(kWidth), kHeight / 2.f); |
- SkPaint rectPaint; |
- rectPaint.setColor(0xffffffff); |
- canvas->drawRect(rect, rectPaint); |
- canvas->drawTextBlob(blob.get(), 10, 50, paint); |
- |
- // This should not look garbled since we should disable LCD text in this case |
- // (i.e., unknown pixel geometry) |
- c->clear(0x00ffffff); |
- c->drawTextBlob(blob.get(), 10, 150, paint); |
- surface->draw(canvas, 0, 0, nullptr); |
- } else { |
- const char* text = "This test requires a surface"; |
- size_t len = strlen(text); |
- SkPaint paint; |
- canvas->drawText(text, len, 10, 100, paint); |
+ auto surface = canvas->makeSurface(info, &props); |
+ if (!surface) { |
+ surface = SkSurface::MakeRaster(info, &props); |
} |
+ SkCanvas* c = surface->getCanvas(); |
+ |
+ // LCD text on white background |
+ SkRect rect = SkRect::MakeLTRB(0.f, 0.f, SkIntToScalar(kWidth), kHeight / 2.f); |
+ SkPaint rectPaint; |
+ rectPaint.setColor(0xffffffff); |
+ canvas->drawRect(rect, rectPaint); |
+ canvas->drawTextBlob(blob.get(), 10, 50, paint); |
+ |
+ // This should not look garbled since we should disable LCD text in this case |
+ // (i.e., unknown pixel geometry) |
+ c->clear(0x00ffffff); |
+ c->drawTextBlob(blob.get(), 10, 150, paint); |
+ surface->draw(canvas, 0, 0, nullptr); |
} |
private: |