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