summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_content_layer_client.cc
diff options
context:
space:
mode:
authorschenney <schenney@chromium.org>2015-02-19 08:48:25 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-19 16:49:13 +0000
commitba47b3ebc5d0b50ac44673774a66fe82f0dc8a21 (patch)
tree45166346f0ec0aa484c08a1dbecf005fbb558959 /cc/test/fake_content_layer_client.cc
parent6e4300d896a8d4103fdb43276521feaf0a6dcd28 (diff)
downloadchromium_src-ba47b3ebc5d0b50ac44673774a66fe82f0dc8a21.zip
chromium_src-ba47b3ebc5d0b50ac44673774a66fe82f0dc8a21.tar.gz
chromium_src-ba47b3ebc5d0b50ac44673774a66fe82f0dc8a21.tar.bz2
Resolve FIXMEs in cc for Display Item Lists.
This is the final patch for removing location and making SkPicture const in drawing display items, and the first patch in adding scroll display item support in cc. R=ajuma@chromium.org BUG=458240 Review URL: https://codereview.chromium.org/939463003 Cr-Commit-Position: refs/heads/master@{#317060}
Diffstat (limited to 'cc/test/fake_content_layer_client.cc')
-rw-r--r--cc/test/fake_content_layer_client.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/cc/test/fake_content_layer_client.cc b/cc/test/fake_content_layer_client.cc
index 23b73f5f..ab958e9 100644
--- a/cc/test/fake_content_layer_client.cc
+++ b/cc/test/fake_content_layer_client.cc
@@ -69,13 +69,12 @@ FakeContentLayerClient::PaintContentsToDisplayList(
it != draw_rects_.end(); ++it) {
const gfx::RectF& draw_rect = it->first;
const SkPaint& paint = it->second;
- canvas = skia::SharePtr(
- recorder.beginRecording(draw_rect.width(), draw_rect.height()));
+ canvas =
+ skia::SharePtr(recorder.beginRecording(gfx::RectFToSkRect(draw_rect)));
canvas->drawRectCoords(0.f, 0.f, draw_rect.width(), draw_rect.height(),
paint);
picture = skia::AdoptRef(recorder.endRecording());
- list->AppendItem(DrawingDisplayItem::Create(
- picture, gfx::PointF(draw_rect.x(), draw_rect.y())));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
}
for (BitmapVector::const_iterator it = draw_bitmaps_.begin();
@@ -84,8 +83,7 @@ FakeContentLayerClient::PaintContentsToDisplayList(
recorder.beginRecording(it->bitmap.width(), it->bitmap.height()));
canvas->drawBitmap(it->bitmap, 0.f, 0.f, &it->paint);
picture = skia::AdoptRef(recorder.endRecording());
- list->AppendItem(DrawingDisplayItem::Create(
- picture, gfx::PointF(it->point.x(), it->point.y())));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
}
if (fill_with_nonsolid_color_) {
@@ -94,11 +92,11 @@ FakeContentLayerClient::PaintContentsToDisplayList(
while (!draw_rect.IsEmpty()) {
SkPaint paint;
paint.setColor(red ? SK_ColorRED : SK_ColorBLUE);
- canvas =
- skia::SharePtr(recorder.beginRecording(clip.width(), clip.height()));
+ canvas = skia::SharePtr(
+ recorder.beginRecording(gfx::RectFToSkRect(draw_rect)));
canvas->drawRect(gfx::RectFToSkRect(draw_rect), paint);
picture = skia::AdoptRef(recorder.endRecording());
- list->AppendItem(DrawingDisplayItem::Create(picture, gfx::PointF()));
+ list->AppendItem(DrawingDisplayItem::Create(picture));
draw_rect.Inset(1, 1);
}
}