OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkRSXform.h" | 10 #include "SkRSXform.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 gModes[i].fMode, nullptr, nullptr); | 155 gModes[i].fMode, nullptr, nullptr); |
156 canvas->translate(0.0f, numColors*(target.height()+kPad)); | 156 canvas->translate(0.0f, numColors*(target.height()+kPad)); |
157 // w a paint | 157 // w a paint |
158 canvas->drawAtlas(fAtlas.get(), xforms, rects, quadColors, numColors
, | 158 canvas->drawAtlas(fAtlas.get(), xforms, rects, quadColors, numColors
, |
159 gModes[i].fMode, nullptr, &paint); | 159 gModes[i].fMode, nullptr, &paint); |
160 canvas->restore(); | 160 canvas->restore(); |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 private: | 164 private: |
165 static const int kNumXferModes = 29; | 165 static constexpr int kNumXferModes = 29; |
166 static const int kNumColors = 4; | 166 static constexpr int kNumColors = 4; |
167 static const int kAtlasSize = 30; | 167 static constexpr int kAtlasSize = 30; |
168 static const int kPad = 2; | 168 static constexpr int kPad = 2; |
169 static const int kTextPad = 8; | 169 static constexpr int kTextPad = 8; |
170 | 170 |
171 | 171 |
172 sk_sp<SkImage> fAtlas; | 172 sk_sp<SkImage> fAtlas; |
173 | 173 |
174 typedef GM INHERITED; | 174 typedef GM INHERITED; |
175 }; | 175 }; |
176 DEF_GM( return new DrawAtlasColorsGM; ) | 176 DEF_GM( return new DrawAtlasColorsGM; ) |
OLD | NEW |