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 "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 p.setStyle(SkPaint::kFill_Style); | 63 p.setStyle(SkPaint::kFill_Style); |
64 p.setColor(SK_ColorRED); | 64 p.setColor(SK_ColorRED); |
65 canvas->drawRect(r, p); | 65 canvas->drawRect(r, p); |
66 | 66 |
67 p.setColor(0x800000FF); | 67 p.setColor(0x800000FF); |
68 r.set(SkIntToScalar(150), SkIntToScalar(10), | 68 r.set(SkIntToScalar(150), SkIntToScalar(10), |
69 SkIntToScalar(250), SkIntToScalar(400)); | 69 SkIntToScalar(250), SkIntToScalar(400)); |
70 canvas->drawOval(oval, p); | 70 canvas->drawOval(oval, p); |
71 } | 71 } |
72 | 72 |
73 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned)
SK_OVERRIDE { | 73 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERR
IDE { |
74 return new Click(this); | 74 return new Click(this); |
75 } | 75 } |
76 | 76 |
77 virtual bool onClick(Click* click) { | 77 virtual bool onClick(Click* click) { |
78 fCenter.set(click->fCurr.fX, click->fCurr.fY); | 78 fCenter.set(click->fCurr.fX, click->fCurr.fY); |
79 this->inval(NULL); | 79 this->inval(NULL); |
80 return false; | 80 return false; |
81 } | 81 } |
82 | 82 |
83 private: | 83 private: |
84 typedef SampleView INHERITED; | 84 typedef SampleView INHERITED; |
85 }; | 85 }; |
86 | 86 |
87 ////////////////////////////////////////////////////////////////////////////// | 87 ////////////////////////////////////////////////////////////////////////////// |
88 | 88 |
89 static SkView* MyFactory() { return new PathClipView; } | 89 static SkView* MyFactory() { return new PathClipView; } |
90 static SkViewRegister reg(MyFactory); | 90 static SkViewRegister reg(MyFactory); |
OLD | NEW |