From e2b580bbed5589f585a9672bfb1a539fdadeab5f Mon Sep 17 00:00:00 2001 From: reed Date: Mon, 23 Feb 2015 07:37:40 -0800 Subject: remove dead code (covered by surfaceprops) BUG=skia: Review URL: https://codereview.chromium.org/947593004 --- gm/lcdtext.cpp | 76 ---------------------------------------------------------- 1 file changed, 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 pic(recorder.endRecording()); - SkAutoTUnref 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 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 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; ) -- cgit v1.2.3