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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 apply_grid(pts, 2); | 251 apply_grid(pts, 2); |
252 } | 252 } |
253 | 253 |
254 erase(fMinSurface.get()); | 254 erase(fMinSurface.get()); |
255 this->setupPaint(&paint); | 255 this->setupPaint(&paint); |
256 paint.setColor(FAT_PIXEL_COLOR); | 256 paint.setColor(FAT_PIXEL_COLOR); |
257 if (fUseClip) { | 257 if (fUseClip) { |
258 fMinSurface->getCanvas()->save(); | 258 fMinSurface->getCanvas()->save(); |
259 SkRect r = fClipRect; | 259 SkRect r = fClipRect; |
260 r.inset(SK_Scalar1/3, SK_Scalar1/3); | 260 r.inset(SK_Scalar1/3, SK_Scalar1/3); |
261 fMinSurface->getCanvas()->clipRect(r, SkRegion::kIntersect_Op, true); | 261 fMinSurface->getCanvas()->clipRect(r, SkCanvas::kIntersect_Op, true); |
262 } | 262 } |
263 fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].f
Y, paint); | 263 fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].f
Y, paint); |
264 if (fUseClip) { | 264 if (fUseClip) { |
265 fMinSurface->getCanvas()->restore(); | 265 fMinSurface->getCanvas()->restore(); |
266 } | 266 } |
267 this->copyMinToMax(); | 267 this->copyMinToMax(); |
268 | 268 |
269 SkCanvas* max = fMaxSurface->getCanvas(); | 269 SkCanvas* max = fMaxSurface->getCanvas(); |
270 | 270 |
271 fMatrix.mapPoints(pts, 2); | 271 fMatrix.mapPoints(pts, 2); |
(...skipping 225 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 |