SDL 1.3 is now under the zlib license.
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
21 #include "SDL_config.h"
23 #if !SDL_RENDER_DISABLED
26 #include "SDL_blendline.h"
27 #include "SDL_blendpoint.h"
31 SDL_BlendLine_RGB2(SDL_Surface * dst, int x1, int y1, int x2, int y2,
32 SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
35 const SDL_PixelFormat *fmt = dst->format;
36 unsigned r, g, b, a, inva;
38 if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
53 case SDL_BLENDMODE_BLEND:
54 HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end);
56 case SDL_BLENDMODE_ADD:
57 HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end);
59 case SDL_BLENDMODE_MOD:
60 HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end);
63 HLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
66 } else if (x1 == x2) {
68 case SDL_BLENDMODE_BLEND:
69 VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end);
71 case SDL_BLENDMODE_ADD:
72 VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end);
74 case SDL_BLENDMODE_MOD:
75 VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end);
78 VLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
81 } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
83 case SDL_BLENDMODE_BLEND:
84 DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end);
86 case SDL_BLENDMODE_ADD:
87 DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end);
89 case SDL_BLENDMODE_MOD:
90 DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end);
93 DLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
98 case SDL_BLENDMODE_BLEND:
99 AALINE(x1, y1, x2, y2,
100 DRAW_SETPIXELXY2_BLEND_RGB, DRAW_SETPIXELXY2_BLEND_RGB,
103 case SDL_BLENDMODE_ADD:
104 AALINE(x1, y1, x2, y2,
105 DRAW_SETPIXELXY2_ADD_RGB, DRAW_SETPIXELXY2_ADD_RGB,
108 case SDL_BLENDMODE_MOD:
109 AALINE(x1, y1, x2, y2,
110 DRAW_SETPIXELXY2_MOD_RGB, DRAW_SETPIXELXY2_MOD_RGB,
114 AALINE(x1, y1, x2, y2,
115 DRAW_SETPIXELXY2_RGB, DRAW_SETPIXELXY2_BLEND_RGB,
123 SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2,
124 SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
127 const SDL_PixelFormat *fmt = dst->format;
128 unsigned r, g, b, a, inva;
130 if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
131 r = DRAW_MUL(_r, _a);
132 g = DRAW_MUL(_g, _a);
133 b = DRAW_MUL(_b, _a);
145 case SDL_BLENDMODE_BLEND:
146 HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end);
148 case SDL_BLENDMODE_ADD:
149 HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end);
151 case SDL_BLENDMODE_MOD:
152 HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end);
155 HLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
158 } else if (x1 == x2) {
160 case SDL_BLENDMODE_BLEND:
161 VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end);
163 case SDL_BLENDMODE_ADD:
164 VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end);
166 case SDL_BLENDMODE_MOD:
167 VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end);
170 VLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
173 } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
175 case SDL_BLENDMODE_BLEND:
176 DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end);
178 case SDL_BLENDMODE_ADD:
179 DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end);
181 case SDL_BLENDMODE_MOD:
182 DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end);
185 DLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
190 case SDL_BLENDMODE_BLEND:
191 AALINE(x1, y1, x2, y2,
192 DRAW_SETPIXELXY_BLEND_RGB555, DRAW_SETPIXELXY_BLEND_RGB555,
195 case SDL_BLENDMODE_ADD:
196 AALINE(x1, y1, x2, y2,
197 DRAW_SETPIXELXY_ADD_RGB555, DRAW_SETPIXELXY_ADD_RGB555,
200 case SDL_BLENDMODE_MOD:
201 AALINE(x1, y1, x2, y2,
202 DRAW_SETPIXELXY_MOD_RGB555, DRAW_SETPIXELXY_MOD_RGB555,
206 AALINE(x1, y1, x2, y2,
207 DRAW_SETPIXELXY_RGB555, DRAW_SETPIXELXY_BLEND_RGB555,
215 SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2,
216 SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
219 const SDL_PixelFormat *fmt = dst->format;
220 unsigned r, g, b, a, inva;
222 if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
223 r = DRAW_MUL(_r, _a);
224 g = DRAW_MUL(_g, _a);
225 b = DRAW_MUL(_b, _a);
237 case SDL_BLENDMODE_BLEND:
238 HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end);
240 case SDL_BLENDMODE_ADD:
241 HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end);
243 case SDL_BLENDMODE_MOD:
244 HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end);
247 HLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
250 } else if (x1 == x2) {
252 case SDL_BLENDMODE_BLEND:
253 VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end);
255 case SDL_BLENDMODE_ADD:
256 VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end);
258 case SDL_BLENDMODE_MOD:
259 VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end);
262 VLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
265 } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
267 case SDL_BLENDMODE_BLEND:
268 DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end);
270 case SDL_BLENDMODE_ADD:
271 DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end);
273 case SDL_BLENDMODE_MOD:
274 DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end);
277 DLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
282 case SDL_BLENDMODE_BLEND:
283 AALINE(x1, y1, x2, y2,
284 DRAW_SETPIXELXY_BLEND_RGB565, DRAW_SETPIXELXY_BLEND_RGB565,
287 case SDL_BLENDMODE_ADD:
288 AALINE(x1, y1, x2, y2,
289 DRAW_SETPIXELXY_ADD_RGB565, DRAW_SETPIXELXY_ADD_RGB565,
292 case SDL_BLENDMODE_MOD:
293 AALINE(x1, y1, x2, y2,
294 DRAW_SETPIXELXY_MOD_RGB565, DRAW_SETPIXELXY_MOD_RGB565,
298 AALINE(x1, y1, x2, y2,
299 DRAW_SETPIXELXY_RGB565, DRAW_SETPIXELXY_BLEND_RGB565,
307 SDL_BlendLine_RGB4(SDL_Surface * dst, int x1, int y1, int x2, int y2,
308 SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
311 const SDL_PixelFormat *fmt = dst->format;
312 unsigned r, g, b, a, inva;
314 if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
315 r = DRAW_MUL(_r, _a);
316 g = DRAW_MUL(_g, _a);
317 b = DRAW_MUL(_b, _a);
329 case SDL_BLENDMODE_BLEND:
330 HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end);
332 case SDL_BLENDMODE_ADD:
333 HLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end);
335 case SDL_BLENDMODE_MOD:
336 HLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
339 HLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
342 } else if (x1 == x2) {
344 case SDL_BLENDMODE_BLEND:
345 VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end);
347 case SDL_BLENDMODE_ADD:
348 VLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end);
350 case SDL_BLENDMODE_MOD:
351 VLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
354 VLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
357 } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
359 case SDL_BLENDMODE_BLEND:
360 DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end);
362 case SDL_BLENDMODE_ADD:
363 DLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end);
365 case SDL_BLENDMODE_MOD:
366 DLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
369 DLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
374 case SDL_BLENDMODE_BLEND:
375 AALINE(x1, y1, x2, y2,
376 DRAW_SETPIXELXY4_BLEND_RGB, DRAW_SETPIXELXY4_BLEND_RGB,
379 case SDL_BLENDMODE_ADD:
380 AALINE(x1, y1, x2, y2,
381 DRAW_SETPIXELXY4_ADD_RGB, DRAW_SETPIXELXY4_ADD_RGB,
384 case SDL_BLENDMODE_MOD:
385 AALINE(x1, y1, x2, y2,
386 DRAW_SETPIXELXY4_MOD_RGB, DRAW_SETPIXELXY4_MOD_RGB,
390 AALINE(x1, y1, x2, y2,
391 DRAW_SETPIXELXY4_RGB, DRAW_SETPIXELXY4_BLEND_RGB,
399 SDL_BlendLine_RGBA4(SDL_Surface * dst, int x1, int y1, int x2, int y2,
400 SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
403 const SDL_PixelFormat *fmt = dst->format;
404 unsigned r, g, b, a, inva;
406 if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
407 r = DRAW_MUL(_r, _a);
408 g = DRAW_MUL(_g, _a);
409 b = DRAW_MUL(_b, _a);
421 case SDL_BLENDMODE_BLEND:
422 HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end);
424 case SDL_BLENDMODE_ADD:
425 HLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end);
427 case SDL_BLENDMODE_MOD:
428 HLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
431 HLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
434 } else if (x1 == x2) {
436 case SDL_BLENDMODE_BLEND:
437 VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end);
439 case SDL_BLENDMODE_ADD:
440 VLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end);
442 case SDL_BLENDMODE_MOD:
443 VLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
446 VLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
449 } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
451 case SDL_BLENDMODE_BLEND:
452 DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end);
454 case SDL_BLENDMODE_ADD:
455 DLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end);
457 case SDL_BLENDMODE_MOD:
458 DLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
461 DLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
466 case SDL_BLENDMODE_BLEND:
467 AALINE(x1, y1, x2, y2,
468 DRAW_SETPIXELXY4_BLEND_RGBA, DRAW_SETPIXELXY4_BLEND_RGBA,
471 case SDL_BLENDMODE_ADD:
472 AALINE(x1, y1, x2, y2,
473 DRAW_SETPIXELXY4_ADD_RGBA, DRAW_SETPIXELXY4_ADD_RGBA,
476 case SDL_BLENDMODE_MOD:
477 AALINE(x1, y1, x2, y2,
478 DRAW_SETPIXELXY4_MOD_RGBA, DRAW_SETPIXELXY4_MOD_RGBA,
482 AALINE(x1, y1, x2, y2,
483 DRAW_SETPIXELXY4_RGBA, DRAW_SETPIXELXY4_BLEND_RGBA,
491 SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
492 SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
495 const SDL_PixelFormat *fmt = dst->format;
496 unsigned r, g, b, a, inva;
498 if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
499 r = DRAW_MUL(_r, _a);
500 g = DRAW_MUL(_g, _a);
501 b = DRAW_MUL(_b, _a);
513 case SDL_BLENDMODE_BLEND:
514 HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end);
516 case SDL_BLENDMODE_ADD:
517 HLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end);
519 case SDL_BLENDMODE_MOD:
520 HLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
523 HLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
526 } else if (x1 == x2) {
528 case SDL_BLENDMODE_BLEND:
529 VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end);
531 case SDL_BLENDMODE_ADD:
532 VLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end);
534 case SDL_BLENDMODE_MOD:
535 VLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
538 VLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
541 } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
543 case SDL_BLENDMODE_BLEND:
544 DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end);
546 case SDL_BLENDMODE_ADD:
547 DLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end);
549 case SDL_BLENDMODE_MOD:
550 DLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
553 DLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
558 case SDL_BLENDMODE_BLEND:
559 AALINE(x1, y1, x2, y2,
560 DRAW_SETPIXELXY_BLEND_RGB888, DRAW_SETPIXELXY_BLEND_RGB888,
563 case SDL_BLENDMODE_ADD:
564 AALINE(x1, y1, x2, y2,
565 DRAW_SETPIXELXY_ADD_RGB888, DRAW_SETPIXELXY_ADD_RGB888,
568 case SDL_BLENDMODE_MOD:
569 AALINE(x1, y1, x2, y2,
570 DRAW_SETPIXELXY_MOD_RGB888, DRAW_SETPIXELXY_MOD_RGB888,
574 AALINE(x1, y1, x2, y2,
575 DRAW_SETPIXELXY_RGB888, DRAW_SETPIXELXY_BLEND_RGB888,
583 SDL_BlendLine_ARGB8888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
584 SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a,
587 const SDL_PixelFormat *fmt = dst->format;
588 unsigned r, g, b, a, inva;
590 if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
591 r = DRAW_MUL(_r, _a);
592 g = DRAW_MUL(_g, _a);
593 b = DRAW_MUL(_b, _a);
605 case SDL_BLENDMODE_BLEND:
606 HLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end);
608 case SDL_BLENDMODE_ADD:
609 HLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end);
611 case SDL_BLENDMODE_MOD:
612 HLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end);
615 HLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
618 } else if (x1 == x2) {
620 case SDL_BLENDMODE_BLEND:
621 VLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end);
623 case SDL_BLENDMODE_ADD:
624 VLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end);
626 case SDL_BLENDMODE_MOD:
627 VLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end);
630 VLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
633 } else if (ABS(x1 - x2) == ABS(y1 - y2)) {
635 case SDL_BLENDMODE_BLEND:
636 DLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end);
638 case SDL_BLENDMODE_ADD:
639 DLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end);
641 case SDL_BLENDMODE_MOD:
642 DLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end);
645 DLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
650 case SDL_BLENDMODE_BLEND:
651 AALINE(x1, y1, x2, y2,
652 DRAW_SETPIXELXY_BLEND_ARGB8888, DRAW_SETPIXELXY_BLEND_ARGB8888,
655 case SDL_BLENDMODE_ADD:
656 AALINE(x1, y1, x2, y2,
657 DRAW_SETPIXELXY_ADD_ARGB8888, DRAW_SETPIXELXY_ADD_ARGB8888,
660 case SDL_BLENDMODE_MOD:
661 AALINE(x1, y1, x2, y2,
662 DRAW_SETPIXELXY_MOD_ARGB8888, DRAW_SETPIXELXY_MOD_ARGB8888,
666 AALINE(x1, y1, x2, y2,
667 DRAW_SETPIXELXY_ARGB8888, DRAW_SETPIXELXY_BLEND_ARGB8888,
674 typedef void (*BlendLineFunc) (SDL_Surface * dst,
675 int x1, int y1, int x2, int y2,
676 SDL_BlendMode blendMode,
677 Uint8 r, Uint8 g, Uint8 b, Uint8 a,
681 SDL_CalculateBlendLineFunc(const SDL_PixelFormat * fmt)
683 switch (fmt->BytesPerPixel) {
685 if (fmt->Rmask == 0x7C00) {
686 return SDL_BlendLine_RGB555;
687 } else if (fmt->Rmask == 0xF800) {
688 return SDL_BlendLine_RGB565;
690 return SDL_BlendLine_RGB2;
694 if (fmt->Rmask == 0x00FF0000) {
696 return SDL_BlendLine_ARGB8888;
698 return SDL_BlendLine_RGB888;
702 return SDL_BlendLine_RGBA4;
704 return SDL_BlendLine_RGB4;
712 SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2,
713 SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
718 SDL_SetError("SDL_BlendLine(): Passed NULL destination surface");
722 func = SDL_CalculateBlendLineFunc(dst->format);
724 SDL_SetError("SDL_BlendLine(): Unsupported surface format");
728 /* Perform clipping */
729 /* FIXME: We don't actually want to clip, as it may change line slope */
730 if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
734 func(dst, x1, y1, x2, y2, blendMode, r, g, b, a, SDL_TRUE);
739 SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count,
740 SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
749 SDL_SetError("SDL_BlendLines(): Passed NULL destination surface");
753 func = SDL_CalculateBlendLineFunc(dst->format);
755 SDL_SetError("SDL_BlendLines(): Unsupported surface format");
759 for (i = 1; i < count; ++i) {
765 /* Perform clipping */
766 /* FIXME: We don't actually want to clip, as it may change line slope */
767 if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
771 /* Draw the end if it was clipped */
772 draw_end = (x2 != points[i].x || y2 != points[i].y);
774 func(dst, x1, y1, x2, y2, blendMode, r, g, b, a, draw_end);
776 if (points[0].x != points[count-1].x || points[0].y != points[count-1].y) {
777 SDL_BlendPoint(dst, points[count-1].x, points[count-1].y,
778 blendMode, r, g, b, a);
783 #endif /* !SDL_RENDER_DISABLED */
785 /* vi: set ts=4 sw=4 expandtab: */