diff options
author | reed <reed@google.com> | 2015-02-23 07:37:40 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-23 07:37:40 -0800 |
commit | e2b580bbed5589f585a9672bfb1a539fdadeab5f (patch) | |
tree | 80cc9f5658988c6c8a03222414f7f7bb73a2476c /gm | |
parent | 6ae1b1136f242f1960c0e2f53de402347da11c90 (diff) |
remove dead code (covered by surfaceprops)
BUG=skia:
Review URL: https://codereview.chromium.org/947593004
Diffstat (limited to 'gm')
-rw-r--r-- | gm/lcdtext.cpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/gm/lcdtext.cpp b/gm/lcdtext.cpp index 1bcc346690..5ea9396f06 100644 --- a/gm/lcdtext.cpp +++ b/gm/lcdtext.cpp @@ -126,81 +126,5 @@ private: typedef skiagm::GM INHERITED; }; -// ensure that we respect the SkPixelGeometry in SurfaceProps -class LcdTextProps : public skiagm::GM { - static void DrawText(SkCanvas* canvas) { - canvas->drawColor(SK_ColorWHITE); - SkPaint paint; - paint.setAntiAlias(true); - paint.setLCDRenderText(true); - paint.setTextSize(30); - canvas->drawText("Base", 4, 4, 30, paint); - canvas->saveLayer(NULL, NULL); - canvas->drawText("Layer", 5, 4, 70, paint); - canvas->restore(); - } - - static SkSurface* MakeSurface(SkCanvas* canvas, const SkImageInfo& info, SkPixelGeometry geo) { - SkSurfaceProps props = SkSurfaceProps(0, geo); - SkSurface* surface = canvas->newSurface(info, &props); - - if (!surface) { - surface = SkSurface::NewRaster(info, &props); - } - - return surface; - } - -protected: - SkString onShortName() SK_OVERRIDE { - return SkString("lcdtextprops"); - } - - SkISize onISize() SK_OVERRIDE { return SkISize::Make(230, 230); } - - void onOnceBeforeDraw() SK_OVERRIDE { - fInfo = SkImageInfo::MakeN32Premul(100, 100); - SkPictureRecorder recorder; - DrawText(recorder.beginRecording(SkIntToScalar(fInfo.width()), - SkIntToScalar(fInfo.height()))); - SkAutoTUnref<SkPicture> pic(recorder.endRecording()); - SkAutoTUnref<SkImageFilter> filter(SkPictureImageFilter::Create(pic.get())); - fFilterPaint.setImageFilter(filter.get()); - } - - void onDraw(SkCanvas* canvas) SK_OVERRIDE { - const SkPixelGeometry geos[] = { - kRGB_H_SkPixelGeometry, - kUnknown_SkPixelGeometry, - }; - - for (size_t i = 0; i < SK_ARRAY_COUNT(geos); ++i) { - SkAutoTUnref<SkSurface> surf(MakeSurface(canvas, fInfo, geos[i])); - DrawText(surf->getCanvas()); - surf->draw(canvas, SkIntToScalar(i * (fInfo.width() + 10)), 0, NULL); - } - - for (size_t i = 0; i < SK_ARRAY_COUNT(geos); ++i) { - SkAutoTUnref<SkSurface> surf(MakeSurface(canvas, fInfo, geos[i])); - surf->getCanvas()->saveLayer(NULL, &fFilterPaint); - surf->getCanvas()->restore(); - surf->draw(canvas, - SkIntToScalar(i * (fInfo.width() + 10)), - SkIntToScalar(fInfo.height() + 10), - NULL); - } - } - -private: - SkPaint fFilterPaint; - SkImageInfo fInfo; - - typedef skiagm::GM INHERITED; -}; - -/////////////////////////////////////////////////////////////////////////////// - DEF_GM( return new LcdTextGM; ) DEF_GM( return new LcdTextSizeGM; ) -// Temporarily disabled (dftext interference) -// DEF_GM( return new LcdTextProps; ) |