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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void onDrawContent(SkCanvas* canvas) override { | 60 void onDrawContent(SkCanvas* canvas) override { |
61 SkPaint paint; | 61 SkPaint paint; |
62 make_paint(&paint, SkShader::kRepeat_TileMode); | 62 make_paint(&paint, SkShader::kRepeat_TileMode); |
63 | 63 |
64 // canvas->scale(SK_Scalar1*2, SK_Scalar1); | 64 // canvas->scale(SK_Scalar1*2, SK_Scalar1); |
65 canvas->translate(SkIntToScalar(100), SkIntToScalar(100)); | 65 canvas->translate(SkIntToScalar(100), SkIntToScalar(100)); |
66 canvas->drawPaint(paint); | 66 canvas->drawPaint(paint); |
67 } | 67 } |
68 | 68 |
69 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) ove
rride { | 69 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) ove
rride { |
70 this->inval(NULL); | 70 this->inval(nullptr); |
71 | 71 |
72 return this->INHERITED::onFindClickHandler(x, y, modi); | 72 return this->INHERITED::onFindClickHandler(x, y, modi); |
73 } | 73 } |
74 | 74 |
75 bool onClick(Click* click) override { | 75 bool onClick(Click* click) override { |
76 return this->INHERITED::onClick(click); | 76 return this->INHERITED::onClick(click); |
77 } | 77 } |
78 | 78 |
79 virtual bool handleKey(SkKey) { | 79 virtual bool handleKey(SkKey) { |
80 this->inval(NULL); | 80 this->inval(nullptr); |
81 return true; | 81 return true; |
82 } | 82 } |
83 | 83 |
84 private: | 84 private: |
85 typedef SampleView INHERITED; | 85 typedef SampleView INHERITED; |
86 }; | 86 }; |
87 | 87 |
88 ////////////////////////////////////////////////////////////////////////////// | 88 ////////////////////////////////////////////////////////////////////////////// |
89 | 89 |
90 static SkView* MyFactory() { return new RepeatTileView; } | 90 static SkView* MyFactory() { return new RepeatTileView; } |
91 static SkViewRegister reg(MyFactory); | 91 static SkViewRegister reg(MyFactory); |
OLD | NEW |