Changeset 3bacee1 in mainline for uspace/lib/draw
- Timestamp:
- 2018-04-12T16:27:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3cf22f9
- Parents:
- 76d0981d
- git-author:
- Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
- Location:
- uspace/lib/draw
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/draw/drawctx.c
r76d0981d r3bacee1 155 155 for (sysarg_t _x = x; _x < x + width; ++_x) { 156 156 if (context->shall_clip) { 157 clipped = _x < context->clip_x && _x >= context->clip_width 158 &&_y < context->clip_y && _y >= context->clip_height;157 clipped = _x < context->clip_x && _x >= context->clip_width && 158 _y < context->clip_y && _y >= context->clip_height; 159 159 } 160 160 -
uspace/lib/draw/font/bitmap_backend.c
r76d0981d r3bacee1 244 244 data->scale = false; 245 245 data->scale_ratio = 1.0; 246 } 247 else { 246 } else { 248 247 data->scale = true; 249 248 data->scale_ratio = ((double) points) / ((double) line_height); -
uspace/lib/draw/font/pcf.c
r76d0981d r3bacee1 113 113 if (format & PCF_FORMAT_MSBYTE_FIRST) { 114 114 return uint32_t_be2host(val); 115 } 116 else { 115 } else { 117 116 return uint32_t_le2host(val); 118 117 } … … 123 122 if (format & PCF_FORMAT_MSBYTE_FIRST) { 124 123 return uint16_t_be2host(val); 125 } 126 else { 124 } else { 127 125 return uint16_t_le2host(val); 128 126 } … … 201 199 pcf_compressed_metrics_t compressed_metrics; 202 200 records_read = fread(&compressed_metrics, 203 sizeof(pcf_compressed_metrics_t), 1, data->file);201 sizeof(pcf_compressed_metrics_t), 1, data->file); 204 202 if (records_read != 1) 205 203 return EINVAL; … … 216 214 compressed2int(compressed_metrics.character_descent); 217 215 metrics->character_attributes = 0; 218 } 219 else { 216 } else { 220 217 offset = table->offset + 2 * sizeof(uint32_t) + 221 218 glyph_id * sizeof(pcf_default_metrics_t); … … 227 224 pcf_default_metrics_t uncompressed_metrics; 228 225 records_read = fread(&uncompressed_metrics, 229 sizeof(pcf_default_metrics_t), 1, data->file);226 sizeof(pcf_default_metrics_t), 1, data->file); 230 227 if (records_read != 1) 231 228 return EINVAL; … … 281 278 282 279 offset = data->bitmap_table.offset + (2 * sizeof(uint32_t)) + 283 (data->glyph_count * sizeof(uint32_t)) + (4 * sizeof(uint32_t)) 284 +bitmap_offset;280 (data->glyph_count * sizeof(uint32_t)) + (4 * sizeof(uint32_t)) + 281 bitmap_offset; 285 282 286 283 if (fseek(data->file, offset, SEEK_SET) < 0) … … 314 311 size_t column_offset1 = word_index * word_size_bytes; 315 312 size_t byte_index_within_word = 316 313 (x % (word_size_bytes * 8)) / 8; 317 314 size_t column_offset2; 318 315 if (data->bitmap_table.format & PCF_FORMAT_MSBYTE_FIRST) { 319 316 column_offset2 = (word_size_bytes - 1) - byte_index_within_word; 320 } 321 else { 317 } else { 322 318 column_offset2 = byte_index_within_word; 323 319 } … … 326 322 if (data->bitmap_table.format & PCF_FORMAT_MSBIT_FIRST) { 327 323 set = (b >> (7 - (x % 8))) & 1; 328 } 329 else { 324 } else { 330 325 set = (b >> (x % 8)) & 1; 331 326 } … … 433 428 found_bitmap_table = true; 434 429 data->bitmap_table = toc_entry; 435 } 436 else if (toc_entry.type == PCF_TABLE_METRICS) { 430 } else if (toc_entry.type == PCF_TABLE_METRICS) { 437 431 if (found_metrics_table) 438 432 return EINVAL; 439 433 found_metrics_table = true; 440 434 data->metrics_table = toc_entry; 441 } 442 else if (toc_entry.type == PCF_TABLE_ENCODINGS) { 435 } else if (toc_entry.type == PCF_TABLE_ENCODINGS) { 443 436 if (found_encodings_table) 444 437 return EINVAL; 445 438 found_encodings_table = true; 446 439 data->encodings_table = toc_entry; 447 } 448 else if (toc_entry.type == PCF_TABLE_ACCELERATORS) { 440 } else if (toc_entry.type == PCF_TABLE_ACCELERATORS) { 449 441 if (found_accelerators_table) 450 442 return EINVAL; … … 516 508 data->metrics_table.format); 517 509 metrics_count = metrics_count_16; 518 } 519 else { 510 } else { 520 511 records_read = fread(&metrics_count, sizeof(uint32_t), 1, 521 512 data->file);
Note:
See TracChangeset
for help on using the changeset viewer.