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

Unified Diff: gm/colorwheel.cpp

Issue 774713003: colorwheelnative gm, to test that colors look right under all conditions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/colorwheel.cpp
diff --git a/gm/colorwheel.cpp b/gm/colorwheel.cpp
index 93c59388d927d3295dd3e888e4115740fd658615..efc40131571831b23504428ee0f23e09373bee14 100644
--- a/gm/colorwheel.cpp
+++ b/gm/colorwheel.cpp
@@ -55,3 +55,25 @@ DEF_SIMPLE_GM(colorwheel, canvas, 256, 256) {
draw_bitmap(canvas, "color_wheel.webp", 0, 128); // bottom left
draw_bitmap(canvas, "color_wheel.jpg", 128, 128); // bottom right
}
+
+DEF_SIMPLE_GM(colorwheelnative, canvas, 128, 28) {
scroggo 2014/12/02 17:45:57 Might there be a more descriptive name?
+ SkPaint paint;
+ paint.setTypeface(SkTypeface::CreateFromName("Arial", SkTypeface::kBold));
scroggo 2014/12/02 17:45:57 Is there a particular reason you chose this font?
+ paint.setTextSize(18.0f);
+
+ canvas->clear(SK_ColorLTGRAY);
+ paint.setColor(SK_ColorRED);
+ canvas->drawText("R", 1, 8.0f, 20.0f, paint);
+ paint.setColor(SK_ColorGREEN);
+ canvas->drawText("G", 1, 24.0f, 20.0f, paint);
+ paint.setColor(SK_ColorBLUE);
+ canvas->drawText("B", 1, 40.0f, 20.0f, paint);
+ paint.setColor(SK_ColorCYAN);
+ canvas->drawText("C", 1, 56.0f, 20.0f, paint);
+ paint.setColor(SK_ColorMAGENTA);
+ canvas->drawText("M", 1, 72.0f, 20.0f, paint);
+ paint.setColor(SK_ColorYELLOW);
+ canvas->drawText("Y", 1, 88.0f, 20.0f, paint);
+ paint.setColor(SK_ColorBLACK);
+ canvas->drawText("K", 1, 104.0f, 20.0f, paint);
+}
« 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