| 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 "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkView.h" | 9 #include "SkView.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 apply_grid(pts, 2); | 278 apply_grid(pts, 2); |
| 279 } | 279 } |
| 280 | 280 |
| 281 erase(fMinSurface); | 281 erase(fMinSurface); |
| 282 this->setupPaint(&paint); | 282 this->setupPaint(&paint); |
| 283 paint.setColor(FAT_PIXEL_COLOR); | 283 paint.setColor(FAT_PIXEL_COLOR); |
| 284 if (fUseClip) { | 284 if (fUseClip) { |
| 285 fMinSurface->getCanvas()->save(); | 285 fMinSurface->getCanvas()->save(); |
| 286 SkRect r = fClipRect; | 286 SkRect r = fClipRect; |
| 287 r.inset(SK_Scalar1/3, SK_Scalar1/3); | 287 r.inset(SK_Scalar1/3, SK_Scalar1/3); |
| 288 fMinSurface->getCanvas()->clipRect(r, SkRegion::kIntersect_Op, true); | 288 fMinSurface->getCanvas()->clipRect(r, kIntersect_SkClipOp, true); |
| 289 } | 289 } |
| 290 fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].f
Y, paint); | 290 fMinSurface->getCanvas()->drawLine(pts[0].fX, pts[0].fY, pts[1].fX, pts[1].f
Y, paint); |
| 291 if (fUseClip) { | 291 if (fUseClip) { |
| 292 fMinSurface->getCanvas()->restore(); | 292 fMinSurface->getCanvas()->restore(); |
| 293 } | 293 } |
| 294 this->copyMinToMax(); | 294 this->copyMinToMax(); |
| 295 | 295 |
| 296 SkCanvas* max = fMaxSurface->getCanvas(); | 296 SkCanvas* max = fMaxSurface->getCanvas(); |
| 297 | 297 |
| 298 fMatrix.mapPoints(pts, 2); | 298 fMatrix.mapPoints(pts, 2); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 516 |
| 517 private: | 517 private: |
| 518 | 518 |
| 519 typedef SampleView INHERITED; | 519 typedef SampleView INHERITED; |
| 520 }; | 520 }; |
| 521 | 521 |
| 522 ////////////////////////////////////////////////////////////////////////////// | 522 ////////////////////////////////////////////////////////////////////////////// |
| 523 | 523 |
| 524 static SkView* MyFactory() { return new DrawLineView; } | 524 static SkView* MyFactory() { return new DrawLineView; } |
| 525 static SkViewRegister reg(MyFactory); | 525 static SkViewRegister reg(MyFactory); |
| OLD | NEW |