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

Unified Diff: gm/imagefiltersbase.cpp

Issue 1002603003: disable LCD for layers w/ filters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | src/core/SkCanvas.cpp » ('j') | src/core/SkCanvas.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersbase.cpp
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp
index ea32769d4d697b799f1fb63b1716ec2238245683..50edbbcafee163323b661416f8f37e373beafebb 100644
--- a/gm/imagefiltersbase.cpp
+++ b/gm/imagefiltersbase.cpp
@@ -254,8 +254,46 @@ protected:
private:
typedef GM INHERITED;
};
+DEF_GM( return new ImageFiltersBaseGM; )
///////////////////////////////////////////////////////////////////////////////
robertphillips 2015/03/19 19:11:48 // This GM tests that LCD text is disabled when im
-static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; }
-static skiagm::GMRegistry reg(MyFactory);
+class ImageFiltersTextGM : public skiagm::GM {
+public:
+ ImageFiltersTextGM () {}
+
+protected:
robertphillips 2015/03/19 19:11:49 override throughout ? one line ?
+ virtual SkString onShortName() {
+ return SkString("imagefilterstext");
+ }
+
robertphillips 2015/03/19 19:11:48 Does this GM need to be this large?
+ virtual SkISize onISize() { return SkISize::Make(700, 500); }
+
+ virtual void onDraw(SkCanvas* canvas) {
+ const uint32_t flags[] = {
+ 0,
+ SkPaint::kAntiAlias_Flag,
+ SkPaint::kAntiAlias_Flag | SkPaint::kLCDRenderText_Flag,
+ };
+
+ SkAutoTUnref<SkImageFilter> imgf(SkBlurImageFilter::Create(0.5f, 0.5f));
+ SkPaint paint;
+ paint.setTextSize(30);
+
+ canvas->translate(20, 40);
robertphillips 2015/03/19 19:11:48 Wouldn't it be a more explicit test to actually pe
+ for (size_t i = 0; i < SK_ARRAY_COUNT(flags); ++i) {
+ paint.setFlags(flags[i]);
+
+ paint.setImageFilter(NULL);
+ canvas->drawText("Hamburgefons", 11, 0, 0, paint);
+ paint.setImageFilter(imgf);
+ canvas->drawText("Hamburgefons", 11, 250, 0, paint);
+ canvas->translate(0, 40);
+ }
+ }
+
+private:
+ typedef GM INHERITED;
+};
+DEF_GM( return new ImageFiltersTextGM; )
+
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698