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

Unified Diff: Source/core/platform/image-decoders/ImageDecoder.h

Issue 17906002: Fix mess in ImageDecoder::setRGB* methods after r153004 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/image-decoders/ImageDecoder.h
diff --git a/Source/core/platform/image-decoders/ImageDecoder.h b/Source/core/platform/image-decoders/ImageDecoder.h
index 24555cd522e6c34b7ecfcc9f9deef57f112f2393..d58cb9e7025b78897e7e138294272b3201b2da9e 100644
--- a/Source/core/platform/image-decoders/ImageDecoder.h
+++ b/Source/core/platform/image-decoders/ImageDecoder.h
@@ -190,13 +190,11 @@ namespace WebCore {
inline void setRGBAPremultiply(PixelData* dest, unsigned r, unsigned g, unsigned b, unsigned a)
{
- ASSERT(m_premultiplyAlpha);
-
- if (!a) {
- *dest = 0;
- return;
- }
if (a < 255) {
+ if (!a) {
+ *dest = 0;
+ return;
+ }
unsigned alphaMult = a * fixPointMult;
r = fixPointUnsignedMultiply(r, alphaMult);
g = fixPointUnsignedMultiply(g, alphaMult);
@@ -210,8 +208,6 @@ namespace WebCore {
inline void setRGBARaw(PixelData* dest, unsigned r, unsigned g, unsigned b, unsigned a)
{
- ASSERT(!m_premultiplyAlpha);
-
*dest = SkPackARGB32NoCheck(a, r, g, b);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698