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

Unified Diff: cc/test/fake_content_layer_client.cc

Issue 1489713004: Remove the clip parameter from ContentLayerClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clipremoval
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/test/fake_content_layer_client.h ('k') | cc/test/solid_color_content_layer_client.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 5078a650e1101c24a5cdea8c87b651d957c9d7fb..6370a2ef328d7048a786f061bc97e8171b0ddb95 100644
--- a/cc/test/fake_content_layer_client.cc
+++ b/cc/test/fake_content_layer_client.cc
@@ -43,19 +43,16 @@ gfx::Rect FakeContentLayerClient::PaintableRegion() {
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.
DisplayItemListSettings settings;
settings.use_cached_picture = true;
scoped_refptr<DisplayItemList> display_list =
- DisplayItemList::Create(clip, settings);
+ DisplayItemList::Create(PaintableRegion(), settings);
SkPictureRecorder recorder;
skia::RefPtr<SkCanvas> canvas;
skia::RefPtr<SkPicture> picture;
- auto* item = display_list->CreateAndAppendItem<ClipDisplayItem>(clip);
- item->SetNew(clip, std::vector<SkRRect>());
for (RectPaintVector::const_iterator it = draw_rects_.begin();
it != draw_rects_.end(); ++it) {
@@ -73,8 +70,8 @@ FakeContentLayerClient::PaintContentsToDisplayList(
for (ImageVector::const_iterator it = draw_images_.begin();
it != draw_images_.end(); ++it) {
if (!it->transform.IsIdentity()) {
- auto* item =
- display_list->CreateAndAppendItem<TransformDisplayItem>(clip);
+ auto* item = display_list->CreateAndAppendItem<TransformDisplayItem>(
+ PaintableRegion());
item->SetNew(it->transform);
}
canvas = skia::SharePtr(
@@ -82,15 +79,17 @@ FakeContentLayerClient::PaintContentsToDisplayList(
canvas->drawImage(it->image.get(), it->point.x(), it->point.y(),
&it->paint);
picture = skia::AdoptRef(recorder.endRecordingAsPicture());
- auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(clip);
+ auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(
+ PaintableRegion());
item->SetNew(std::move(picture));
if (!it->transform.IsIdentity()) {
- display_list->CreateAndAppendItem<EndTransformDisplayItem>(clip);
+ display_list->CreateAndAppendItem<EndTransformDisplayItem>(
+ PaintableRegion());
}
}
if (fill_with_nonsolid_color_) {
- gfx::Rect draw_rect = clip;
+ gfx::Rect draw_rect = PaintableRegion();
bool red = true;
while (!draw_rect.IsEmpty()) {
SkPaint paint;
@@ -106,7 +105,6 @@ FakeContentLayerClient::PaintContentsToDisplayList(
}
}
- display_list->CreateAndAppendItem<EndClipDisplayItem>(clip);
display_list->Finalize();
return display_list;
« no previous file with comments | « cc/test/fake_content_layer_client.h ('k') | cc/test/solid_color_content_layer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698