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

Side by Side Diff: cc/test/skia_common.cc

Issue 1869753003: Replace many skia::RefPtr with sk_sp<> in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698