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

Unified Diff: src/core/SkLinearBitmapPipeline_sample.h

Issue 1974053002: Fix bad pixel address calculation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« 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: src/core/SkLinearBitmapPipeline_sample.h
diff --git a/src/core/SkLinearBitmapPipeline_sample.h b/src/core/SkLinearBitmapPipeline_sample.h
index 8171b855a40905f50a40da4751ad9f2c1c94ad45..566ed84ffe8d2ac85f0067b717e5c62fec573481 100644
--- a/src/core/SkLinearBitmapPipeline_sample.h
+++ b/src/core/SkLinearBitmapPipeline_sample.h
@@ -621,7 +621,7 @@ public:
, fWidth{srcPixmap.rowBytesAsPixels()} { }
Sk4f getPixelFromRow(const void* row, int index) {
- const uint32_t* src = static_cast<const uint32_t*>(row);
+ const uint32_t* src = static_cast<const uint32_t*>(row) + index;
return colorProfile == kSRGB_SkColorProfileType
? Sk4f_fromS32(*src)
: Sk4f_fromL32(*src);
@@ -649,7 +649,7 @@ public:
, fWidth{srcPixmap.rowBytesAsPixels()} { }
Sk4f getPixelFromRow(const void* row, int index) {
- const uint32_t* src = static_cast<const uint32_t*>(row);
+ const uint32_t* src = static_cast<const uint32_t*>(row) + index;
Sk4f pixel = colorProfile == kSRGB_SkColorProfileType
? Sk4f_fromS32(*src)
: Sk4f_fromL32(*src);
@@ -695,7 +695,7 @@ public:
}
Sk4f getPixelFromRow(const void* row, int index) {
- const uint8_t* src = static_cast<const uint8_t*>(row);
+ const uint8_t* src = static_cast<const uint8_t*>(row) + index;
Sk4f pixel = fColorTable[*src];
return pixel;
}
« 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