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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp

Issue 2761193003: PNG: Use frame width when applying color xform (Closed)
Patch Set: Created 3 years, 9 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: third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp
index cb37d138bd29caa3860fdbdb00875b763aa4a2d3..9364c72a79906194d9df742db7e093d71589afd8 100644
--- a/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -367,7 +367,7 @@ void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer,
// Write the decoded row pixels to the frame buffer. The repetitive
// form of the row write loops is for speed.
ImageFrame::PixelData* const dstRow = buffer.getAddr(frameRect.x(), y);
- int width = frameRect.width();
+ const int width = frameRect.width();
png_bytep srcPtr = row;
if (hasAlpha) {
@@ -384,7 +384,7 @@ void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer,
if (SkColorSpaceXform* xform = colorTransform()) {
SkColorSpaceXform::ColorFormat colorFormat =
SkColorSpaceXform::kRGBA_8888_ColorFormat;
- xform->apply(colorFormat, dstRow, colorFormat, srcPtr, size().width(),
+ xform->apply(colorFormat, dstRow, colorFormat, srcPtr, width,
kUnpremul_SkAlphaType);
srcPtr = png_bytep(dstRow);
}
@@ -443,7 +443,7 @@ void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer,
// RGBA (and not RGB).
if (SkColorSpaceXform* xform = colorTransform()) {
xform->apply(xformColorFormat(), dstRow, xformColorFormat(), dstRow,
- size().width(), kOpaque_SkAlphaType);
+ width, kOpaque_SkAlphaType);
}
}
« 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