From be463bba2ea4c33bac9267102d8865ac2ca6a391 Mon Sep 17 00:00:00 2001 From: herb Date: Thu, 12 May 2016 10:36:24 -0700 Subject: Fix bad pixel address calculation. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974053002 Review-Url: https://codereview.chromium.org/1974053002 --- src/core/SkLinearBitmapPipeline_sample.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/SkLinearBitmapPipeline_sample.h') 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(row); + const uint32_t* src = static_cast(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(row); + const uint32_t* src = static_cast(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(row); + const uint8_t* src = static_cast(row) + index; Sk4f pixel = fColorTable[*src]; return pixel; } -- cgit v1.2.3