summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_content_layer_client.cc
diff options
context:
space:
mode:
authorjbroman <jbroman@chromium.org>2015-05-29 13:11:59 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-29 20:12:24 +0000
commit16d628c67c862bf12797dc98a4a4110cf7b3229b (patch)
treec58b1c8f1d37497fda5cbc507b1954f8597a39fe /cc/test/fake_content_layer_client.cc
parentdca49897b2a0938dab1811f1072a1196bbba2854 (diff)
downloadchromium_src-16d628c67c862bf12797dc98a4a4110cf7b3229b.zip
chromium_src-16d628c67c862bf12797dc98a4a4110cf7b3229b.tar.gz
chromium_src-16d628c67c862bf12797dc98a4a4110cf7b3229b.tar.bz2
cc: Make ContentLayerClient subclasses create the DisplayItemList.
The clients are now expected to return a cc::DisplayItemList which is suitably "finalized" (in particular, ProcessAppendedItems and CreateAndCacheSkPicture should have been called, as appropriate for the settings used to create the display list). This avoids plumbing constructor parameters for DisplayItemList, which I'm about to add more of. BUG=484943 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1152283010 Cr-Commit-Position: refs/heads/master@{#332034}
Diffstat (limited to 'cc/test/fake_content_layer_client.cc')
-rw-r--r--cc/test/fake_content_layer_client.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/cc/test/fake_content_layer_client.cc b/cc/test/fake_content_layer_client.cc
index 5d949bf..b0dacb3 100644
--- a/cc/test/fake_content_layer_client.cc
+++ b/cc/test/fake_content_layer_client.cc
@@ -71,10 +71,15 @@ void FakeContentLayerClient::PaintContents(
}
}
-void FakeContentLayerClient::PaintContentsToDisplayList(
- DisplayItemList* display_list,
+scoped_refptr<DisplayItemList>
+FakeContentLayerClient::PaintContentsToDisplayList(
const gfx::Rect& clip,
PaintingControlSetting painting_control) {
+ // Cached picture is used because unit tests expect to be able to
+ // use GatherPixelRefs.
+ const bool use_cached_picture = true;
+ scoped_refptr<DisplayItemList> display_list =
+ DisplayItemList::Create(clip, use_cached_picture);
SkPictureRecorder recorder;
skia::RefPtr<SkCanvas> canvas;
skia::RefPtr<SkPicture> picture;
@@ -128,6 +133,9 @@ void FakeContentLayerClient::PaintContentsToDisplayList(
}
display_list->CreateAndAppendItem<EndClipDisplayItem>();
+
+ display_list->Finalize();
+ return display_list;
}
bool FakeContentLayerClient::FillsBoundsCompletely() const { return false; }