Changeset 0576df9 in mainline for uspace/app/launcher
- Timestamp:
- 2020-11-14T21:28:35Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63b35c7
- Parents:
- 38f5598
- Location:
- uspace/app/launcher
- Files:
-
- 2 edited
-
launcher.c (modified) (6 diffs)
-
meson.build (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/launcher/launcher.c
r38f5598 r0576df9 36 36 #include <errno.h> 37 37 #include <gfx/coord.h> 38 #include <gfximage/tga.h> 38 39 #include <stdbool.h> 39 40 #include <stdio.h> … … 42 43 #include <str_error.h> 43 44 #include <task.h> 44 45 #include <draw/surface.h>46 #include <draw/source.h>47 #include <draw/drawctx.h>48 #include <draw/codec.h>49 50 45 #include <ui/fixed.h> 51 46 #include <ui/image.h> … … 157 152 gfx_bitmap_params_t logo_params; 158 153 gfx_bitmap_t *logo_bmp; 159 gfx_bitmap_alloc_t alloc;160 154 gfx_context_t *gc; 161 surface_coord_t w, h;162 155 gfx_rect_t logo_rect; 163 156 gfx_rect_t rect; 157 gfx_coord2_t off; 164 158 errno_t rc; 165 159 … … 182 176 } 183 177 184 surface_t *logo = decode_tga((void *) helenos_tga, helenos_tga_size,185 SURFACE_FLAG_SHARED);186 if (!logo) {187 printf("Unable to decode logo.\n");188 return 1;189 }190 191 178 rc = ui_create(display_spec, &ui); 192 179 if (rc != EOK) { … … 217 204 gc = ui_window_get_gc(window); 218 205 219 surface_get_resolution(logo, &w, &h); 206 rc = decode_tga(gc, (void *) helenos_tga, helenos_tga_size, 207 &logo_bmp, &logo_rect); 208 if (rc != EOK) { 209 printf("Unable to decode logo.\n"); 210 return 1; 211 } 212 220 213 gfx_bitmap_params_init(&logo_params); 221 logo_params.rect.p1.x = w; 222 logo_params.rect.p1.y = h; 223 logo_rect = logo_params.rect; 224 225 alloc.pitch = sizeof(uint32_t) * w; 226 alloc.off0 = 0; 227 alloc.pixels = surface_direct_access(logo); 228 229 rc = gfx_bitmap_create(gc, &logo_params, &alloc, &logo_bmp); 230 if (rc != EOK) { 231 printf("Error creating bitmap.\n"); 232 return 1; 233 } 214 logo_params.rect = logo_rect; 234 215 235 216 rc = ui_fixed_create(&launcher.fixed); … … 245 226 } 246 227 247 rect.p0.x = 5; 248 rect.p0.y = 32; 249 rect.p1.x = 5 + w; 250 rect.p1.y = 32 + h; 228 off.x = 5; 229 off.y = 32; 230 gfx_rect_translate(&off, &logo_rect, &rect); 251 231 ui_image_set_rect(launcher.image, &rect); 252 232 -
uspace/app/launcher/meson.build
r38f5598 r0576df9 27 27 # 28 28 29 deps = [ ' draw', 'ui' ]29 deps = [ 'gfximage', 'ui' ] 30 30 31 31 _images = files('gfx/helenos.tga')
Note:
See TracChangeset
for help on using the changeset viewer.
