aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar herb <herb@google.com>2016-05-12 10:36:24 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-12 10:36:24 -0700
commitbe463bba2ea4c33bac9267102d8865ac2ca6a391 (patch)
treeced602eca9bb3834643baf554da3a1c7ad7e7909
parent7bde8f813fd02fc7b93a659c9f36019d8502a026 (diff)
Fix bad pixel address calculation.
-rw-r--r--src/core/SkLinearBitmapPipeline_sample.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/SkLinearBitmapPipeline_sample.h b/src/core/SkLinearBitmapPipeline_sample.h
index 8171b855a4..566ed84ffe 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;
}