Skip to content

Commit

Permalink
[colorLib] remove unused self.slices attribute from LayerListBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
anthrotype committed Jan 21, 2022
1 parent 036003e commit eded208
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Lib/fontTools/colorLib/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,12 @@ def _reuse_ranges(num_layers: int) -> Generator[Tuple[int, int], None, None]:


class LayerListBuilder:
slices: List[ot.Paint]
layers: List[ot.Paint]
reusePool: Mapping[Tuple[Any, ...], int]
tuples: Mapping[int, Tuple[Any, ...]]
keepAlive: List[ot.Paint] # we need id to remain valid

def __init__(self):
self.slices = []
self.layers = []
self.reusePool = {}
self.tuples = {}
Expand Down Expand Up @@ -496,10 +494,6 @@ def _as_tuple(self, paints: Sequence[ot.Paint]) -> Tuple[Any, ...]:
# COLR layers is unusual in that it modifies shared state
# so we need a callback into an object
def _beforeBuildPaintColrLayers(self, dest, source):
paint = ot.Paint()
paint.Format = int(ot.PaintFormat.PaintColrLayers)
self.slices.append(paint)

# Sketchy gymnastics: a sequence input will have dropped it's layers
# into NumLayers; get it back
if isinstance(source.get("NumLayers", None), collections.abc.Sequence):
Expand Down Expand Up @@ -557,6 +551,8 @@ def listToColrLayers(layer):

layers = [listToColrLayers(l) for l in layers]

paint = ot.Paint()
paint.Format = int(ot.PaintFormat.PaintColrLayers)
paint.NumLayers = len(layers)
paint.FirstLayerIndex = len(self.layers)
self.layers.extend(layers)
Expand Down

0 comments on commit eded208

Please sign in to comment.