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

Side by Side Diff: cc/playback/display_item_list_unittest.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/playback/display_item_list.cc ('k') | cc/playback/drawing_display_item.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/playback/display_item_list.h" 5 #include "cc/playback/display_item_list.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/ptr_util.h"
11 #include "cc/output/filter_operation.h" 12 #include "cc/output/filter_operation.h"
12 #include "cc/output/filter_operations.h" 13 #include "cc/output/filter_operations.h"
13 #include "cc/playback/clip_display_item.h" 14 #include "cc/playback/clip_display_item.h"
14 #include "cc/playback/clip_path_display_item.h" 15 #include "cc/playback/clip_path_display_item.h"
15 #include "cc/playback/compositing_display_item.h" 16 #include "cc/playback/compositing_display_item.h"
16 #include "cc/playback/display_item_list_settings.h" 17 #include "cc/playback/display_item_list_settings.h"
17 #include "cc/playback/drawing_display_item.h" 18 #include "cc/playback/drawing_display_item.h"
18 #include "cc/playback/filter_display_item.h" 19 #include "cc/playback/filter_display_item.h"
19 #include "cc/playback/float_clip_display_item.h" 20 #include "cc/playback/float_clip_display_item.h"
20 #include "cc/playback/transform_display_item.h" 21 #include "cc/playback/transform_display_item.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 canvas->translate(offset.x(), offset.y()); 74 canvas->translate(offset.x(), offset.y());
74 canvas->drawRectCoords(3.f, 3.f, 7.f, 7.f, blue_paint); 75 canvas->drawRectCoords(3.f, 3.f, 7.f, 7.f, blue_paint);
75 list->CreateAndAppendItem<DrawingDisplayItem>( 76 list->CreateAndAppendItem<DrawingDisplayItem>(
76 kVisualRect, recorder.finishRecordingAsPicture()); 77 kVisualRect, recorder.finishRecordingAsPicture());
77 } 78 }
78 79
79 void ValidateDisplayItemListSerialization(const gfx::Size& layer_size, 80 void ValidateDisplayItemListSerialization(const gfx::Size& layer_size,
80 scoped_refptr<DisplayItemList> list) { 81 scoped_refptr<DisplayItemList> list) {
81 list->Finalize(); 82 list->Finalize();
82 83
83 scoped_ptr<FakeImageSerializationProcessor> 84 std::unique_ptr<FakeImageSerializationProcessor>
84 fake_image_serialization_processor = 85 fake_image_serialization_processor =
85 make_scoped_ptr(new FakeImageSerializationProcessor); 86 base::WrapUnique(new FakeImageSerializationProcessor);
86 87
87 // Serialize and deserialize the DisplayItemList. 88 // Serialize and deserialize the DisplayItemList.
88 proto::DisplayItemList proto; 89 proto::DisplayItemList proto;
89 list->ToProtobuf(&proto, fake_image_serialization_processor.get()); 90 list->ToProtobuf(&proto, fake_image_serialization_processor.get());
90 scoped_refptr<DisplayItemList> new_list = DisplayItemList::CreateFromProto( 91 scoped_refptr<DisplayItemList> new_list = DisplayItemList::CreateFromProto(
91 proto, fake_image_serialization_processor.get()); 92 proto, fake_image_serialization_processor.get());
92 93
93 EXPECT_TRUE( 94 EXPECT_TRUE(
94 AreDisplayListDrawingResultsSame(gfx::Rect(layer_size), list, new_list)); 95 AreDisplayListDrawingResultsSame(gfx::Rect(layer_size), list, new_list));
95 } 96 }
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 753
753 value = list->AsValue(false)->ToString(); 754 value = list->AsValue(false)->ToString();
754 EXPECT_EQ(value.find("\"items\":"), std::string::npos); 755 EXPECT_EQ(value.find("\"items\":"), std::string::npos);
755 EXPECT_NE(value.find("\"layer_rect\":[0,0,0,0]"), std::string::npos); 756 EXPECT_NE(value.find("\"layer_rect\":[0,0,0,0]"), std::string::npos);
756 // There should be no skp64 entry present as the items aren't included and the 757 // There should be no skp64 entry present as the items aren't included and the
757 // layer rect is empty. 758 // layer rect is empty.
758 EXPECT_EQ(value.find("\"skp64\":"), std::string::npos); 759 EXPECT_EQ(value.find("\"skp64\":"), std::string::npos);
759 } 760 }
760 761
761 } // namespace cc 762 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/display_item_list.cc ('k') | cc/playback/drawing_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698