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

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

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: 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
« no previous file with comments | « cc/test/skia_common.h ('k') | cc/test/surface_aggregator_test_helpers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24 matching lines...) Expand all
35 SkCanvas canvas(bitmap); 35 SkCanvas canvas(bitmap);
36 canvas.clipRect(gfx::RectToSkRect(layer_rect)); 36 canvas.clipRect(gfx::RectToSkRect(layer_rect));
37 list->Raster(&canvas, NULL, gfx::Rect(), 1.0f); 37 list->Raster(&canvas, NULL, gfx::Rect(), 1.0f);
38 } 38 }
39 39
40 bool AreDisplayListDrawingResultsSame(const gfx::Rect& layer_rect, 40 bool AreDisplayListDrawingResultsSame(const gfx::Rect& layer_rect,
41 scoped_refptr<DisplayItemList> list_a, 41 scoped_refptr<DisplayItemList> list_a,
42 scoped_refptr<DisplayItemList> list_b) { 42 scoped_refptr<DisplayItemList> list_b) {
43 const size_t pixel_size = 4 * layer_rect.size().GetArea(); 43 const size_t pixel_size = 4 * layer_rect.size().GetArea();
44 44
45 scoped_ptr<unsigned char[]> pixels_a(new unsigned char[pixel_size]); 45 std::unique_ptr<unsigned char[]> pixels_a(new unsigned char[pixel_size]);
46 scoped_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 skia::RefPtr<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 skia::AdoptRef(
59 SkImage::NewFromGenerator(new TestImageGenerator(info))); 59 SkImage::NewFromGenerator(new TestImageGenerator(info)));
60 } 60 }
61 61
62 } // namespace cc 62 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/skia_common.h ('k') | cc/test/surface_aggregator_test_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698