| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 } | 278 } |
| 279 | 279 |
| 280 virtual bool onClick(Click* click) { | 280 virtual bool onClick(Click* click) { |
| 281 return this->INHERITED::onClick(click); | 281 return this->INHERITED::onClick(click); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void makePath(SkPath& path) { | 284 void makePath(SkPath& path) { |
| 285 path.addCircle(SkIntToScalar(20), SkIntToScalar(20), SkIntToScalar(20), | 285 path.addCircle(SkIntToScalar(20), SkIntToScalar(20), SkIntToScalar(20), |
| 286 SkPath::kCCW_Direction); | 286 SkPath::kCCW_Direction); |
| 287 for (int index = 0; index < 10; index++) { | 287 for (int index = 0; index < 10; index++) { |
| 288 SkScalar x = SkFloatToScalar((float) cos(index / 10.0f * 2 * 3.14159
25358f)); | 288 SkScalar x = (float) cos(index / 10.0f * 2 * 3.1415925358f); |
| 289 SkScalar y = SkFloatToScalar((float) sin(index / 10.0f * 2 * 3.14159
25358f)); | 289 SkScalar y = (float) sin(index / 10.0f * 2 * 3.1415925358f); |
| 290 x *= index & 1 ? 7 : 14; | 290 x *= index & 1 ? 7 : 14; |
| 291 y *= index & 1 ? 7 : 14; | 291 y *= index & 1 ? 7 : 14; |
| 292 x += SkIntToScalar(20); | 292 x += SkIntToScalar(20); |
| 293 y += SkIntToScalar(20); | 293 y += SkIntToScalar(20); |
| 294 if (index == 0) | 294 if (index == 0) |
| 295 path.moveTo(x, y); | 295 path.moveTo(x, y); |
| 296 else | 296 else |
| 297 path.lineTo(x, y); | 297 path.lineTo(x, y); |
| 298 } | 298 } |
| 299 path.close(); | 299 path.close(); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 private: | 641 private: |
| 642 SkPoint fClickPt; | 642 SkPoint fClickPt; |
| 643 SkBitmap fBug, fTb, fTx; | 643 SkBitmap fBug, fTb, fTx; |
| 644 typedef SampleView INHERITED; | 644 typedef SampleView INHERITED; |
| 645 }; | 645 }; |
| 646 | 646 |
| 647 ////////////////////////////////////////////////////////////////////////////// | 647 ////////////////////////////////////////////////////////////////////////////// |
| 648 | 648 |
| 649 static SkView* MyFactory() { return new DemoView; } | 649 static SkView* MyFactory() { return new DemoView; } |
| 650 static SkViewRegister reg(MyFactory); | 650 static SkViewRegister reg(MyFactory); |
| OLD | NEW |