Remove unused Display.logo attribute

This commit is contained in:
Pierre Ossman 2019-08-23 15:03:13 +02:00 committed by Lauri Kasanen
parent 734bdd3746
commit 4cc536636a
3 changed files with 4 additions and 26 deletions

View File

@ -74,7 +74,6 @@ export default class Display {
this._scale = 1.0;
this._clipViewport = false;
this.logo = null;
// ===== EVENT HANDLERS =====
@ -303,15 +302,8 @@ export default class Display {
}
clear() {
if (this._logo) {
this.resize(this._logo.width, this._logo.height);
this.imageRect(0, 0,
this._logo.width, this._logo.height,
this._logo.type, this._logo.data);
} else {
this.resize(240, 20);
this._drawCtx.clearRect(0, 0, this._fb_width, this._fb_height);
}
this.resize(240, 20);
this._drawCtx.clearRect(0, 0, this._fb_width, this._fb_height);
this.flip();
}

View File

@ -84,7 +84,6 @@ None
| name | type | mode | default | description
| ------------ | ----- | ---- | ------- | ------------
| logo | raw | RW | | Logo to display when cleared: {"width": width, "height": height, "type": mime-type, "data": data}
| scale | float | RW | 1.0 | Display area scale factor 0.0 - 1.0
| clipViewport | bool | RW | false | Use viewport clipping
| width | int | RO | | Display area width
@ -100,7 +99,7 @@ None
| absY | (y) | Return Y relative to the remote display
| resize | (width, height) | Set width and height
| flip | (from_queue) | Update the visible canvas with the contents of the rendering canvas
| clear | () | Clear the display (show logo if set)
| clear | () | Clear the display
| pending | () | Check if there are waiting items in the render queue
| flush | () | Resume processing the render queue unless it's empty
| fillRect | (x, y, width, height, color, from_queue) | Draw a filled in rectangle

View File

@ -269,9 +269,8 @@ describe('Display/Canvas Helper', function () {
display.resize(4, 4);
});
it('should clear the screen on #clear without a logo set', function () {
it('should clear the screen on #clear', function () {
display.fillRect(0, 0, 4, 4, [0x00, 0x00, 0xff]);
display._logo = null;
display.clear();
display.resize(4, 4);
const empty = [];
@ -279,18 +278,6 @@ describe('Display/Canvas Helper', function () {
expect(display).to.have.displayed(new Uint8Array(empty));
});
it('should draw the logo on #clear with a logo set', function (done) {
display._logo = { width: 4, height: 4, type: "image/png", data: make_image_png(checked_data) };
display.clear();
display.onflush = () => {
expect(display).to.have.displayed(checked_data);
expect(display._fb_width).to.equal(4);
expect(display._fb_height).to.equal(4);
done();
};
display.flush();
});
it('should not draw directly on the target canvas', function () {
display.fillRect(0, 0, 4, 4, [0, 0, 0xff]);
display.flip();