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 "sk_tool_utils.h" | |
9 #include "Resources.h" | 8 #include "Resources.h" |
10 #include "SkData.h" | 9 #include "SkData.h" |
11 #include "gm.h" | 10 #include "gm.h" |
12 #include "sk_tool_utils.h" | 11 #include "sk_tool_utils.h" |
13 | 12 |
14 static void draw_bitmap(SkCanvas* canvas, const char* resource, int x, int y) { | 13 static void draw_bitmap(SkCanvas* canvas, const char* resource, int x, int y) { |
15 SkBitmap bitmap; | 14 SkBitmap bitmap; |
16 if (GetResourceAsBitmap(resource, &bitmap)) { | 15 if (GetResourceAsBitmap(resource, &bitmap)) { |
17 canvas->drawBitmap(bitmap, SkIntToScalar(x), SkIntToScalar(y)); | 16 canvas->drawBitmap(bitmap, SkIntToScalar(x), SkIntToScalar(y)); |
18 } else { | 17 } else { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 canvas->drawText("B", 1, 40.0f, 20.0f, paint); | 51 canvas->drawText("B", 1, 40.0f, 20.0f, paint); |
53 paint.setColor(SK_ColorCYAN); | 52 paint.setColor(SK_ColorCYAN); |
54 canvas->drawText("C", 1, 56.0f, 20.0f, paint); | 53 canvas->drawText("C", 1, 56.0f, 20.0f, paint); |
55 paint.setColor(SK_ColorMAGENTA); | 54 paint.setColor(SK_ColorMAGENTA); |
56 canvas->drawText("M", 1, 72.0f, 20.0f, paint); | 55 canvas->drawText("M", 1, 72.0f, 20.0f, paint); |
57 paint.setColor(SK_ColorYELLOW); | 56 paint.setColor(SK_ColorYELLOW); |
58 canvas->drawText("Y", 1, 88.0f, 20.0f, paint); | 57 canvas->drawText("Y", 1, 88.0f, 20.0f, paint); |
59 paint.setColor(SK_ColorBLACK); | 58 paint.setColor(SK_ColorBLACK); |
60 canvas->drawText("K", 1, 104.0f, 20.0f, paint); | 59 canvas->drawText("K", 1, 104.0f, 20.0f, paint); |
61 } | 60 } |
OLD | NEW |