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

Side by Side Diff: cc/playback/recording_source_unittest.cc

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: Re-add ios changes Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "cc/base/region.h" 8 #include "cc/base/region.h"
9 #include "cc/playback/raster_source.h" 9 #include "cc/playback/raster_source.h"
10 #include "cc/test/fake_content_layer_client.h" 10 #include "cc/test/fake_content_layer_client.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 EXPECT_TRUE(images.empty()); 176 EXPECT_TRUE(images.empty());
177 } 177 }
178 } 178 }
179 179
180 TEST(RecordingSourceTest, NoDiscardableImages) { 180 TEST(RecordingSourceTest, NoDiscardableImages) {
181 gfx::Rect recorded_viewport(0, 0, 256, 256); 181 gfx::Rect recorded_viewport(0, 0, 256, 256);
182 182
183 std::unique_ptr<FakeRecordingSource> recording_source = 183 std::unique_ptr<FakeRecordingSource> recording_source =
184 CreateRecordingSource(recorded_viewport); 184 CreateRecordingSource(recorded_viewport);
185 185
186 SkPaint simple_paint; 186 PaintFlags simple_paint;
187 simple_paint.setColor(SkColorSetARGB(255, 12, 23, 34)); 187 simple_paint.setColor(SkColorSetARGB(255, 12, 23, 34));
188 188
189 SkBitmap non_discardable_bitmap; 189 SkBitmap non_discardable_bitmap;
190 non_discardable_bitmap.allocN32Pixels(128, 128); 190 non_discardable_bitmap.allocN32Pixels(128, 128);
191 non_discardable_bitmap.setImmutable(); 191 non_discardable_bitmap.setImmutable();
192 sk_sp<SkImage> non_discardable_image = 192 sk_sp<SkImage> non_discardable_image =
193 SkImage::MakeFromBitmap(non_discardable_bitmap); 193 SkImage::MakeFromBitmap(non_discardable_bitmap);
194 194
195 recording_source->add_draw_rect_with_paint(gfx::Rect(0, 0, 256, 256), 195 recording_source->add_draw_rect_with_paint(gfx::Rect(0, 0, 256, 256),
196 simple_paint); 196 simple_paint);
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 &images); 362 &images);
363 EXPECT_EQ(3u, images.size()); 363 EXPECT_EQ(3u, images.size());
364 EXPECT_TRUE(images[0].image() == discardable_image[0][0]); 364 EXPECT_TRUE(images[0].image() == discardable_image[0][0]);
365 EXPECT_TRUE(images[1].image() == discardable_image[0][1]); 365 EXPECT_TRUE(images[1].image() == discardable_image[0][1]);
366 EXPECT_TRUE(images[2].image() == discardable_image[1][1]); 366 EXPECT_TRUE(images[2].image() == discardable_image[1][1]);
367 } 367 }
368 } 368 }
369 369
370 } // namespace 370 } // namespace
371 } // namespace cc 371 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698