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" |
11 #include "SkView.h" | 11 #include "SkView.h" |
12 #include "Sk1DPathEffect.h" | 12 #include "Sk1DPathEffect.h" |
13 #include "Sk2DPathEffect.h" | 13 #include "Sk2DPathEffect.h" |
14 #include "SkAvoidXfermode.h" | |
15 #include "SkBlurMaskFilter.h" | 14 #include "SkBlurMaskFilter.h" |
16 #include "SkColorFilter.h" | 15 #include "SkColorFilter.h" |
17 #include "SkColorPriv.h" | 16 #include "SkColorPriv.h" |
18 #include "SkCornerPathEffect.h" | 17 #include "SkCornerPathEffect.h" |
19 #include "SkDashPathEffect.h" | 18 #include "SkDashPathEffect.h" |
20 #include "SkDiscretePathEffect.h" | 19 #include "SkDiscretePathEffect.h" |
21 #include "SkEmbossMaskFilter.h" | 20 #include "SkEmbossMaskFilter.h" |
22 #include "SkReadBuffer.h" | 21 #include "SkReadBuffer.h" |
23 #include "SkWriteBuffer.h" | 22 #include "SkWriteBuffer.h" |
24 #include "SkGradientShader.h" | 23 #include "SkGradientShader.h" |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 canvas->drawText(str.c_str(), str.size(), x, y, paint); | 565 canvas->drawText(str.c_str(), str.size(), x, y, paint); |
567 SkRect oval = { x, y - SkIntToScalar(40), x + SkIntToScalar(40), y
}; | 566 SkRect oval = { x, y - SkIntToScalar(40), x + SkIntToScalar(40), y
}; |
568 paint.setStyle(SkPaint::kStroke_Style); | 567 paint.setStyle(SkPaint::kStroke_Style); |
569 canvas->drawOval(oval, paint); | 568 canvas->drawOval(oval, paint); |
570 paint.setStyle(SkPaint::kFill_Style); | 569 paint.setStyle(SkPaint::kFill_Style); |
571 | 570 |
572 y += paint.getFontSpacing(); | 571 y += paint.getFontSpacing(); |
573 } | 572 } |
574 | 573 |
575 canvas->restore(); | 574 canvas->restore(); |
576 | |
577 if (1) { | |
578 SkAutoTUnref<SkAvoidXfermode> mode(SkAvoidXfermode::Create(SK_ColorW
HITE, 0xFF, | |
579 SkAvoidXfermode::kTargetColor_Mode)); | |
580 SkPaint paint; | |
581 x += SkIntToScalar(20); | |
582 SkRect r = { x, 0, x + SkIntToScalar(360), SkIntToScalar(700) }; | |
583 paint.setXfermode(mode); | |
584 paint.setColor(SK_ColorGREEN); | |
585 paint.setAntiAlias(true); | |
586 canvas->drawOval(r, paint); | |
587 } | |
588 } | 575 } |
589 | 576 |
590 private: | 577 private: |
591 SkPoint fClickPt; | 578 SkPoint fClickPt; |
592 SkBitmap fBug, fTb, fTx; | 579 SkBitmap fBug, fTb, fTx; |
593 typedef SampleView INHERITED; | 580 typedef SampleView INHERITED; |
594 }; | 581 }; |
595 | 582 |
596 ////////////////////////////////////////////////////////////////////////////// | 583 ////////////////////////////////////////////////////////////////////////////// |
597 | 584 |
598 static SkView* MyFactory() { return new DemoView; } | 585 static SkView* MyFactory() { return new DemoView; } |
599 static SkViewRegister reg(MyFactory); | 586 static SkViewRegister reg(MyFactory); |
OLD | NEW |