Преглед изворни кода

update dc_blend.c 修复 RTGUI_BLENDMODE_BLEND 混合模式已知 BUG

Signed-off-by: yangfasheng <yangfasheng@rt-thread.com>
yangfasheng пре 7 година
родитељ
комит
4265267260
1 измењених фајлова са 7 додато и 7 уклоњено
  1. 7 7
      src/dc_blend.c

+ 7 - 7
src/dc_blend.c

@@ -805,7 +805,7 @@ rtgui_dc_blend_point(struct rtgui_dc * dst, int x, int y, enum RTGUI_BLENDMODE b
             return;
     }
 
-    if (blendMode == RTGUI_BLENDMODE_BLEND || blendMode == RTGUI_BLENDMODE_ADD)
+    if (blendMode == RTGUI_BLENDMODE_ADD || blendMode == RTGUI_BLENDMODE_MOD)
     {
         r = DRAW_MUL(r, a);
         g = DRAW_MUL(g, a);
@@ -846,7 +846,7 @@ rtgui_dc_blend_points(struct rtgui_dc *dst, const rtgui_point_t *points, int cou
     /* we do not support pixel DC */
     if (_dc_get_pixel(dst, 0, 0) == RT_NULL) return;
 
-    if (blendMode == RTGUI_BLENDMODE_BLEND || blendMode == RTGUI_BLENDMODE_ADD)
+    if (blendMode == RTGUI_BLENDMODE_ADD || blendMode == RTGUI_BLENDMODE_MOD)
     {
         r = DRAW_MUL(r, a);
         g = DRAW_MUL(g, a);
@@ -928,7 +928,7 @@ _dc_blend_line_rgb565(struct rtgui_dc * dst, int x1, int y1, int x2, int y2,
 {
     unsigned r, g, b, a, inva;
 
-    if (blendMode == RTGUI_BLENDMODE_BLEND || blendMode == RTGUI_BLENDMODE_ADD)
+    if (blendMode == RTGUI_BLENDMODE_ADD || blendMode == RTGUI_BLENDMODE_MOD)
     {
         r = DRAW_MUL(_r, _a);
         g = DRAW_MUL(_g, _a);
@@ -1033,7 +1033,7 @@ _dc_blend_line_bgr565(struct rtgui_dc * dst, int x1, int y1, int x2, int y2,
 {
     unsigned r, g, b, a, inva;
 
-    if (blendMode == RTGUI_BLENDMODE_BLEND || blendMode == RTGUI_BLENDMODE_ADD)
+    if (blendMode == RTGUI_BLENDMODE_ADD || blendMode == RTGUI_BLENDMODE_MOD)
     {
         r = DRAW_MUL(_r, _a);
         g = DRAW_MUL(_g, _a);
@@ -1138,7 +1138,7 @@ _dc_blend_line_rgb888(struct rtgui_dc * dst, int x1, int y1, int x2, int y2,
 {
     unsigned r, g, b, a, inva;
 
-    if (blendMode == RTGUI_BLENDMODE_BLEND || blendMode == RTGUI_BLENDMODE_ADD)
+    if (blendMode == RTGUI_BLENDMODE_ADD || blendMode == RTGUI_BLENDMODE_MOD)
     {
         r = DRAW_MUL(_r, _a);
         g = DRAW_MUL(_g, _a);
@@ -1288,7 +1288,7 @@ _dc_blend_line_argb8888(struct rtgui_dc * dst, int x1, int y1, int x2, int y2,
 {
     unsigned r, g, b, a, inva;
 
-    if (blendMode == RTGUI_BLENDMODE_BLEND || blendMode == RTGUI_BLENDMODE_ADD)
+    if (blendMode == RTGUI_BLENDMODE_ADD || blendMode == RTGUI_BLENDMODE_MOD)
     {
         r = DRAW_MUL(_r, _a);
         g = DRAW_MUL(_g, _a);
@@ -1819,7 +1819,7 @@ rtgui_dc_blend_fill_rects(struct rtgui_dc * dst, const rtgui_rect_t *rects, int
     b = RTGUI_RGB_B(color);
     a = RTGUI_RGB_A(color);
 
-    if (blendMode == RTGUI_BLENDMODE_BLEND || blendMode == RTGUI_BLENDMODE_ADD)
+    if (blendMode == RTGUI_BLENDMODE_ADD || blendMode == RTGUI_BLENDMODE_MOD)
     {
         r = DRAW_MUL(r, a);
         g = DRAW_MUL(g, a);