| 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 txtPaint.setTextSize(23.f); | 151 txtPaint.setTextSize(23.f); |
| 152 txtPaint.setAntiAlias(true); | 152 txtPaint.setAntiAlias(true); |
| 153 sk_tool_utils::set_portable_typeface(&txtPaint); | 153 sk_tool_utils::set_portable_typeface(&txtPaint); |
| 154 txtPaint.setColor(SK_ColorDKGRAY); | 154 txtPaint.setColor(SK_ColorDKGRAY); |
| 155 SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1); | 155 SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1); |
| 156 | 156 |
| 157 SkScalar startX = 0; | 157 SkScalar startX = 0; |
| 158 int testLayers = kBench_Mode != this->getMode(); | 158 int testLayers = kBench_Mode != this->getMode(); |
| 159 for (int doLayer = 0; doLayer <= testLayers; ++doLayer) { | 159 for (int doLayer = 0; doLayer <= testLayers; ++doLayer) { |
| 160 for (SkTLList<Clip>::Iter iter(fClips, SkTLList<Clip>::Iter::kHead_I
terStart); | 160 for (SkTLList<Clip>::Iter iter(fClips, SkTLList<Clip>::Iter::kHead_I
terStart); |
| 161 NULL != iter.get(); | 161 iter.get(); |
| 162 iter.next()) { | 162 iter.next()) { |
| 163 const Clip* clip = iter.get(); | 163 const Clip* clip = iter.get(); |
| 164 SkScalar x = startX; | 164 SkScalar x = startX; |
| 165 for (int aa = 0; aa < 2; ++aa) { | 165 for (int aa = 0; aa < 2; ++aa) { |
| 166 if (doLayer) { | 166 if (doLayer) { |
| 167 SkRect bounds; | 167 SkRect bounds; |
| 168 clip->getBounds(&bounds); | 168 clip->getBounds(&bounds); |
| 169 bounds.outset(2, 2); | 169 bounds.outset(2, 2); |
| 170 bounds.offset(x, y); | 170 bounds.offset(x, y); |
| 171 canvas->saveLayer(&bounds, NULL); | 171 canvas->saveLayer(&bounds, NULL); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 SkTLList<Clip> fClips; | 295 SkTLList<Clip> fClips; |
| 296 SkBitmap fBmp; | 296 SkBitmap fBmp; |
| 297 | 297 |
| 298 typedef GM INHERITED; | 298 typedef GM INHERITED; |
| 299 }; | 299 }; |
| 300 | 300 |
| 301 DEF_GM( return SkNEW(ConvexPolyClip); ) | 301 DEF_GM( return SkNEW(ConvexPolyClip); ) |
| 302 | 302 |
| 303 } | 303 } |
| OLD | NEW |