Index: gm/lcdtext.cpp |
diff --git a/gm/lcdtext.cpp b/gm/lcdtext.cpp |
index 6daec824f32639de4f55d85a03a2f2a2fafa6c54..e40fb0df18234d06baf2f63731b197bdb6e0f436 100644 |
--- a/gm/lcdtext.cpp |
+++ b/gm/lcdtext.cpp |
@@ -126,6 +126,33 @@ protected: |
private: |
typedef skiagm::GM INHERITED; |
}; |
- |
DEF_GM( return new LcdTextGM; ) |
DEF_GM( return new LcdTextSizeGM; ) |
+ |
+/////////////////////////////////////////////////////////////////////////////////////////////////// |
+ |
+DEF_SIMPLE_GM(savelayer_lcdtext, canvas, 620, 260) { |
+ SkPaint paint; |
+ paint.setAntiAlias(true); |
+ paint.setLCDRenderText(true); |
+ paint.setTextSize(20); |
+ |
+ canvas->drawText("Hamburgefons", 12, 30, 30, paint); |
+ |
+ const bool gPreserveLCDText[] = { false, true }; |
+ |
+ canvas->translate(0, 20); |
+ for (auto preserve : gPreserveLCDText) { |
+ preserve ? canvas->saveLayerPreserveLCDTextRequests(nullptr, nullptr) |
+ : canvas->saveLayer(nullptr, nullptr); |
+ canvas->drawText("Hamburgefons", 12, 30, 60, paint); |
+ |
+ SkPaint p; |
+ p.setColor(0xFFCCCCCC); |
+ canvas->drawRect(SkRect::MakeLTRB(25, 70, 200, 100), p); |
+ canvas->drawText("Hamburgefons", 12, 30, 90, paint); |
+ |
+ canvas->restore(); |
+ canvas->translate(0, 80); |
+ } |
+} |