| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "sk_tool_utils.h" | 8 #include "sk_tool_utils.h" |
| 9 #include "SampleCode.h" | 9 #include "SampleCode.h" |
| 10 #include "SkView.h" | 10 #include "SkView.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 241 |
| 242 void copyMinToMax() { | 242 void copyMinToMax() { |
| 243 erase(fMaxSurface); | 243 erase(fMaxSurface); |
| 244 SkCanvas* canvas = fMaxSurface->getCanvas(); | 244 SkCanvas* canvas = fMaxSurface->getCanvas(); |
| 245 canvas->save(); | 245 canvas->save(); |
| 246 canvas->concat(fMatrix); | 246 canvas->concat(fMatrix); |
| 247 fMinSurface->draw(canvas, 0, 0, nullptr); | 247 fMinSurface->draw(canvas, 0, 0, nullptr); |
| 248 canvas->restore(); | 248 canvas->restore(); |
| 249 | 249 |
| 250 SkPaint paint; | 250 SkPaint paint; |
| 251 paint.setXfermodeMode(SkXfermode::kClear_Mode); | 251 paint.setBlendMode(SkBlendMode::kClear); |
| 252 for (int iy = 1; iy < fH; ++iy) { | 252 for (int iy = 1; iy < fH; ++iy) { |
| 253 SkScalar y = SkIntToScalar(iy * fZoom); | 253 SkScalar y = SkIntToScalar(iy * fZoom); |
| 254 canvas->drawLine(0, y - SK_ScalarHalf, 999, y - SK_ScalarHalf, paint
); | 254 canvas->drawLine(0, y - SK_ScalarHalf, 999, y - SK_ScalarHalf, paint
); |
| 255 } | 255 } |
| 256 for (int ix = 1; ix < fW; ++ix) { | 256 for (int ix = 1; ix < fW; ++ix) { |
| 257 SkScalar x = SkIntToScalar(ix * fZoom); | 257 SkScalar x = SkIntToScalar(ix * fZoom); |
| 258 canvas->drawLine(x - SK_ScalarHalf, 0, x - SK_ScalarHalf, 999, paint
); | 258 canvas->drawLine(x - SK_ScalarHalf, 0, x - SK_ScalarHalf, 999, paint
); |
| 259 } | 259 } |
| 260 } | 260 } |
| 261 | 261 |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 } | 792 } |
| 793 | 793 |
| 794 private: | 794 private: |
| 795 typedef SkView INHERITED; | 795 typedef SkView INHERITED; |
| 796 }; | 796 }; |
| 797 | 797 |
| 798 /////////////////////////////////////////////////////////////////////////////// | 798 /////////////////////////////////////////////////////////////////////////////// |
| 799 | 799 |
| 800 static SkView* F2() { return new QuadStrokerView; } | 800 static SkView* F2() { return new QuadStrokerView; } |
| 801 static SkViewRegister gR2(F2); | 801 static SkViewRegister gR2(F2); |
| OLD | NEW |