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

Unified Diff: cc/resources/display_item_list_unittest.cc

Issue 939463003: Resolve FIXMEs in cc for Display Item Lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 ddf2cb706f46de74bd3b41ceed067dd8a73c501a..93edfb0dc6f647cf37024a0e65c555ccaea26d2e 100644
--- a/cc/resources/display_item_list_unittest.cc
+++ b/cc/resources/display_item_list_unittest.cc
@@ -37,13 +37,14 @@ TEST(DisplayItemListTest, SingleDrawingItem) {
unsigned char pixels[4 * 100 * 100] = {0};
scoped_refptr<DisplayItemList> list = DisplayItemList::Create();
+ gfx::PointF offset(8.f, 9.f);
+ gfx::RectF recording_rect(offset, layer_rect.size());
canvas = skia::SharePtr(
- recorder.beginRecording(layer_rect.width(), layer_rect.height()));
+ recorder.beginRecording(gfx::RectFToSkRect(recording_rect)));
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.endRecording());
- gfx::PointF offset(8.f, 9.f);
- list->AppendItem(DrawingDisplayItem::Create(picture, offset));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
DrawDisplayList(pixels, layer_rect, list);
SkBitmap expected_bitmap;
@@ -75,22 +76,24 @@ TEST(DisplayItemListTest, ClipItem) {
unsigned char pixels[4 * 100 * 100] = {0};
scoped_refptr<DisplayItemList> list = DisplayItemList::Create();
+ gfx::PointF first_offset(8.f, 9.f);
+ gfx::RectF first_recording_rect(first_offset, layer_rect.size());
canvas = skia::SharePtr(
- recorder.beginRecording(layer_rect.width(), layer_rect.height()));
+ recorder.beginRecording(gfx::RectFToSkRect(first_recording_rect)));
canvas->drawRectCoords(0.f, 0.f, 60.f, 60.f, red_paint);
picture = skia::AdoptRef(recorder.endRecording());
- gfx::PointF first_offset(8.f, 9.f);
- list->AppendItem(DrawingDisplayItem::Create(picture, first_offset));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
gfx::Rect clip_rect(60, 60, 10, 10);
list->AppendItem(ClipDisplayItem::Create(clip_rect, std::vector<SkRRect>()));
+ gfx::PointF second_offset(2.f, 3.f);
+ gfx::RectF second_recording_rect(second_offset, layer_rect.size());
canvas = skia::SharePtr(
- recorder.beginRecording(layer_rect.width(), layer_rect.height()));
+ recorder.beginRecording(gfx::RectFToSkRect(second_recording_rect)));
canvas->drawRectCoords(50.f, 50.f, 75.f, 75.f, blue_paint);
picture = skia::AdoptRef(recorder.endRecording());
- gfx::PointF second_offset(2.f, 3.f);
- list->AppendItem(DrawingDisplayItem::Create(picture, second_offset));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
list->AppendItem(EndClipDisplayItem::Create());
@@ -126,23 +129,25 @@ TEST(DisplayItemListTest, TransformItem) {
unsigned char pixels[4 * 100 * 100] = {0};
scoped_refptr<DisplayItemList> list = DisplayItemList::Create();
+ gfx::PointF first_offset(8.f, 9.f);
+ gfx::RectF first_recording_rect(first_offset, layer_rect.size());
canvas = skia::SharePtr(
- recorder.beginRecording(layer_rect.width(), layer_rect.height()));
+ recorder.beginRecording(gfx::RectFToSkRect(first_recording_rect)));
canvas->drawRectCoords(0.f, 0.f, 60.f, 60.f, red_paint);
picture = skia::AdoptRef(recorder.endRecording());
- gfx::PointF first_offset(8.f, 9.f);
- list->AppendItem(DrawingDisplayItem::Create(picture, first_offset));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
gfx::Transform transform;
transform.Rotate(45.0);
list->AppendItem(TransformDisplayItem::Create(transform));
+ gfx::PointF second_offset(2.f, 3.f);
+ gfx::RectF second_recording_rect(second_offset, layer_rect.size());
canvas = skia::SharePtr(
- recorder.beginRecording(layer_rect.width(), layer_rect.height()));
+ recorder.beginRecording(gfx::RectFToSkRect(second_recording_rect)));
canvas->drawRectCoords(50.f, 50.f, 75.f, 75.f, blue_paint);
picture = skia::AdoptRef(recorder.endRecording());
- gfx::PointF second_offset(2.f, 3.f);
- list->AppendItem(DrawingDisplayItem::Create(picture, second_offset));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
list->AppendItem(EndTransformDisplayItem::Create());

Powered by Google App Engine
This is Rietveld 408576698