diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-24 15:52:33 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-24 15:52:33 +0000 |
commit | 61c9b835d13e1d4225f3a04f045658f62c702294 (patch) | |
tree | 1767631ebade7b092fc8faa810c7a58e1cb974c2 /tests/WritePixelsTest.cpp | |
parent | dc9f69fed847e54af8c53c43bd4a6b992fc752c4 (diff) |
Manual memset to work around bogus compiler warning bug.
BUG=skia:2215
R=bsalomon@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/210013003
git-svn-id: http://skia.googlecode.com/svn/trunk@13908 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/WritePixelsTest.cpp')
-rw-r--r-- | tests/WritePixelsTest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp index 7adcf0295d..fc0fe37d6c 100644 --- a/tests/WritePixelsTest.cpp +++ b/tests/WritePixelsTest.cpp @@ -329,7 +329,10 @@ static SkBaseDevice* createDevice(const CanvasConfig& c, GrContext* grCtx) { // if rowBytes isn't tight then set the padding to a known value if (rowBytes) { SkAutoLockPixels alp(bmp); - memset(bmp.getPixels(), DEV_PAD, bmp.getSafeSize()); + // We'd just use memset here but GCC 4.8.1 throws up a bogus warning when we do. + for (size_t i = 0; i < bmp.getSafeSize(); i++) { + ((uint8_t*)bmp.getPixels())[i] = DEV_PAD; + } } return new SkBitmapDevice(bmp); } |