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

Side by Side Diff: lib/text/text.c

Issue 1777783003: [display] Refactor to avoid implicit framebuffer allocation. (Closed) Base URL: https://github.com/littlekernel/lk.git@master
Patch Set: fix stride confusion Created 4 years, 9 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 | « lib/gfxconsole/gfxconsole.c ('k') | platform/armemu/display.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) 2008-2010 Travis Geiselbrecht 2 * Copyright (c) 2008-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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 list_add_head(&text_list, &line->node); 69 list_add_head(&text_list, &line->node);
70 70
71 text_update(); 71 text_update();
72 } 72 }
73 73
74 /** 74 /**
75 * @brief Refresh the display 75 * @brief Refresh the display
76 */ 76 */
77 void text_update(void) 77 void text_update(void)
78 { 78 {
79 struct display_info info; 79 struct display_framebuffer fb;
80 if (display_get_info(&info) < 0) 80 if (display_get_framebuffer(&fb) < 0)
81 return; 81 return;
82 82
83 /* get the display's surface */ 83 /* get the display's surface */
84 gfx_surface *surface = gfx_create_surface_from_display(&info); 84 gfx_surface *surface = gfx_create_surface_from_display(&fb);
85 85
86 struct text_line *line; 86 struct text_line *line;
87 list_for_every_entry(&text_list, line, struct text_line, node) { 87 list_for_every_entry(&text_list, line, struct text_line, node) {
88 const char *c; 88 const char *c;
89 int x = line->x; 89 int x = line->x;
90 for (c = line->str; *c; c++) { 90 for (c = line->str; *c; c++) {
91 font_draw_char(surface, *c, x, line->y, TEXT_COLOR); 91 font_draw_char(surface, *c, x, line->y, TEXT_COLOR);
92 x += FONT_X; 92 x += FONT_X;
93 } 93 }
94 } 94 }
95 95
96 gfx_flush(surface); 96 gfx_flush(surface);
97 97
98 gfx_surface_destroy(surface); 98 gfx_surface_destroy(surface);
99 } 99 }
100 100
OLDNEW
« no previous file with comments | « lib/gfxconsole/gfxconsole.c ('k') | platform/armemu/display.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698