OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/test/skia_common.h" | 5 #include "cc/test/skia_common.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "cc/playback/display_item_list.h" | 9 #include "cc/playback/display_item_list.h" |
10 #include "skia/ext/refptr.h" | 10 #include "skia/ext/refptr.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 std::unique_ptr<unsigned char[]> pixels_a(new unsigned char[pixel_size]); | 45 std::unique_ptr<unsigned char[]> pixels_a(new unsigned char[pixel_size]); |
46 std::unique_ptr<unsigned char[]> pixels_b(new unsigned char[pixel_size]); | 46 std::unique_ptr<unsigned char[]> pixels_b(new unsigned char[pixel_size]); |
47 memset(pixels_a.get(), 0, pixel_size); | 47 memset(pixels_a.get(), 0, pixel_size); |
48 memset(pixels_b.get(), 0, pixel_size); | 48 memset(pixels_b.get(), 0, pixel_size); |
49 DrawDisplayList(pixels_a.get(), layer_rect, list_a); | 49 DrawDisplayList(pixels_a.get(), layer_rect, list_a); |
50 DrawDisplayList(pixels_b.get(), layer_rect, list_b); | 50 DrawDisplayList(pixels_b.get(), layer_rect, list_b); |
51 | 51 |
52 return !memcmp(pixels_a.get(), pixels_b.get(), pixel_size); | 52 return !memcmp(pixels_a.get(), pixels_b.get(), pixel_size); |
53 } | 53 } |
54 | 54 |
55 skia::RefPtr<SkImage> CreateDiscardableImage(const gfx::Size& size) { | 55 sk_sp<SkImage> CreateDiscardableImage(const gfx::Size& size) { |
56 const SkImageInfo info = | 56 const SkImageInfo info = |
57 SkImageInfo::MakeN32Premul(size.width(), size.height()); | 57 SkImageInfo::MakeN32Premul(size.width(), size.height()); |
58 return skia::AdoptRef( | 58 return SkImage::MakeFromGenerator(new TestImageGenerator(info)); |
59 SkImage::NewFromGenerator(new TestImageGenerator(info))); | |
60 } | 59 } |
61 | 60 |
62 } // namespace cc | 61 } // namespace cc |
OLD | NEW |