| 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 "SkAvoidXfermode.h" |
| 15 #include "SkBlurMaskFilter.h" | 15 #include "SkBlurMaskFilter.h" |
| 16 #include "SkColorFilter.h" | 16 #include "SkColorFilter.h" |
| 17 #include "SkColorPriv.h" | 17 #include "SkColorPriv.h" |
| 18 #include "SkCornerPathEffect.h" | 18 #include "SkCornerPathEffect.h" |
| 19 #include "SkDashPathEffect.h" | 19 #include "SkDashPathEffect.h" |
| 20 #include "SkDiscretePathEffect.h" | 20 #include "SkDiscretePathEffect.h" |
| 21 #include "SkEmbossMaskFilter.h" | 21 #include "SkEmbossMaskFilter.h" |
| 22 #include "SkFlattenableBuffers.h" | 22 #include "SkReadBuffer.h" |
| 23 #include "SkWriteBuffer.h" |
| 23 #include "SkGradientShader.h" | 24 #include "SkGradientShader.h" |
| 24 #include "SkImageDecoder.h" | 25 #include "SkImageDecoder.h" |
| 25 #include "SkLayerRasterizer.h" | 26 #include "SkLayerRasterizer.h" |
| 26 #include "SkMath.h" | 27 #include "SkMath.h" |
| 27 #include "SkPath.h" | 28 #include "SkPath.h" |
| 28 #include "SkRegion.h" | 29 #include "SkRegion.h" |
| 29 #include "SkShader.h" | 30 #include "SkShader.h" |
| 30 #include "SkComposeShader.h" | 31 #include "SkComposeShader.h" |
| 31 #include "SkCornerPathEffect.h" | 32 #include "SkCornerPathEffect.h" |
| 32 #include "SkPathMeasure.h" | 33 #include "SkPathMeasure.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 Dot2DPathEffect(SkScalar radius, const SkMatrix& matrix) | 165 Dot2DPathEffect(SkScalar radius, const SkMatrix& matrix) |
| 165 : Sk2DPathEffect(matrix), fRadius(radius) {} | 166 : Sk2DPathEffect(matrix), fRadius(radius) {} |
| 166 | 167 |
| 167 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Dot2DPathEffect) | 168 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Dot2DPathEffect) |
| 168 | 169 |
| 169 protected: | 170 protected: |
| 170 virtual void next(const SkPoint& loc, int u, int v, SkPath* dst) const SK_OV
ERRIDE { | 171 virtual void next(const SkPoint& loc, int u, int v, SkPath* dst) const SK_OV
ERRIDE { |
| 171 dst->addCircle(loc.fX, loc.fY, fRadius); | 172 dst->addCircle(loc.fX, loc.fY, fRadius); |
| 172 } | 173 } |
| 173 | 174 |
| 174 Dot2DPathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) { | 175 Dot2DPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) { |
| 175 fRadius = buffer.readScalar(); | 176 fRadius = buffer.readScalar(); |
| 176 } | 177 } |
| 177 virtual void flatten(SkFlattenableWriteBuffer& buffer) const SK_OVERRIDE { | 178 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { |
| 178 this->INHERITED::flatten(buffer); | 179 this->INHERITED::flatten(buffer); |
| 179 buffer.writeScalar(fRadius); | 180 buffer.writeScalar(fRadius); |
| 180 } | 181 } |
| 181 | 182 |
| 182 private: | 183 private: |
| 183 SkScalar fRadius; | 184 SkScalar fRadius; |
| 184 | 185 |
| 185 typedef Sk2DPathEffect INHERITED; | 186 typedef Sk2DPathEffect INHERITED; |
| 186 }; | 187 }; |
| 187 | 188 |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 private: | 642 private: |
| 642 SkPoint fClickPt; | 643 SkPoint fClickPt; |
| 643 SkBitmap fBug, fTb, fTx; | 644 SkBitmap fBug, fTb, fTx; |
| 644 typedef SampleView INHERITED; | 645 typedef SampleView INHERITED; |
| 645 }; | 646 }; |
| 646 | 647 |
| 647 ////////////////////////////////////////////////////////////////////////////// | 648 ////////////////////////////////////////////////////////////////////////////// |
| 648 | 649 |
| 649 static SkView* MyFactory() { return new DemoView; } | 650 static SkView* MyFactory() { return new DemoView; } |
| 650 static SkViewRegister reg(MyFactory); | 651 static SkViewRegister reg(MyFactory); |
| OLD | NEW |