| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 if (SampleCode::TitleQ(*evt)) { | 262 if (SampleCode::TitleQ(*evt)) { |
| 263 SampleCode::TitleR(evt, "Patch"); | 263 SampleCode::TitleR(evt, "Patch"); |
| 264 return true; | 264 return true; |
| 265 } | 265 } |
| 266 return this->INHERITED::onQuery(evt); | 266 return this->INHERITED::onQuery(evt); |
| 267 } | 267 } |
| 268 | 268 |
| 269 virtual void onDrawContent(SkCanvas* canvas) { | 269 virtual void onDrawContent(SkCanvas* canvas) { |
| 270 SkPaint paint; | 270 SkPaint paint; |
| 271 paint.setDither(true); | 271 paint.setDither(true); |
| 272 paint.setFilterBitmap(true); | 272 paint.setFilterLevel(SkPaint::kLow_FilterLevel); |
| 273 | 273 |
| 274 canvas->translate(SkIntToScalar(20), 0); | 274 canvas->translate(SkIntToScalar(20), 0); |
| 275 | 275 |
| 276 Patch patch; | 276 Patch patch; |
| 277 | 277 |
| 278 paint.setShader(fShader0); | 278 paint.setShader(fShader0); |
| 279 if (fSize0.fX == 0) { | 279 if (fSize0.fX == 0) { |
| 280 fSize0.fX = 1; | 280 fSize0.fX = 1; |
| 281 } | 281 } |
| 282 if (fSize0.fY == 0) { | 282 if (fSize0.fY == 0) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 } | 327 } |
| 328 | 328 |
| 329 private: | 329 private: |
| 330 typedef SampleView INHERITED; | 330 typedef SampleView INHERITED; |
| 331 }; | 331 }; |
| 332 | 332 |
| 333 ////////////////////////////////////////////////////////////////////////////// | 333 ////////////////////////////////////////////////////////////////////////////// |
| 334 | 334 |
| 335 static SkView* MyFactory() { return new PatchView; } | 335 static SkView* MyFactory() { return new PatchView; } |
| 336 static SkViewRegister reg(MyFactory); | 336 static SkViewRegister reg(MyFactory); |
| OLD | NEW |