| 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 "OverView.h" | 8 #include "OverView.h" |
| 9 #include "SampleCode.h" | 9 #include "SampleCode.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 bool onQuery(SkEvent* evt) override { | 52 bool onQuery(SkEvent* evt) override { |
| 53 if (SampleCode::TitleQ(*evt)) { | 53 if (SampleCode::TitleQ(*evt)) { |
| 54 SampleCode::TitleR(evt, "Overview"); | 54 SampleCode::TitleR(evt, "Overview"); |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 if (evt->isType(gIsOverview)) { | 57 if (evt->isType(gIsOverview)) { |
| 58 return true; | 58 return true; |
| 59 } | 59 } |
| 60 SkUnichar uni; | 60 SkUnichar uni; |
| 61 if (SampleCode::CharQ(*evt, &uni)) { | 61 if (SampleCode::CharQ(*evt, &uni)) { |
| 62 fMatchStr.appendUnichar(uni); | 62 if (uni >= ' ') { |
| 63 fMatchStr.appendUnichar(uni); |
| 64 } |
| 63 this->inval(nullptr); | 65 this->inval(nullptr); |
| 64 return true; | 66 return true; |
| 65 } | 67 } |
| 66 return this->INHERITED::onQuery(evt); | 68 return this->INHERITED::onQuery(evt); |
| 67 } | 69 } |
| 68 | 70 |
| 69 void onDraw(SkCanvas* canvas) override; | 71 void onDraw(SkCanvas* canvas) override; |
| 70 | 72 |
| 71 bool onSendClickToChildren(SkScalar x, SkScalar y, unsigned modi) override { | 73 bool onSendClickToChildren(SkScalar x, SkScalar y, unsigned modi) override { |
| 72 return false; | 74 return false; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 SkPoint loc = this->start(); | 166 SkPoint loc = this->start(); |
| 165 for (int i = 0; i < fCount; ++i) { | 167 for (int i = 0; i < fCount; ++i) { |
| 166 if (draw_this_name(fNames[i], fMatchStr)) { | 168 if (draw_this_name(fNames[i], fMatchStr)) { |
| 167 canvas->drawRect(this->bounds(loc), paint); | 169 canvas->drawRect(this->bounds(loc), paint); |
| 168 canvas->drawText(fNames[i].c_str(), fNames[i].size(), loc.x(), loc.y
(), fNamePaint); | 170 canvas->drawText(fNames[i].c_str(), fNames[i].size(), loc.x(), loc.y
(), fNamePaint); |
| 169 this->next(&loc); | 171 this->next(&loc); |
| 170 } | 172 } |
| 171 } | 173 } |
| 172 } | 174 } |
| 173 | 175 |
| OLD | NEW |