Index: tests/SurfaceTest.cpp |
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp |
index bcfd0a9387f0f83a5fd835844b7906745884c10c..fdcf2efa391c2c382a487055e941aa8b52583491 100644 |
--- a/tests/SurfaceTest.cpp |
+++ b/tests/SurfaceTest.cpp |
@@ -751,6 +751,18 @@ DEF_TEST(surface_rowbytes, reporter) { |
REPORTER_ASSERT(reporter, nullptr == s); |
} |
+DEF_TEST(surface_raster_zeroinitialized, reporter) { |
+ sk_sp<SkSurface> s(SkSurface::MakeRasterN32Premul(100, 100)); |
+ SkPixmap pixmap; |
+ REPORTER_ASSERT(reporter, s->peekPixels(&pixmap)); |
+ |
+ for (int i = 0; i < pixmap.info().width(); ++i) { |
+ for (int j = 0; j < pixmap.info().height(); ++j) { |
+ REPORTER_ASSERT(reporter, *pixmap.addr32(i, j) == 0); |
+ } |
+ } |
+} |
+ |
#if SK_SUPPORT_GPU |
static sk_sp<SkSurface> create_gpu_surface_backend_texture( |
GrContext* context, int sampleCnt, uint32_t color, GrBackendObject* outTexture) { |