OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Resources.h" | 8 #include "Resources.h" |
9 #include "SkData.h" | 9 #include "SkData.h" |
10 #include "SkDecodingImageGenerator.h" | 10 #include "SkDecodingImageGenerator.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 background and compression artifacts. | 48 background and compression artifacts. |
49 */ | 49 */ |
50 DEF_SIMPLE_GM(colorwheel, canvas, 256, 256) { | 50 DEF_SIMPLE_GM(colorwheel, canvas, 256, 256) { |
51 canvas->clear(SK_ColorWHITE); | 51 canvas->clear(SK_ColorWHITE); |
52 checkerboard(canvas, 256, 556, 8, 0xFF999999, 0xFF666666); | 52 checkerboard(canvas, 256, 556, 8, 0xFF999999, 0xFF666666); |
53 draw_bitmap(canvas, "color_wheel.png", 0, 0); // top left | 53 draw_bitmap(canvas, "color_wheel.png", 0, 0); // top left |
54 draw_bitmap(canvas, "color_wheel.gif", 128, 0); // top right | 54 draw_bitmap(canvas, "color_wheel.gif", 128, 0); // top right |
55 draw_bitmap(canvas, "color_wheel.webp", 0, 128); // bottom left | 55 draw_bitmap(canvas, "color_wheel.webp", 0, 128); // bottom left |
56 draw_bitmap(canvas, "color_wheel.jpg", 128, 128); // bottom right | 56 draw_bitmap(canvas, "color_wheel.jpg", 128, 128); // bottom right |
57 } | 57 } |
58 | |
59 DEF_SIMPLE_GM(colorwheelnative, canvas, 128, 28) { | |
scroggo
2014/12/02 17:45:57
Might there be a more descriptive name?
| |
60 SkPaint paint; | |
61 paint.setTypeface(SkTypeface::CreateFromName("Arial", SkTypeface::kBold)); | |
scroggo
2014/12/02 17:45:57
Is there a particular reason you chose this font?
| |
62 paint.setTextSize(18.0f); | |
63 | |
64 canvas->clear(SK_ColorLTGRAY); | |
65 paint.setColor(SK_ColorRED); | |
66 canvas->drawText("R", 1, 8.0f, 20.0f, paint); | |
67 paint.setColor(SK_ColorGREEN); | |
68 canvas->drawText("G", 1, 24.0f, 20.0f, paint); | |
69 paint.setColor(SK_ColorBLUE); | |
70 canvas->drawText("B", 1, 40.0f, 20.0f, paint); | |
71 paint.setColor(SK_ColorCYAN); | |
72 canvas->drawText("C", 1, 56.0f, 20.0f, paint); | |
73 paint.setColor(SK_ColorMAGENTA); | |
74 canvas->drawText("M", 1, 72.0f, 20.0f, paint); | |
75 paint.setColor(SK_ColorYELLOW); | |
76 canvas->drawText("Y", 1, 88.0f, 20.0f, paint); | |
77 paint.setColor(SK_ColorBLACK); | |
78 canvas->drawText("K", 1, 104.0f, 20.0f, paint); | |
79 } | |
OLD | NEW |