1,295
edits
(→Roc) |
(→Roc) |
||
| Line 24: | Line 24: | ||
class LayerBuilder { | class LayerBuilder { | ||
// Indicate that the given layer is related to this one, e.g., the new layer | // Indicate that the given layer is related to this one, e.g., the new layer | ||
// corresponds to the same element as the given layer | // corresponds to the same element as the given layer. | ||
// We can use this to predict that the new layer will be used in the | |||
// We can | |||
// same way as the given layer, for example, the eventual rendering | // same way as the given layer, for example, the eventual rendering | ||
// destination(s) of the new layer can be predicted to be whatever the old | // destination(s) of the new layer can be predicted to be whatever the old | ||
| Line 94: | Line 91: | ||
RenderedLayerBuilder(size, format); | RenderedLayerBuilder(size, format); | ||
// create a (conceptual) copy of the given RenderedLayer so we can modify | // create a (conceptual) copy of the given RenderedLayer so we can modify its | ||
// or draw into it. | // parameters or draw into it. The underlying buffer can be managed with | ||
// | // copy on write so if we don't ever call getContext, the buffer need not | ||
// be copied. | |||
RenderedLayerBuilder(Layer layer); | RenderedLayerBuilder(Layer layer); | ||
edits