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

Unified Diff: utility/bmpblk_utility.cc

Issue 6533012: Write images to the bmpblock in the order they appear in the yaml. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/bitmaps/case_order2.yaml ('k') | utility/include/bmpblk_utility.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utility/bmpblk_utility.cc
diff --git a/utility/bmpblk_utility.cc b/utility/bmpblk_utility.cc
index 9f912d0b0a0b6ae1af239a0e6438013551ddbf77..1d65bd593555b13a25c411d3b6611396a6f1c040 100644
--- a/utility/bmpblk_utility.cc
+++ b/utility/bmpblk_utility.cc
@@ -188,6 +188,7 @@ void BmpBlockUtil::parse_images(yaml_parser_t *parser) {
error("Syntax error in parsing images.\n");
}
image_filename = (char*)event.data.scalar.value;
+ config_.image_names.push_back(image_name);
config_.images_map[image_name] = ImageConfig();
config_.images_map[image_name].filename = image_filename;
break;
@@ -443,11 +444,12 @@ void BmpBlockUtil::pack_bmpblock() {
/* Compute the ImageInfo offsets from start of BMPBLOCK. */
uint32_t current_offset = sizeof(BmpBlockHeader) +
sizeof(ScreenLayout) * config_.screens_map.size();
- for (StrImageConfigMap::iterator it = config_.images_map.begin();
- it != config_.images_map.end();
- ++it) {
- it->second.offset = current_offset;
- current_offset += sizeof(ImageInfo) + it->second.data.compressed_size;
+ for (unsigned int i = 0; i < config_.image_names.size(); ++i) {
+ string image_name = config_.image_names[i];
+ ImageConfig &img = config_.images_map[image_name];
+ img.offset = current_offset;
+ current_offset += sizeof(ImageInfo) +
+ config_.images_map[image_name].data.compressed_size;
/* Make it 4-byte aligned. */
if ((current_offset & 3) > 0) {
current_offset = (current_offset & ~3) + 4;
« no previous file with comments | « tests/bitmaps/case_order2.yaml ('k') | utility/include/bmpblk_utility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698