| 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 "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 SkDebugf("------ byte %x\n", fByte); | 87 SkDebugf("------ byte %x\n", fByte); |
| 88 } | 88 } |
| 89 | 89 |
| 90 if (false) { | 90 if (false) { |
| 91 fByte += 1; | 91 fByte += 1; |
| 92 fByte &= 0xFF; | 92 fByte &= 0xFF; |
| 93 this->inval(NULL); | 93 this->inval(NULL); |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) { | 97 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned)
SK_OVERRIDE { |
| 98 return new Click(this); | 98 return new Click(this); |
| 99 } | 99 } |
| 100 | 100 |
| 101 virtual bool onClick(Click* click) { | 101 virtual bool onClick(Click* click) { |
| 102 int y = click->fICurr.fY; | 102 int y = click->fICurr.fY; |
| 103 if (y < 0) { | 103 if (y < 0) { |
| 104 y = 0; | 104 y = 0; |
| 105 } else if (y > 255) { | 105 } else if (y > 255) { |
| 106 y = 255; | 106 y = 255; |
| 107 } | 107 } |
| 108 fByte = y; | 108 fByte = y; |
| 109 this->inval(NULL); | 109 this->inval(NULL); |
| 110 return true; | 110 return true; |
| 111 } | 111 } |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 int fByte; | 114 int fByte; |
| 115 | 115 |
| 116 typedef SampleView INHERITED; | 116 typedef SampleView INHERITED; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 ////////////////////////////////////////////////////////////////////////////// | 119 ////////////////////////////////////////////////////////////////////////////// |
| 120 | 120 |
| 121 static SkView* MyFactory() { return new TextAlphaView; } | 121 static SkView* MyFactory() { return new TextAlphaView; } |
| 122 static SkViewRegister reg(MyFactory); | 122 static SkViewRegister reg(MyFactory); |
| OLD | NEW |