| 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 "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 canvas->drawPosText(ascii, asciiLength, pos2.begin(), paint); | 465 canvas->drawPosText(ascii, asciiLength, pos2.begin(), paint); |
| 466 | 466 |
| 467 canvas->translate(SkIntToScalar(50), 0); | 467 canvas->translate(SkIntToScalar(50), 0); |
| 468 paint.setColor(SK_ColorCYAN); | 468 paint.setColor(SK_ColorCYAN); |
| 469 canvas->drawText(utf8, sizeof(utf8) - 1, x, y, paint); | 469 canvas->drawText(utf8, sizeof(utf8) - 1, x, y, paint); |
| 470 | 470 |
| 471 canvas->translate(SkIntToScalar(30), 0); | 471 canvas->translate(SkIntToScalar(30), 0); |
| 472 paint.setColor(SK_ColorMAGENTA); | 472 paint.setColor(SK_ColorMAGENTA); |
| 473 paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); | 473 paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); |
| 474 matrix.setTranslate(SkIntToScalar(10), SkIntToScalar(10)); | 474 matrix.setTranslate(SkIntToScalar(10), SkIntToScalar(10)); |
| 475 canvas->drawTextOnPath((void*) utf16, sizeof(utf16), path, &matrix, pain
t); | 475 canvas->drawTextOnPath((void*) utf16, sizeof(utf16), path, &matrix, |
| 476 SkCanvas::kStretch_TextOnPathMethod, paint); |
| 476 canvas->translate(0, SkIntToScalar(20)); | 477 canvas->translate(0, SkIntToScalar(20)); |
| 477 canvas->drawTextOnPath((void*) utf16simple, sizeof(utf16simple), path, &
matrix, paint); | 478 canvas->drawTextOnPath((void*) utf16simple, sizeof(utf16simple), path, &
matrix, |
| 479 SkCanvas::kStretch_TextOnPathMethod, paint); |
| 478 canvas->restore(); | 480 canvas->restore(); |
| 479 | 481 |
| 480 canvas->translate(0, SkIntToScalar(60)); | 482 canvas->translate(0, SkIntToScalar(60)); |
| 481 paint.setTextEncoding(SkPaint::kUTF8_TextEncoding); | 483 paint.setTextEncoding(SkPaint::kUTF8_TextEncoding); |
| 482 canvas->restore(); | 484 canvas->restore(); |
| 483 } | 485 } |
| 484 | 486 |
| 485 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned m
odi) { | 487 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned m
odi) { |
| 486 fClickPt.set(x, y); | 488 fClickPt.set(x, y); |
| 487 this->inval(NULL); | 489 this->inval(NULL); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 private: | 579 private: |
| 578 SkPoint fClickPt; | 580 SkPoint fClickPt; |
| 579 SkBitmap fBug, fTb, fTx; | 581 SkBitmap fBug, fTb, fTx; |
| 580 typedef SampleView INHERITED; | 582 typedef SampleView INHERITED; |
| 581 }; | 583 }; |
| 582 | 584 |
| 583 ////////////////////////////////////////////////////////////////////////////// | 585 ////////////////////////////////////////////////////////////////////////////// |
| 584 | 586 |
| 585 static SkView* MyFactory() { return new DemoView; } | 587 static SkView* MyFactory() { return new DemoView; } |
| 586 static SkViewRegister reg(MyFactory); | 588 static SkViewRegister reg(MyFactory); |
| OLD | NEW |