OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 | 8 |
9 #include "gm.h" | 9 #include "gm.h" |
10 | 10 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 SkPaint txtPaint; | 151 SkPaint txtPaint; |
152 txtPaint.setTextSize(23.f); | 152 txtPaint.setTextSize(23.f); |
153 txtPaint.setAntiAlias(true); | 153 txtPaint.setAntiAlias(true); |
154 sk_tool_utils::set_portable_typeface(&txtPaint); | 154 sk_tool_utils::set_portable_typeface(&txtPaint); |
155 txtPaint.setColor(sk_tool_utils::color_to_565(SK_ColorDKGRAY)); | 155 txtPaint.setColor(sk_tool_utils::color_to_565(SK_ColorDKGRAY)); |
156 SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1); | 156 SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1); |
157 | 157 |
158 SkScalar startX = 0; | 158 SkScalar startX = 0; |
159 int testLayers = kBench_Mode != this->getMode(); | 159 int testLayers = kBench_Mode != this->getMode(); |
160 for (int doLayer = 0; doLayer <= testLayers; ++doLayer) { | 160 for (int doLayer = 0; doLayer <= testLayers; ++doLayer) { |
161 for (SkTLList<Clip>::Iter iter(fClips, SkTLList<Clip>::Iter::kHead_I
terStart); | 161 for (ClipList::Iter iter(fClips, ClipList::Iter::kHead_IterStart); |
162 iter.get(); | 162 iter.get(); |
163 iter.next()) { | 163 iter.next()) { |
164 const Clip* clip = iter.get(); | 164 const Clip* clip = iter.get(); |
165 SkScalar x = startX; | 165 SkScalar x = startX; |
166 for (int aa = 0; aa < 2; ++aa) { | 166 for (int aa = 0; aa < 2; ++aa) { |
167 if (doLayer) { | 167 if (doLayer) { |
168 SkRect bounds; | 168 SkRect bounds; |
169 clip->getBounds(&bounds); | 169 clip->getBounds(&bounds); |
170 bounds.outset(2, 2); | 170 bounds.outset(2, 2); |
171 bounds.offset(x, y); | 171 bounds.offset(x, y); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 break; | 284 break; |
285 } | 285 } |
286 } | 286 } |
287 | 287 |
288 private: | 288 private: |
289 ClipType fClipType; | 289 ClipType fClipType; |
290 SkPath fPath; | 290 SkPath fPath; |
291 SkRect fRect; | 291 SkRect fRect; |
292 }; | 292 }; |
293 | 293 |
294 SkTLList<Clip> fClips; | 294 typedef SkTLList<Clip, 1> ClipList; |
| 295 ClipList fClips; |
295 SkBitmap fBmp; | 296 SkBitmap fBmp; |
296 | 297 |
297 typedef GM INHERITED; | 298 typedef GM INHERITED; |
298 }; | 299 }; |
299 | 300 |
300 DEF_GM(return new ConvexPolyClip;) | 301 DEF_GM(return new ConvexPolyClip;) |
301 } | 302 } |
OLD | NEW |