зеркало из https://github.com/mozilla/moz-skia.git
add serialization to SkLayerRasterizer
git-svn-id: http://skia.googlecode.com/svn/trunk@2088 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
18dc47731f
Коммит
43e9f20f4b
|
@ -36,6 +36,8 @@ public:
|
|||
virtual Factory getFactory();
|
||||
virtual void flatten(SkFlattenableWriteBuffer&);
|
||||
|
||||
static SkFlattenable* CreateProc(SkFlattenableReadBuffer&);
|
||||
|
||||
protected:
|
||||
SkLayerRasterizer(SkFlattenableReadBuffer&);
|
||||
|
||||
|
@ -46,8 +48,6 @@ protected:
|
|||
|
||||
private:
|
||||
SkDeque fLayers;
|
||||
|
||||
static SkFlattenable* CreateProc(SkFlattenableReadBuffer&);
|
||||
|
||||
typedef SkRasterizer INHERITED;
|
||||
};
|
||||
|
|
|
@ -94,23 +94,18 @@ static void discrete_pe(SkPaint* paint) {
|
|||
paint->setPathEffect(new SkDiscretePathEffect(10, 4))->unref();
|
||||
}
|
||||
|
||||
class TilePathEffect : public Sk2DPathEffect {
|
||||
static SkMatrix make_mat() {
|
||||
SkMatrix m;
|
||||
m.setScale(12, 12);
|
||||
return m;
|
||||
}
|
||||
public:
|
||||
TilePathEffect() : Sk2DPathEffect(make_mat()) {}
|
||||
static SkPathEffect* MakeTileEffect() {
|
||||
SkMatrix m;
|
||||
m.setScale(SkIntToScalar(12), SkIntToScalar(12));
|
||||
|
||||
protected:
|
||||
virtual void next(const SkPoint& loc, int u, int v, SkPath* dst) {
|
||||
dst->addCircle(loc.fX, loc.fY, 5);
|
||||
}
|
||||
};
|
||||
SkPath path;
|
||||
path.addCircle(0, 0, SkIntToScalar(5));
|
||||
|
||||
return new SkPath2DPathEffect(m, path);
|
||||
}
|
||||
|
||||
static void tile_pe(SkPaint* paint) {
|
||||
paint->setPathEffect(new TilePathEffect)->unref();
|
||||
paint->setPathEffect(MakeTileEffect())->unref();
|
||||
}
|
||||
|
||||
static const PE_Proc gPE2[] = { fill_pe, discrete_pe, tile_pe };
|
||||
|
|
|
@ -223,3 +223,6 @@ SkFlattenable::Factory SkLayerRasterizer::getFactory() {
|
|||
return CreateProc;
|
||||
}
|
||||
|
||||
static SkFlattenable::Registrar gReg("SkLayerRasterizer",
|
||||
SkLayerRasterizer::CreateProc);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче