| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 // y += SK_Scalar1/2; | 90 // y += SK_Scalar1/2; |
| 91 | 91 |
| 92 canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), pai
nt); | 92 canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), pai
nt); |
| 93 | 93 |
| 94 paint.setAntiAlias(true); // with anti-aliasing | 94 paint.setAntiAlias(true); // with anti-aliasing |
| 95 y += SkIntToScalar(10); | 95 y += SkIntToScalar(10); |
| 96 canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), pai
nt); | 96 canvas->drawLine(x, y, x + SkIntToScalar(90), y + SkIntToScalar(90), pai
nt); |
| 97 } | 97 } |
| 98 | 98 |
| 99 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERR
IDE { | 99 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) override
{ |
| 100 fAlpha = SkScalarRoundToInt(y); | 100 fAlpha = SkScalarRoundToInt(y); |
| 101 this->inval(NULL); | 101 this->inval(NULL); |
| 102 return NULL; | 102 return NULL; |
| 103 } | 103 } |
| 104 private: | 104 private: |
| 105 | 105 |
| 106 int fAlpha; | 106 int fAlpha; |
| 107 typedef SampleView INHERITED; | 107 typedef SampleView INHERITED; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 ////////////////////////////////////////////////////////////////////////////// | 110 ////////////////////////////////////////////////////////////////////////////// |
| 111 | 111 |
| 112 static SkView* MyFactory() { return new LinesView; } | 112 static SkView* MyFactory() { return new LinesView; } |
| 113 static SkViewRegister reg(MyFactory); | 113 static SkViewRegister reg(MyFactory); |
| OLD | NEW |