Skip to content

Commit

Permalink
Add two-color PNG test, fix initial dirty state
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Corry committed Nov 17, 2023
1 parent 91149a2 commit 1dfbe7a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pixel_display.toit
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ abstract class PixelDisplay implements Window:
if driver_.flags & FLAG_PARTIAL_UPDATES != 0:
dirty_bytes_per_line_ = (driver_.width >> 3) + 1
dirty_strips := (height >> 6) + 1 // 8-tall strips of dirty bits.
dirty_ = ByteArray dirty_bytes_per_line_ * dirty_strips: 0xff // Initialized to DIRTY_, which is 1.
dirty_ = ByteArray dirty_bytes_per_line_ * dirty_strips

if transform:
if portrait != null or inverted: throw "INVALID_ARGUMENT"
Expand All @@ -165,6 +165,9 @@ abstract class PixelDisplay implements Window:
else:
transform_ = (Transform.identity.translate driver_.width 0).rotate_right

if driver_.flags & FLAG_PARTIAL_UPDATES != 0:
all_is_dirty_

abstract default_draw_color_ -> int
abstract default_background_color_ -> int

Expand Down Expand Up @@ -338,7 +341,7 @@ abstract class PixelDisplay implements Window:
driver_.commit 0 0 driver_.width driver_.height

/**
Draws the texture.
Draws the elements and textures.
After changing the display, for example by adding, removing or moving
textures, call this to refresh the screen. Optionally give a $speed
Expand Down
Binary file modified tests/gold/rounded_three_color_window_visualized.toit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/gold/simple_three_color_window_visualized.toit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/gold/three_color_bitmap_2_visualized.toit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1dfbe7a

Please sign in to comment.