OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 canvas->translate(0, rect.height() + 40 * SK_Scalar1); | 85 canvas->translate(0, rect.height() + 40 * SK_Scalar1); |
86 canvas->save(); | 86 canvas->save(); |
87 } else { | 87 } else { |
88 canvas->translate(rect.width() + 40 * SK_Scalar1, 0); | 88 canvas->translate(rect.width() + 40 * SK_Scalar1, 0); |
89 } | 89 } |
90 ++i; | 90 ++i; |
91 | 91 |
92 | 92 |
93 SkColor color = rand.nextU(); | 93 SkColor color = rand.nextU(); |
94 color = 0xff000000 | color; // force solid | 94 color = 0xff000000 | color; // force solid |
95 color = sk_tool_utils::color_to_565(color); | 95 sk_tool_utils::color_to_565(&color); |
96 this->drawEmpty(canvas, color, rect, | 96 this->drawEmpty(canvas, color, rect, |
97 gStyles[style].fStyle, gFills[fill].fFill); | 97 gStyles[style].fStyle, gFills[fill].fFill); |
98 | 98 |
99 SkPaint rectPaint; | 99 SkPaint rectPaint; |
100 rectPaint.setColor(SK_ColorBLACK); | 100 rectPaint.setColor(SK_ColorBLACK); |
101 rectPaint.setStyle(SkPaint::kStroke_Style); | 101 rectPaint.setStyle(SkPaint::kStroke_Style); |
102 rectPaint.setStrokeWidth(-1); | 102 rectPaint.setStrokeWidth(-1); |
103 rectPaint.setAntiAlias(true); | 103 rectPaint.setAntiAlias(true); |
104 canvas->drawRect(rect, rectPaint); | 104 canvas->drawRect(rect, rectPaint); |
105 | 105 |
(...skipping 19 matching lines...) Expand all Loading... |
125 private: | 125 private: |
126 typedef GM INHERITED; | 126 typedef GM INHERITED; |
127 }; | 127 }; |
128 | 128 |
129 ////////////////////////////////////////////////////////////////////////////// | 129 ////////////////////////////////////////////////////////////////////////////// |
130 | 130 |
131 static GM* MyFactory(void*) { return new EmptyPathGM; } | 131 static GM* MyFactory(void*) { return new EmptyPathGM; } |
132 static GMRegistry reg(MyFactory); | 132 static GMRegistry reg(MyFactory); |
133 | 133 |
134 } | 134 } |
OLD | NEW |