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

Unified Diff: tests/WritePixelsTest.cpp

Issue 210013003: Manual memset to work around bogus compiler warning bug. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 6 years, 9 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: tests/WritePixelsTest.cpp
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index 7adcf0295dfd0c2a81f44001524d70790bfd7427..fc0fe37d6c4424d29ff963ae43f0182f7a2cae40 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);
}
« 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