| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 apply_grid(pts, 2); | 275 apply_grid(pts, 2); |
| 276 } | 276 } |
| 277 | 277 |
| 278 erase(fMinSurface.get()); | 278 erase(fMinSurface.get()); |
| 279 this->setupPaint(&paint); | 279 this->setupPaint(&paint); |
| 280 paint.setColor(FAT_PIXEL_COLOR); | 280 paint.setColor(FAT_PIXEL_COLOR); |
| 281 if (fUseClip) { | 281 if (fUseClip) { |
| 282 fMinSurface->getCanvas()->save(); | 282 fMinSurface->getCanvas()->save(); |
| 283 SkRect r = fClipRect; | 283 SkRect r = fClipRect; |
| 284 r.inset(SK_Scalar1/3, SK_Scalar1/3); | 284 r.inset(SK_Scalar1/3, SK_Scalar1/3); |
| 285 fMinSurface->getCanvas()->clipRect(r, SkRegion::kIntersect_Op, true); | 285 fMinSurface->getCanvas()->clipRect(r, SkCanvas::kIntersect_Op, true); |
| 286 } | 286 } |
| 287 fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].f
Y, paint); | 287 fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].f
Y, paint); |
| 288 if (fUseClip) { | 288 if (fUseClip) { |
| 289 fMinSurface->getCanvas()->restore(); | 289 fMinSurface->getCanvas()->restore(); |
| 290 } | 290 } |
| 291 this->copyMinToMax(); | 291 this->copyMinToMax(); |
| 292 | 292 |
| 293 SkCanvas* max = fMaxSurface->getCanvas(); | 293 SkCanvas* max = fMaxSurface->getCanvas(); |
| 294 | 294 |
| 295 fMatrix.mapPoints(pts, 2); | 295 fMatrix.mapPoints(pts, 2); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 | 525 |
| 526 private: | 526 private: |
| 527 | 527 |
| 528 typedef SampleView INHERITED; | 528 typedef SampleView INHERITED; |
| 529 }; | 529 }; |
| 530 | 530 |
| 531 ////////////////////////////////////////////////////////////////////////////// | 531 ////////////////////////////////////////////////////////////////////////////// |
| 532 | 532 |
| 533 static SkView* MyFactory() { return new DrawLineView; } | 533 static SkView* MyFactory() { return new DrawLineView; } |
| 534 static SkViewRegister reg(MyFactory); | 534 static SkViewRegister reg(MyFactory); |
| OLD | NEW |