Remove label cache, render text directly to target canvas

This commit is contained in:
Andreas Hocevar
2020-01-13 21:52:55 +01:00
parent 56a6919d9a
commit fd935bae53
11 changed files with 175 additions and 187 deletions

View File

@@ -29,11 +29,11 @@ function executeInstructions(builder, expectedDrawTextImageCalls, expectedBuilde
const transform = createTransform();
const context = createContext();
const executor = new Executor(0.02, 1, false, builder.finish());
sinon.spy(executor, 'drawTextImageWithPointPlacement_');
const replayImageStub = sinon.stub(executor, 'replayImage_');
sinon.spy(executor, 'drawLabelWithPointPlacement_');
const replayImageOrLabelStub = sinon.stub(executor, 'replayImageOrLabel_');
executor.execute(context, transform);
expect(executor.drawTextImageWithPointPlacement_.callCount).to.be(expectedDrawTextImageCalls);
expect(replayImageStub.callCount).to.be(expectedBuilderImageCalls);
expect(executor.drawLabelWithPointPlacement_.callCount).to.be(expectedDrawTextImageCalls);
expect(replayImageOrLabelStub.callCount).to.be(expectedBuilderImageCalls);
}
describe('ol.render.canvas.TextBuilder', function() {