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

Unified Diff: cc/test/fake_content_layer_client.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/test/fake_content_layer_client.h ('k') | cc/test/fake_display_list_recording_source.h » ('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 c21d87bef4c7cb9fa9841eb7dbcb1ccc3cf77a95..296c891d5a728af5b77bf16ec4473dba9d9d201c 100644
--- a/cc/test/fake_content_layer_client.cc
+++ b/cc/test/fake_content_layer_client.cc
@@ -71,15 +71,15 @@ void FakeContentLayerClient::PaintContents(
}
}
-void FakeContentLayerClient::PaintContentsToDisplayList(
- DisplayItemList* display_list,
+scoped_refptr<DisplayItemList>
+FakeContentLayerClient::PaintContentsToDisplayList(
const gfx::Rect& clip,
PaintingControlSetting painting_control) {
SkPictureRecorder recorder;
skia::RefPtr<SkCanvas> canvas;
skia::RefPtr<SkPicture> picture;
- display_list->AppendItem(
- ClipDisplayItem::Create(clip, std::vector<SkRRect>()));
+ scoped_refptr<DisplayItemList> list = DisplayItemList::Create();
+ list->AppendItem(ClipDisplayItem::Create(clip, std::vector<SkRRect>()));
for (RectPaintVector::const_iterator it = draw_rects_.begin();
it != draw_rects_.end(); ++it) {
@@ -90,21 +90,21 @@ void FakeContentLayerClient::PaintContentsToDisplayList(
canvas->drawRectCoords(draw_rect.x(), draw_rect.y(), draw_rect.width(),
draw_rect.height(), paint);
picture = skia::AdoptRef(recorder.endRecordingAsPicture());
- display_list->AppendItem(DrawingDisplayItem::Create(picture));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
}
for (BitmapVector::const_iterator it = draw_bitmaps_.begin();
it != draw_bitmaps_.end(); ++it) {
if (!it->transform.IsIdentity()) {
- display_list->AppendItem(TransformDisplayItem::Create(it->transform));
+ list->AppendItem(TransformDisplayItem::Create(it->transform));
}
canvas = skia::SharePtr(
recorder.beginRecording(it->bitmap.width(), it->bitmap.height()));
canvas->drawBitmap(it->bitmap, it->point.x(), it->point.y(), &it->paint);
picture = skia::AdoptRef(recorder.endRecordingAsPicture());
- display_list->AppendItem(DrawingDisplayItem::Create(picture));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
if (!it->transform.IsIdentity()) {
- display_list->AppendItem(EndTransformDisplayItem::Create());
+ list->AppendItem(EndTransformDisplayItem::Create());
}
}
@@ -118,12 +118,13 @@ void FakeContentLayerClient::PaintContentsToDisplayList(
recorder.beginRecording(gfx::RectFToSkRect(draw_rect)));
canvas->drawRect(gfx::RectFToSkRect(draw_rect), paint);
picture = skia::AdoptRef(recorder.endRecordingAsPicture());
- display_list->AppendItem(DrawingDisplayItem::Create(picture));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
draw_rect.Inset(1, 1);
}
}
- display_list->AppendItem(EndClipDisplayItem::Create());
+ list->AppendItem(EndClipDisplayItem::Create());
+ return list;
}
bool FakeContentLayerClient::FillsBoundsCompletely() const { return false; }
« no previous file with comments | « cc/test/fake_content_layer_client.h ('k') | cc/test/fake_display_list_recording_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698