Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: include/lib/gfx.h

Issue 1411033002: Add basic line drawing command (Closed) Base URL: https://github.com/travisg/lk.git@master
Patch Set: fixes Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lib/gfx/gfx.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 Travis Geiselbrecht 2 * Copyright (c) 2010 Travis Geiselbrecht
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining 4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files 5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction, 6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge, 7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software, 8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so, 9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions: 10 * subject to the following conditions:
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 // copy a rect from x,y with width x height to x2, y2 71 // copy a rect from x,y with width x height to x2, y2
72 void gfx_copyrect(gfx_surface *surface, uint x, uint y, uint width, uint height, uint x2, uint y2); 72 void gfx_copyrect(gfx_surface *surface, uint x, uint y, uint width, uint height, uint x2, uint y2);
73 73
74 // fill a rect within the surface with a color 74 // fill a rect within the surface with a color
75 void gfx_fillrect(gfx_surface *surface, uint x, uint y, uint width, uint height, uint color); 75 void gfx_fillrect(gfx_surface *surface, uint x, uint y, uint width, uint height, uint color);
76 76
77 // draw a pixel at x, y in the surface 77 // draw a pixel at x, y in the surface
78 void gfx_putpixel(gfx_surface *surface, uint x, uint y, uint color); 78 void gfx_putpixel(gfx_surface *surface, uint x, uint y, uint color);
79 79
80 // draw a single pixel line between x1,y1 and x2,y1
81 void gfx_line(gfx_surface *surface, uint x1, uint y1, uint x2, uint y2, uint col or);
82
80 // clear the entire surface with a color 83 // clear the entire surface with a color
81 static inline void gfx_clear(gfx_surface *surface, uint color) 84 static inline void gfx_clear(gfx_surface *surface, uint color)
82 { 85 {
83 surface->fillrect(surface, 0, 0, surface->width, surface->height, color) ; 86 surface->fillrect(surface, 0, 0, surface->width, surface->height, color) ;
84 87
85 if (surface->flush) 88 if (surface->flush)
86 surface->flush(0, surface->height-1); 89 surface->flush(0, surface->height-1);
87 } 90 }
88 91
89 // blend between two surfaces 92 // blend between two surfaces
(...skipping 12 matching lines...) Expand all
102 105
103 // free the surface 106 // free the surface
104 // optionally frees the buffer if the free bit is set 107 // optionally frees the buffer if the free bit is set
105 void gfx_surface_destroy(struct gfx_surface *surface); 108 void gfx_surface_destroy(struct gfx_surface *surface);
106 109
107 // utility routine to fill the display with a little moire pattern 110 // utility routine to fill the display with a little moire pattern
108 void gfx_draw_pattern(void); 111 void gfx_draw_pattern(void);
109 112
110 #endif 113 #endif
111 114
OLDNEW
« no previous file with comments | « no previous file | lib/gfx/gfx.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698