Skip to content

Commit

Permalink
fsg version
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzucchi committed Aug 10, 2024
1 parent 1214d96 commit df95966
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/draw/sw/lv_draw_sw_fill.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ void lv_draw_sw_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc,
if(!_lv_area_intersect(&clipped_coords, &bg_coords, draw_unit->clip_area)) return;

lv_grad_dir_t grad_dir = dsc->grad.dir;
lv_color_t bg_color = grad_dir == LV_GRAD_DIR_NONE ? dsc->color : dsc->grad.stops[0].color;
lv_color_t bg_color;
if (grad_dir == LV_GRAD_DIR_NONE) {
bg_color.blue = dsc->color.blue;
bg_color.red = dsc->color.red;
bg_color.green = dsc->color.green;
} else {
bg_color.blue = dsc->grad.stops[0].color.blue;
bg_color.red = dsc->grad.stops[0].color.red;
bg_color.green = dsc->grad.stops[0].color.green;
}

lv_draw_sw_blend_dsc_t blend_dsc = {0};
blend_dsc.color = bg_color;
Expand Down
8 changes: 6 additions & 2 deletions src/draw/sw/lv_draw_sw_gradient.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ void LV_ATTRIBUTE_FAST_MEM lv_gradient_color_calculate(const lv_grad_dsc_t * dsc
LV_ASSERT(found_i != 0);

lv_color_t one, two;
one = dsc->stops[found_i - 1].color;
two = dsc->stops[found_i].color;
one.blue = dsc->stops[found_i - 1].color.blue;
one.green = dsc->stops[found_i - 1].color.green;
one.red = dsc->stops[found_i - 1].color.red;
two.blue = dsc->stops[found_i].color.blue;
two.red = dsc->stops[found_i].color.red;
two.green = dsc->stops[found_i].color.green;
min = (dsc->stops[found_i - 1].frac * range) >> 8;
max = (dsc->stops[found_i].frac * range) >> 8;
d = max - min;
Expand Down
2 changes: 1 addition & 1 deletion src/misc/lv_color.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ typedef struct {
uint8_t blue;
uint8_t green;
uint8_t red;
} lv_color_t;
} lv_color_t;

typedef struct {
uint16_t blue : 5;
Expand Down

0 comments on commit df95966

Please sign in to comment.