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

Unified Diff: cc/test/fake_content_layer_client.cc

Issue 1423653005: Further plumb visual rect into cc:DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clip recorder params in omnibox. Created 5 years, 1 month 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 553bf658a6754810ca8e10f47de7aab864d59ca8..5078a650e1101c24a5cdea8c87b651d957c9d7fb 100644
--- a/cc/test/fake_content_layer_client.cc
+++ b/cc/test/fake_content_layer_client.cc
@@ -10,6 +10,7 @@
#include "cc/playback/transform_display_item.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
+#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/skia_util.h"
namespace cc {
@@ -53,7 +54,7 @@ FakeContentLayerClient::PaintContentsToDisplayList(
SkPictureRecorder recorder;
skia::RefPtr<SkCanvas> canvas;
skia::RefPtr<SkPicture> picture;
- auto* item = display_list->CreateAndAppendItem<ClipDisplayItem>();
+ auto* item = display_list->CreateAndAppendItem<ClipDisplayItem>(clip);
item->SetNew(clip, std::vector<SkRRect>());
for (RectPaintVector::const_iterator it = draw_rects_.begin();
@@ -64,14 +65,16 @@ FakeContentLayerClient::PaintContentsToDisplayList(
skia::SharePtr(recorder.beginRecording(gfx::RectFToSkRect(draw_rect)));
canvas->drawRect(gfx::RectFToSkRect(draw_rect), paint);
picture = skia::AdoptRef(recorder.endRecordingAsPicture());
- auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>();
+ 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()) {
- auto* item = display_list->CreateAndAppendItem<TransformDisplayItem>();
+ auto* item =
+ display_list->CreateAndAppendItem<TransformDisplayItem>(clip);
item->SetNew(it->transform);
}
canvas = skia::SharePtr(
@@ -79,10 +82,10 @@ 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>();
+ auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(clip);
item->SetNew(std::move(picture));
if (!it->transform.IsIdentity()) {
- display_list->CreateAndAppendItem<EndTransformDisplayItem>();
+ display_list->CreateAndAppendItem<EndTransformDisplayItem>(clip);
}
}
@@ -96,13 +99,14 @@ FakeContentLayerClient::PaintContentsToDisplayList(
skia::SharePtr(recorder.beginRecording(gfx::RectToSkRect(draw_rect)));
canvas->drawIRect(gfx::RectToSkIRect(draw_rect), paint);
picture = skia::AdoptRef(recorder.endRecordingAsPicture());
- auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>();
+ auto* item =
+ display_list->CreateAndAppendItem<DrawingDisplayItem>(draw_rect);
item->SetNew(std::move(picture));
draw_rect.Inset(1, 1);
}
}
- display_list->CreateAndAppendItem<EndClipDisplayItem>();
+ display_list->CreateAndAppendItem<EndClipDisplayItem>(clip);
display_list->Finalize();
return display_list;
« 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