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

Unified Diff: cc/playback/recording_source_unittest.cc

Issue 1294673006: Update GatherPixelRefDevice to the new SkImage/SkPixelRef API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update cc_unittests Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/playback/pixel_ref_map_unittest.cc ('k') | cc/test/skia_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/playback/recording_source_unittest.cc
diff --git a/cc/playback/recording_source_unittest.cc b/cc/playback/recording_source_unittest.cc
index 61f3b5ce12bee858014a9fa1303f2c6f79baf7b6..107c0f0e769580a347d150c923b196e62ae1343b 100644
--- a/cc/playback/recording_source_unittest.cc
+++ b/cc/playback/recording_source_unittest.cc
@@ -161,7 +161,8 @@ TYPED_TEST(RecordingSourceTest, NoDiscardablePixelRefs) {
simple_paint.setColor(SkColorSetARGB(255, 12, 23, 34));
SkBitmap non_discardable_bitmap;
- CreateBitmap(gfx::Size(128, 128), "notdiscardable", &non_discardable_bitmap);
+ non_discardable_bitmap.allocN32Pixels(128, 128);
+ non_discardable_bitmap.setImmutable();
recording_source->add_draw_rect_with_paint(gfx::Rect(0, 0, 256, 256),
simple_paint);
@@ -241,9 +242,9 @@ TYPED_TEST(RecordingSourceTest, DiscardablePixelRefs) {
CreateRecordingSource<TypeParam>(recorded_viewport, grid_cell_size);
SkBitmap discardable_bitmap[2][2];
- CreateBitmap(gfx::Size(32, 32), "discardable", &discardable_bitmap[0][0]);
- CreateBitmap(gfx::Size(32, 32), "discardable", &discardable_bitmap[1][0]);
- CreateBitmap(gfx::Size(32, 32), "discardable", &discardable_bitmap[1][1]);
+ CreateDiscardableBitmap(gfx::Size(32, 32), &discardable_bitmap[0][0]);
+ CreateDiscardableBitmap(gfx::Size(32, 32), &discardable_bitmap[1][0]);
+ CreateDiscardableBitmap(gfx::Size(32, 32), &discardable_bitmap[1][1]);
// Discardable pixel refs are found in the following cells:
// |---|---|
@@ -377,12 +378,13 @@ TYPED_TEST(RecordingSourceTest, DiscardablePixelRefsBaseNonDiscardable) {
CreateRecordingSource<TypeParam>(recorded_viewport, grid_cell_size);
SkBitmap non_discardable_bitmap;
- CreateBitmap(gfx::Size(512, 512), "notdiscardable", &non_discardable_bitmap);
+ non_discardable_bitmap.allocN32Pixels(512, 512);
+ non_discardable_bitmap.setImmutable();
SkBitmap discardable_bitmap[2][2];
- CreateBitmap(gfx::Size(128, 128), "discardable", &discardable_bitmap[0][0]);
- CreateBitmap(gfx::Size(128, 128), "discardable", &discardable_bitmap[0][1]);
- CreateBitmap(gfx::Size(128, 128), "discardable", &discardable_bitmap[1][1]);
+ CreateDiscardableBitmap(gfx::Size(128, 128), &discardable_bitmap[0][0]);
+ CreateDiscardableBitmap(gfx::Size(128, 128), &discardable_bitmap[0][1]);
+ CreateDiscardableBitmap(gfx::Size(128, 128), &discardable_bitmap[1][1]);
// One large non-discardable bitmap covers the whole grid.
// Discardable pixel refs are found in the following cells:
« no previous file with comments | « cc/playback/pixel_ref_map_unittest.cc ('k') | cc/test/skia_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698