Chromium Code Reviews| Index: cc/test/skia_common.cc |
| diff --git a/cc/test/skia_common.cc b/cc/test/skia_common.cc |
| index 22d546cc75573d47bbe2a92b43a9194f7365eb2d..dcc0c942413d600f3a4ab0877c536ca471ba3a0d 100644 |
| --- a/cc/test/skia_common.cc |
| +++ b/cc/test/skia_common.cc |
| @@ -35,6 +35,21 @@ void DrawDisplayList(unsigned char* buffer, |
| list->Raster(&canvas, NULL, gfx::Rect(), 1.0f); |
| } |
| +bool CompareDisplayListDrawingResults(const gfx::Rect& layer_rect, |
| + scoped_refptr<DisplayItemList> list_a, |
| + scoped_refptr<DisplayItemList> list_b) { |
| + const size_t pixel_size = 4 * layer_rect.size().GetArea(); |
| + |
| + scoped_ptr<unsigned char[]> pixels_a(new unsigned char[pixel_size]); |
| + scoped_ptr<unsigned char[]> pixels_b(new unsigned char[pixel_size]); |
| + memset(pixels_a.get(), 0, pixel_size); |
| + memset(pixels_b.get(), 0, pixel_size); |
| + DrawDisplayList(pixels_a.get(), layer_rect, list_a); |
| + DrawDisplayList(pixels_b.get(), layer_rect, list_b); |
| + |
| + return 0 == memcmp(pixels_a.get(), pixels_b.get(), pixel_size); |
|
vmpstr
2015/12/10 01:12:19
return !memcmp(...);
David Trainor- moved to gerrit
2015/12/10 17:10:10
Done.
|
| +} |
| + |
| skia::RefPtr<SkImage> CreateDiscardableImage(const gfx::Size& size) { |
| const SkImageInfo info = |
| SkImageInfo::MakeN32Premul(size.width(), size.height()); |