Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1150)

Unified Diff: gm/lcdtext.cpp

Issue 947593004: remove dead code (covered by surfaceprops) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/lcdtext.cpp
diff --git a/gm/lcdtext.cpp b/gm/lcdtext.cpp
index 1bcc346690514df7f30701df456a1a131193c18d..5ea9396f06dc20d345658129cccdbfa355793e6e 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; )
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698