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

Unified Diff: Source/core/platform/graphics/Color.cpp

Issue 15466004: Make image decoders faster by refactoring hot loops that fills the lines of ImageFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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: Source/core/platform/graphics/Color.cpp
diff --git a/Source/core/platform/graphics/Color.cpp b/Source/core/platform/graphics/Color.cpp
index c6bdeb25cdf5afa5f9bd920d10fa0de997b963a3..1f65ac7f30572707a0330170328e9a6445737183 100644
--- a/Source/core/platform/graphics/Color.cpp
+++ b/Source/core/platform/graphics/Color.cpp
@@ -27,11 +27,11 @@
#include "core/platform/graphics/Color.h"
#include "core/platform/HashTools.h"
-#include <wtf/Assertions.h>
-#include <wtf/DecimalNumber.h>
-#include <wtf/HexNumber.h>
-#include <wtf/MathExtras.h>
-#include <wtf/text/StringBuilder.h>
+#include "wtf/Assertions.h"
+#include "wtf/DecimalNumber.h"
+#include "wtf/HexNumber.h"
+#include "wtf/MathExtras.h"
+#include "wtf/text/StringBuilder.h"
using namespace std;
@@ -434,9 +434,9 @@ RGBA32 premultipliedARGBFromColor(const Color& color)
unsigned alpha = color.alpha();
if (alpha < 255) {
pixelColor = Color::createUnchecked(
- (color.red() * alpha + 254) / 255,
- (color.green() * alpha + 254) / 255,
- (color.blue() * alpha + 254) / 255,
+ WTF::fastDivideBy255(color.red() * alpha + 254),
+ WTF::fastDivideBy255(color.green() * alpha + 254),
+ WTF::fastDivideBy255(color.blue() * alpha + 254),
Noel Gordon 2013/05/25 04:40:56 The Color.cpp change should really be a separate p
alpha).rgb();
} else
pixelColor = color.rgb();

Powered by Google App Engine
This is Rietveld 408576698