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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 void copyMinToMax() { | 157 void copyMinToMax() { |
158 erase(fMaxSurface.get()); | 158 erase(fMaxSurface.get()); |
159 SkCanvas* canvas = fMaxSurface->getCanvas(); | 159 SkCanvas* canvas = fMaxSurface->getCanvas(); |
160 canvas->save(); | 160 canvas->save(); |
161 canvas->concat(fMatrix); | 161 canvas->concat(fMatrix); |
162 fMinSurface->draw(canvas, 0, 0, nullptr); | 162 fMinSurface->draw(canvas, 0, 0, nullptr); |
163 canvas->restore(); | 163 canvas->restore(); |
164 | 164 |
165 SkPaint paint; | 165 SkPaint paint; |
166 paint.setXfermodeMode(SkXfermode::kClear_Mode); | 166 paint.setBlendMode(SkBlendMode::kClear); |
167 for (int iy = 1; iy < fH; ++iy) { | 167 for (int iy = 1; iy < fH; ++iy) { |
168 SkScalar y = SkIntToScalar(iy * fZoom); | 168 SkScalar y = SkIntToScalar(iy * fZoom); |
169 canvas->drawLine(0, y - SK_ScalarHalf, 999, y - SK_ScalarHalf, paint
); | 169 canvas->drawLine(0, y - SK_ScalarHalf, 999, y - SK_ScalarHalf, paint
); |
170 } | 170 } |
171 for (int ix = 1; ix < fW; ++ix) { | 171 for (int ix = 1; ix < fW; ++ix) { |
172 SkScalar x = SkIntToScalar(ix * fZoom); | 172 SkScalar x = SkIntToScalar(ix * fZoom); |
173 canvas->drawLine(x - SK_ScalarHalf, 0, x - SK_ScalarHalf, 999, paint
); | 173 canvas->drawLine(x - SK_ScalarHalf, 0, x - SK_ScalarHalf, 999, paint
); |
174 } | 174 } |
175 } | 175 } |
176 }; | 176 }; |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 497 |
498 private: | 498 private: |
499 | 499 |
500 typedef SampleView INHERITED; | 500 typedef SampleView INHERITED; |
501 }; | 501 }; |
502 | 502 |
503 ////////////////////////////////////////////////////////////////////////////// | 503 ////////////////////////////////////////////////////////////////////////////// |
504 | 504 |
505 static SkView* MyFactory() { return new DrawLineView; } | 505 static SkView* MyFactory() { return new DrawLineView; } |
506 static SkViewRegister reg(MyFactory); | 506 static SkViewRegister reg(MyFactory); |
OLD | NEW |