Bug 1300543 - IconRequestExecutor: Resize image before extracting color. r?ahunt draft
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 05 Sep 2016 15:25:25 +0200
changeset 410108 117eba0ba79c828027ece1770db700e21513bffa
parent 410107 9ef61a2343f9e737248bc00b7d92f073a98aa010
child 410109 3f3ede030796ec71d17a03bd2a7c415d2c1ebac6
push id28648
push users.kaspari@gmail.com
push dateTue, 06 Sep 2016 08:42:47 +0000
reviewersahunt
bugs1300543
milestone51.0a1
Bug 1300543 - IconRequestExecutor: Resize image before extracting color. r?ahunt Running the color extraction algorithm on a smaller image will be much faster. MozReview-Commit-ID: A42rzuQ3FDQ
mobile/android/base/java/org/mozilla/gecko/icons/IconRequestExecutor.java
--- a/mobile/android/base/java/org/mozilla/gecko/icons/IconRequestExecutor.java
+++ b/mobile/android/base/java/org/mozilla/gecko/icons/IconRequestExecutor.java
@@ -101,25 +101,25 @@ import java.util.concurrent.TimeUnit;
             // Download the icon from the web.
             new IconDownloader()
     );
 
     /**
      * Ordered list of processors that run after an icon has been loaded.
      */
     private static final List<Processor> PROCESSORS = Arrays.asList(
-            // Extract the dominant color from the icon
-            new ColorProcessor(),
-
             // Store the icon (and mapping) in the disk cache if needed
             new DiskProcessor(),
 
             // Resize the icon to match the target size (if possible)
             new ResizingProcessor(),
 
+            // Extract the dominant color from the icon
+            new ColorProcessor(),
+
             // Store the icon in the memory cache
             new MemoryProcessor()
     );
 
     private static final ExecutorService EXECUTOR;
     static {
         final ThreadFactory factory = new ThreadFactory() {
             @Override