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

Unified Diff: cc/test/fake_content_layer_client.cc

Issue 1521373005: Revert of cc: Shrink size of display item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/transform_display_item.cc ('k') | cc/test/solid_color_content_layer_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_content_layer_client.cc
diff --git a/cc/test/fake_content_layer_client.cc b/cc/test/fake_content_layer_client.cc
index ac8d282ef34f4da5a6924170326bdeede107c623..6370a2ef328d7048a786f061bc97e8171b0ddb95 100644
--- a/cc/test/fake_content_layer_client.cc
+++ b/cc/test/fake_content_layer_client.cc
@@ -52,6 +52,7 @@
DisplayItemList::Create(PaintableRegion(), settings);
SkPictureRecorder recorder;
skia::RefPtr<SkCanvas> canvas;
+ skia::RefPtr<SkPicture> picture;
for (RectPaintVector::const_iterator it = draw_rects_.begin();
it != draw_rects_.end(); ++it) {
@@ -60,23 +61,27 @@
canvas =
skia::SharePtr(recorder.beginRecording(gfx::RectFToSkRect(draw_rect)));
canvas->drawRect(gfx::RectFToSkRect(draw_rect), paint);
- display_list->CreateAndAppendItem<DrawingDisplayItem>(
- ToEnclosingRect(draw_rect),
- skia::AdoptRef(recorder.endRecordingAsPicture()));
+ picture = skia::AdoptRef(recorder.endRecordingAsPicture());
+ auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(
+ ToEnclosingRect(draw_rect));
+ item->SetNew(std::move(picture));
}
for (ImageVector::const_iterator it = draw_images_.begin();
it != draw_images_.end(); ++it) {
if (!it->transform.IsIdentity()) {
- display_list->CreateAndAppendItem<TransformDisplayItem>(PaintableRegion(),
- it->transform);
+ auto* item = display_list->CreateAndAppendItem<TransformDisplayItem>(
+ PaintableRegion());
+ item->SetNew(it->transform);
}
canvas = skia::SharePtr(
recorder.beginRecording(it->image->width(), it->image->height()));
canvas->drawImage(it->image.get(), it->point.x(), it->point.y(),
&it->paint);
- display_list->CreateAndAppendItem<DrawingDisplayItem>(
- PaintableRegion(), skia::AdoptRef(recorder.endRecordingAsPicture()));
+ picture = skia::AdoptRef(recorder.endRecordingAsPicture());
+ auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(
+ PaintableRegion());
+ item->SetNew(std::move(picture));
if (!it->transform.IsIdentity()) {
display_list->CreateAndAppendItem<EndTransformDisplayItem>(
PaintableRegion());
@@ -92,8 +97,10 @@
canvas =
skia::SharePtr(recorder.beginRecording(gfx::RectToSkRect(draw_rect)));
canvas->drawIRect(gfx::RectToSkIRect(draw_rect), paint);
- display_list->CreateAndAppendItem<DrawingDisplayItem>(
- draw_rect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ picture = skia::AdoptRef(recorder.endRecordingAsPicture());
+ auto* item =
+ display_list->CreateAndAppendItem<DrawingDisplayItem>(draw_rect);
+ item->SetNew(std::move(picture));
draw_rect.Inset(1, 1);
}
}
« no previous file with comments | « cc/playback/transform_display_item.cc ('k') | cc/test/solid_color_content_layer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698