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

Unified Diff: third_party/WebKit/Source/devtools/scripts/assemble_spritesheet.js

Issue 2671413004: DevTools: introduce spritesheet assembler. (Closed)
Patch Set: rebaseline tests Created 3 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
Index: third_party/WebKit/Source/devtools/scripts/assemble_spritesheet.js
diff --git a/third_party/WebKit/Source/devtools/scripts/assemble_spritesheet.js b/third_party/WebKit/Source/devtools/scripts/assemble_spritesheet.js
new file mode 100755
index 0000000000000000000000000000000000000000..516217df4cee9c6c2d12bd8477e8dbdce14496f7
--- /dev/null
+++ b/third_party/WebKit/Source/devtools/scripts/assemble_spritesheet.js
@@ -0,0 +1,26 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var exec = require('child_process').exec;
+var writeSVGAndDescriptors = require('./spritesheet_assembler');
+
+// Write new spritesheet.
+var frontendFolder = path.join(__dirname, '..', 'front_end');
+var iconsFolder = path.join(frontendFolder, 'Images', 'icons');
+var outputSVGPath = path.join(frontendFolder, 'Images', 'src', 'icons_spritesheet.svg');
+var outputJSPath = path.join(frontendFolder, 'ui', 'GeneratedIconDescriptors.js');
+writeSVGAndDescriptors(iconsFolder, 1, outputSVGPath, outputJSPath);
+
+// Convert SVG to PNG.
+var convertScript = 'convert_svg_images_to_png.py';
+var convertScriptPath = path.join(__dirname, convertScript);
+var cmd = 'python ' + convertScriptPath;
+console.log('Running ' + convertScript);
+exec(cmd, function(error, stdout, stderr) {
+ if (error) {
+ console.error(stderr);
+ return;
+ }
+ console.log(stdout);
+ console.log('DONE. Don\'t forget to optimize your images!');
+});

Powered by Google App Engine
This is Rietveld 408576698