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

Unified Diff: cc/resources/display_item_list_unittest.cc

Issue 1083683003: Speculative revert by sheriff (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed an unrelated commit that had accidentally slipped in. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/display_item_list.cc ('k') | cc/resources/display_list_recording_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/display_item_list_unittest.cc
diff --git a/cc/resources/display_item_list_unittest.cc b/cc/resources/display_item_list_unittest.cc
index 290b25bdb89ded2850c5e32cb2a7e052e48121a0..b53b84a574c59fff847ddc46420289ab7529acab 100644
--- a/cc/resources/display_item_list_unittest.cc
+++ b/cc/resources/display_item_list_unittest.cc
@@ -36,9 +36,7 @@ TEST(DisplayItemListTest, SingleDrawingItem) {
SkPaint red_paint;
red_paint.setColor(SK_ColorRED);
unsigned char pixels[4 * 100 * 100] = {0};
- const bool use_cached_picture = true;
- scoped_refptr<DisplayItemList> list =
- DisplayItemList::Create(layer_rect, use_cached_picture);
+ scoped_refptr<DisplayItemList> list = DisplayItemList::Create();
gfx::PointF offset(8.f, 9.f);
gfx::RectF recording_rect(offset, layer_rect.size());
@@ -49,7 +47,6 @@ TEST(DisplayItemListTest, SingleDrawingItem) {
canvas->drawRectCoords(50.f, 50.f, 75.f, 75.f, blue_paint);
picture = skia::AdoptRef(recorder.endRecordingAsPicture());
list->AppendItem(DrawingDisplayItem::Create(picture));
- list->CreateAndCacheSkPicture();
DrawDisplayList(pixels, layer_rect, list);
SkBitmap expected_bitmap;
@@ -79,9 +76,7 @@ TEST(DisplayItemListTest, ClipItem) {
SkPaint red_paint;
red_paint.setColor(SK_ColorRED);
unsigned char pixels[4 * 100 * 100] = {0};
- const bool use_cached_picture = true;
- scoped_refptr<DisplayItemList> list =
- DisplayItemList::Create(layer_rect, use_cached_picture);
+ scoped_refptr<DisplayItemList> list = DisplayItemList::Create();
gfx::PointF first_offset(8.f, 9.f);
gfx::RectF first_recording_rect(first_offset, layer_rect.size());
@@ -105,7 +100,6 @@ TEST(DisplayItemListTest, ClipItem) {
list->AppendItem(DrawingDisplayItem::Create(picture));
list->AppendItem(EndClipDisplayItem::Create());
- list->CreateAndCacheSkPicture();
DrawDisplayList(pixels, layer_rect, list);
@@ -137,9 +131,7 @@ TEST(DisplayItemListTest, TransformItem) {
SkPaint red_paint;
red_paint.setColor(SK_ColorRED);
unsigned char pixels[4 * 100 * 100] = {0};
- const bool use_cached_picture = true;
- scoped_refptr<DisplayItemList> list =
- DisplayItemList::Create(layer_rect, use_cached_picture);
+ scoped_refptr<DisplayItemList> list = DisplayItemList::Create();
gfx::PointF first_offset(8.f, 9.f);
gfx::RectF first_recording_rect(first_offset, layer_rect.size());
@@ -164,7 +156,6 @@ TEST(DisplayItemListTest, TransformItem) {
list->AppendItem(DrawingDisplayItem::Create(picture));
list->AppendItem(EndTransformDisplayItem::Create());
- list->CreateAndCacheSkPicture();
DrawDisplayList(pixels, layer_rect, list);
@@ -186,13 +177,11 @@ TEST(DisplayItemListTest, TransformItem) {
EXPECT_EQ(0, memcmp(pixels, expected_pixels, 4 * 100 * 100));
}
-TEST(DisplayItemListTest, FilterItem) {
+TEST(DisplayItemList, FilterItem) {
gfx::Rect layer_rect(100, 100);
FilterOperations filters;
unsigned char pixels[4 * 100 * 100] = {0};
- const bool use_cached_picture = true;
- scoped_refptr<DisplayItemList> list =
- DisplayItemList::Create(layer_rect, use_cached_picture);
+ scoped_refptr<DisplayItemList> list = DisplayItemList::Create();
SkBitmap source_bitmap;
source_bitmap.allocN32Pixels(50, 50);
@@ -217,7 +206,6 @@ TEST(DisplayItemListTest, FilterItem) {
gfx::RectF filter_bounds(10.f, 10.f, 50.f, 50.f);
list->AppendItem(FilterDisplayItem::Create(filters, filter_bounds));
list->AppendItem(EndFilterDisplayItem::Create());
- list->CreateAndCacheSkPicture();
DrawDisplayList(pixels, layer_rect, list);
@@ -248,9 +236,8 @@ TEST(DisplayItemListTest, CompactingItems) {
gfx::PointF offset(8.f, 9.f);
gfx::RectF recording_rect(offset, layer_rect.size());
- bool use_cached_picture = false;
- scoped_refptr<DisplayItemList> list_without_caching =
- DisplayItemList::Create(layer_rect, use_cached_picture);
+ scoped_refptr<DisplayItemList> list = DisplayItemList::Create();
+ list->set_layer_rect(ToEnclosingRect(recording_rect));
canvas = skia::SharePtr(
recorder.beginRecording(gfx::RectFToSkRect(recording_rect)));
@@ -258,16 +245,13 @@ TEST(DisplayItemListTest, CompactingItems) {
canvas->drawRectCoords(0.f, 0.f, 60.f, 60.f, red_paint);
canvas->drawRectCoords(50.f, 50.f, 75.f, 75.f, blue_paint);
picture = skia::AdoptRef(recorder.endRecordingAsPicture());
- list_without_caching->AppendItem(DrawingDisplayItem::Create(picture));
- DrawDisplayList(pixels, layer_rect, list_without_caching);
+ list->AppendItem(DrawingDisplayItem::Create(picture));
+ DrawDisplayList(pixels, layer_rect, list);
+
+ list->CreateAndCacheSkPicture();
unsigned char expected_pixels[4 * 100 * 100] = {0};
- use_cached_picture = true;
- scoped_refptr<DisplayItemList> list_with_caching =
- DisplayItemList::Create(layer_rect, use_cached_picture);
- list_with_caching->AppendItem(DrawingDisplayItem::Create(picture));
- list_with_caching->CreateAndCacheSkPicture();
- DrawDisplayList(expected_pixels, layer_rect, list_with_caching);
+ DrawDisplayList(expected_pixels, layer_rect, list);
EXPECT_EQ(0, memcmp(pixels, expected_pixels, 4 * 100 * 100));
}
« no previous file with comments | « cc/resources/display_item_list.cc ('k') | cc/resources/display_list_recording_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698