| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 bgPaint.setAlpha(0x15); | 143 bgPaint.setAlpha(0x15); |
| 144 SkISize size = canvas->getDeviceSize(); | 144 SkISize size = canvas->getDeviceSize(); |
| 145 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(size.fWidth), | 145 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(size.fWidth), |
| 146 SkIntToScalar(size.fHeight)); | 146 SkIntToScalar(size.fHeight)); |
| 147 canvas->drawBitmapRectToRect(fBmp, NULL, dstRect, &bgPaint); | 147 canvas->drawBitmapRectToRect(fBmp, NULL, dstRect, &bgPaint); |
| 148 | 148 |
| 149 static const char kTxt[] = "Clip Me!"; | 149 static const char kTxt[] = "Clip Me!"; |
| 150 SkPaint txtPaint; | 150 SkPaint txtPaint; |
| 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 txtPaint.setColor(SK_ColorDKGRAY); | 154 txtPaint.setColor(SK_ColorDKGRAY); |
| 154 SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1); | 155 SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1); |
| 155 | 156 |
| 156 SkScalar startX = 0; | 157 SkScalar startX = 0; |
| 157 int testLayers = kBench_Mode != this->getMode(); | 158 int testLayers = kBench_Mode != this->getMode(); |
| 158 for (int doLayer = 0; doLayer <= testLayers; ++doLayer) { | 159 for (int doLayer = 0; doLayer <= testLayers; ++doLayer) { |
| 159 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); |
| 160 NULL != iter.get(); | 161 NULL != iter.get(); |
| 161 iter.next()) { | 162 iter.next()) { |
| 162 const Clip* clip = iter.get(); | 163 const Clip* clip = iter.get(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 294 |
| 294 SkTLList<Clip> fClips; | 295 SkTLList<Clip> 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 SkNEW(ConvexPolyClip); ) | 301 DEF_GM( return SkNEW(ConvexPolyClip); ) |
| 301 | 302 |
| 302 } | 303 } |
| OLD | NEW |