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

Side by Side Diff: tests/ImageFilterTest.cpp

Issue 1341923003: Speculative fix for uninitialized bitmap mem in ImageFilterTest (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBitmapDevice.h" 9 #include "SkBitmapDevice.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 SkAutoTUnref<SkImageFilter> filter(SkImageSource::Create(image)); 1222 SkAutoTUnref<SkImageFilter> filter(SkImageSource::Create(image));
1223 1223
1224 SkAutoTUnref<SkData> data(SkValidatingSerializeFlattenable(filter)); 1224 SkAutoTUnref<SkData> data(SkValidatingSerializeFlattenable(filter));
1225 SkAutoTUnref<SkFlattenable> flattenable(SkValidatingDeserializeFlattenable( 1225 SkAutoTUnref<SkFlattenable> flattenable(SkValidatingDeserializeFlattenable(
1226 data->data(), data->size(), SkImageFilter::GetFlattenableType())); 1226 data->data(), data->size(), SkImageFilter::GetFlattenableType()));
1227 SkImageFilter* unflattenedFilter = static_cast<SkImageFilter*>(flattenable.g et()); 1227 SkImageFilter* unflattenedFilter = static_cast<SkImageFilter*>(flattenable.g et());
1228 REPORTER_ASSERT(reporter, unflattenedFilter); 1228 REPORTER_ASSERT(reporter, unflattenedFilter);
1229 1229
1230 SkBitmap bm; 1230 SkBitmap bm;
1231 bm.allocN32Pixels(10, 10); 1231 bm.allocN32Pixels(10, 10);
1232 bm.eraseColor(SK_ColorBLUE);
1232 SkPaint paint; 1233 SkPaint paint;
1233 paint.setColor(SK_ColorRED); 1234 paint.setColor(SK_ColorRED);
1234 paint.setImageFilter(unflattenedFilter); 1235 paint.setImageFilter(unflattenedFilter);
1235 1236
1236 SkCanvas canvas(bm); 1237 SkCanvas canvas(bm);
1237 canvas.drawRect(SkRect::MakeWH(10, 10), paint); 1238 canvas.drawRect(SkRect::MakeWH(10, 10), paint);
1238 REPORTER_ASSERT(reporter, *bm.getAddr32(0, 0) == SkPreMultiplyColor(SK_Color GREEN)); 1239 REPORTER_ASSERT(reporter, *bm.getAddr32(0, 0) == SkPreMultiplyColor(SK_Color GREEN));
1239 } 1240 }
1240 1241
1241 #if SK_SUPPORT_GPU 1242 #if SK_SUPPORT_GPU
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 SkSurface::kNo_Budgeted , 1306 SkSurface::kNo_Budgeted ,
1306 SkImageInfo::MakeN32Pre mul(1, 1), 1307 SkImageInfo::MakeN32Pre mul(1, 1),
1307 0, 1308 0,
1308 &props, 1309 &props,
1309 SkGpuDevice::kUninit_In itContents)); 1310 SkGpuDevice::kUninit_In itContents));
1310 SkImageFilter::Proxy proxy(device); 1311 SkImageFilter::Proxy proxy(device);
1311 1312
1312 test_negative_blur_sigma(&proxy, reporter); 1313 test_negative_blur_sigma(&proxy, reporter);
1313 } 1314 }
1314 #endif 1315 #endif
OLDNEW
« 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