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
This commit is contained in:
commit-bot@chromium.org 2014-03-24 15:52:33 +00:00
parent dc9f69fed8
commit 61c9b835d1

View File

@ -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);
}