OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
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 | 8 |
9 | 9 |
10 #ifndef SkLayerRasterizer_DEFINED | 10 #ifndef SkLayerRasterizer_DEFINED |
(...skipping 21 matching lines...) Expand all Loading... |
32 /** | 32 /** |
33 * Add a new layer (above any previous layers) to the rasterizer. | 33 * Add a new layer (above any previous layers) to the rasterizer. |
34 * The layer will extract those fields that affect the mask from | 34 * The layer will extract those fields that affect the mask from |
35 * the specified paint, but will not retain a reference to the paint | 35 * the specified paint, but will not retain a reference to the paint |
36 * object itself, so it may be reused without danger of side-effects. | 36 * object itself, so it may be reused without danger of side-effects. |
37 */ | 37 */ |
38 void addLayer(const SkPaint& paint, SkScalar dx, SkScalar dy); | 38 void addLayer(const SkPaint& paint, SkScalar dx, SkScalar dy); |
39 | 39 |
40 /** | 40 /** |
41 * Pass queue of layers on to newly created layer rasterizer and retur
n it. The builder | 41 * Pass queue of layers on to newly created layer rasterizer and retur
n it. The builder |
42 * *cannot* be used any more after calling this function. | 42 * *cannot* be used any more after calling this function. If no layers
have been added, |
| 43 * returns NULL. |
43 * | 44 * |
44 * The caller is responsible for calling unref() on the returned objec
t. | 45 * The caller is responsible for calling unref() on the returned objec
t, if non NULL. |
45 */ | 46 */ |
46 SkLayerRasterizer* detachRasterizer(); | 47 SkLayerRasterizer* detachRasterizer(); |
47 | 48 |
48 /** | 49 /** |
49 * Create and return a new immutable SkLayerRasterizer that contains a
shapshot of the | 50 * Create and return a new immutable SkLayerRasterizer that contains a
shapshot of the |
50 * layers that were added to the Builder, without modifying the Builde
r. The Builder | 51 * layers that were added to the Builder, without modifying the Builde
r. The Builder |
51 * *may* be used after calling this function. It will continue to hold
any layers | 52 * *may* be used after calling this function. It will continue to hold
any layers |
52 * previously added, so consecutive calls to this function will return
identical objects, | 53 * previously added, so consecutive calls to this function will return
identical objects, |
53 * and objects returned by future calls to this function contain all t
he layers in | 54 * and objects returned by future calls to this function contain all t
he layers in |
54 * previously returned objects. | 55 * previously returned objects. If no layers have been added, returns
NULL. |
55 * | 56 * |
56 * Future calls to addLayer will not affect rasterizers previously ret
urned by this call. | 57 * Future calls to addLayer will not affect rasterizers previously ret
urned by this call. |
57 * | 58 * |
58 * The caller is responsible for calling unref() on the returned objec
t. | 59 * The caller is responsible for calling unref() on the returned objec
t, if non NULL. |
59 */ | 60 */ |
60 SkLayerRasterizer* snapshotRasterizer() const; | 61 SkLayerRasterizer* snapshotRasterizer() const; |
61 | 62 |
62 private: | 63 private: |
63 SkDeque* fLayers; | 64 SkDeque* fLayers; |
64 }; | 65 }; |
65 | 66 |
66 #ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API | 67 #ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API |
67 void addLayer(const SkPaint& paint) { | 68 void addLayer(const SkPaint& paint) { |
68 this->addLayer(paint, 0, 0); | 69 this->addLayer(paint, 0, 0); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 #endif | 102 #endif |
102 | 103 |
103 static SkDeque* ReadLayers(SkReadBuffer& buffer); | 104 static SkDeque* ReadLayers(SkReadBuffer& buffer); |
104 | 105 |
105 friend class LayerRasterizerTester; | 106 friend class LayerRasterizerTester; |
106 | 107 |
107 typedef SkRasterizer INHERITED; | 108 typedef SkRasterizer INHERITED; |
108 }; | 109 }; |
109 | 110 |
110 #endif | 111 #endif |
OLD | NEW |