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

Unified Diff: Source/core/platform/graphics/filters/FEBlend.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/filters/FEBlend.cpp
diff --git a/Source/core/platform/graphics/filters/FEBlend.cpp b/Source/core/platform/graphics/filters/FEBlend.cpp
index 42e2bc6de0be944df374db6c0297094626741457..aa9f6f7124095a8bb6852946fdb85dad9e25e027 100644
--- a/Source/core/platform/graphics/filters/FEBlend.cpp
+++ b/Source/core/platform/graphics/filters/FEBlend.cpp
@@ -33,7 +33,8 @@
#include "core/platform/text/TextStream.h"
#include "core/rendering/RenderTreeAsText.h"
-#include <wtf/Uint8ClampedArray.h>
+#include "wtf/MathExtras.h"
+#include "wtf/Uint8ClampedArray.h"
#include "SkBitmapSource.h"
#include "SkBlendImageFilter.h"
@@ -68,13 +69,7 @@ bool FEBlend::setBlendMode(BlendModeType mode)
return true;
}
-static inline unsigned char fastDivideBy255(uint16_t value)
-{
- // This is an approximate algorithm for division by 255, but it gives accurate results for 16bit values.
- uint16_t quotient = value >> 8;
- uint16_t remainder = value - (quotient * 255) + 1;
- return quotient + (remainder >> 8);
-}
+using WTF::fastDivideBy255;
inline unsigned char feBlendNormal(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char)
{

Powered by Google App Engine
This is Rietveld 408576698