summaryrefslogtreecommitdiffstats
path: root/cc/test
diff options
context:
space:
mode:
Diffstat (limited to 'cc/test')
-rw-r--r--cc/test/fake_content_layer_client.cc21
-rw-r--r--cc/test/fake_content_layer_client.h3
-rw-r--r--cc/test/fake_display_list_recording_source.h8
-rw-r--r--cc/test/fake_video_frame_provider.cc5
-rw-r--r--cc/test/fake_video_frame_provider.h4
-rw-r--r--cc/test/solid_color_content_layer_client.cc5
-rw-r--r--cc/test/solid_color_content_layer_client.h3
7 files changed, 29 insertions, 20 deletions
diff --git a/cc/test/fake_content_layer_client.cc b/cc/test/fake_content_layer_client.cc
index 296c891..c21d87b 100644
--- a/cc/test/fake_content_layer_client.cc
+++ b/cc/test/fake_content_layer_client.cc
@@ -71,15 +71,15 @@ void FakeContentLayerClient::PaintContents(
}
}
-scoped_refptr<DisplayItemList>
-FakeContentLayerClient::PaintContentsToDisplayList(
+void FakeContentLayerClient::PaintContentsToDisplayList(
+ DisplayItemList* display_list,
const gfx::Rect& clip,
PaintingControlSetting painting_control) {
SkPictureRecorder recorder;
skia::RefPtr<SkCanvas> canvas;
skia::RefPtr<SkPicture> picture;
- scoped_refptr<DisplayItemList> list = DisplayItemList::Create();
- list->AppendItem(ClipDisplayItem::Create(clip, std::vector<SkRRect>()));
+ display_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 @@ FakeContentLayerClient::PaintContentsToDisplayList(
canvas->drawRectCoords(draw_rect.x(), draw_rect.y(), draw_rect.width(),
draw_rect.height(), paint);
picture = skia::AdoptRef(recorder.endRecordingAsPicture());
- list->AppendItem(DrawingDisplayItem::Create(picture));
+ display_list->AppendItem(DrawingDisplayItem::Create(picture));
}
for (BitmapVector::const_iterator it = draw_bitmaps_.begin();
it != draw_bitmaps_.end(); ++it) {
if (!it->transform.IsIdentity()) {
- list->AppendItem(TransformDisplayItem::Create(it->transform));
+ display_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());
- list->AppendItem(DrawingDisplayItem::Create(picture));
+ display_list->AppendItem(DrawingDisplayItem::Create(picture));
if (!it->transform.IsIdentity()) {
- list->AppendItem(EndTransformDisplayItem::Create());
+ display_list->AppendItem(EndTransformDisplayItem::Create());
}
}
@@ -118,13 +118,12 @@ FakeContentLayerClient::PaintContentsToDisplayList(
recorder.beginRecording(gfx::RectFToSkRect(draw_rect)));
canvas->drawRect(gfx::RectFToSkRect(draw_rect), paint);
picture = skia::AdoptRef(recorder.endRecordingAsPicture());
- list->AppendItem(DrawingDisplayItem::Create(picture));
+ display_list->AppendItem(DrawingDisplayItem::Create(picture));
draw_rect.Inset(1, 1);
}
}
- list->AppendItem(EndClipDisplayItem::Create());
- return list;
+ display_list->AppendItem(EndClipDisplayItem::Create());
}
bool FakeContentLayerClient::FillsBoundsCompletely() const { return false; }
diff --git a/cc/test/fake_content_layer_client.h b/cc/test/fake_content_layer_client.h
index a4ecc59..d01bbd1 100644
--- a/cc/test/fake_content_layer_client.h
+++ b/cc/test/fake_content_layer_client.h
@@ -40,7 +40,8 @@ class FakeContentLayerClient : public ContentLayerClient {
void PaintContents(SkCanvas* canvas,
const gfx::Rect& rect,
PaintingControlSetting painting_control) override;
- scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
+ void PaintContentsToDisplayList(
+ DisplayItemList* display_list,
const gfx::Rect& clip,
PaintingControlSetting painting_control) override;
bool FillsBoundsCompletely() const override;
diff --git a/cc/test/fake_display_list_recording_source.h b/cc/test/fake_display_list_recording_source.h
index 679d5d6..544a022 100644
--- a/cc/test/fake_display_list_recording_source.h
+++ b/cc/test/fake_display_list_recording_source.h
@@ -40,9 +40,11 @@ class FakeDisplayListRecordingSource : public DisplayListRecordingSource {
void Rerecord() {
ContentLayerClient::PaintingControlSetting painting_control =
ContentLayerClient::PAINTING_BEHAVIOR_NORMAL;
- display_list_ = client_.PaintContentsToDisplayList(recorded_viewport_,
- painting_control);
- display_list_->set_layer_rect(recorded_viewport_);
+ bool use_cached_picture = true;
+ display_list_ =
+ DisplayItemList::Create(recorded_viewport_, use_cached_picture);
+ client_.PaintContentsToDisplayList(display_list_.get(), recorded_viewport_,
+ painting_control);
display_list_->CreateAndCacheSkPicture();
if (gather_pixel_refs_)
display_list_->GatherPixelRefs(grid_cell_size_);
diff --git a/cc/test/fake_video_frame_provider.cc b/cc/test/fake_video_frame_provider.cc
index f008d9f..3f4b40b 100644
--- a/cc/test/fake_video_frame_provider.cc
+++ b/cc/test/fake_video_frame_provider.cc
@@ -14,6 +14,11 @@ FakeVideoFrameProvider::~FakeVideoFrameProvider() {
client_->StopUsingProvider();
}
+bool FakeVideoFrameProvider::UpdateCurrentFrame(base::TimeTicks deadline_min,
+ base::TimeTicks deadline_max) {
+ return false;
+}
+
void FakeVideoFrameProvider::SetVideoFrameProviderClient(Client* client) {
client_ = client;
}
diff --git a/cc/test/fake_video_frame_provider.h b/cc/test/fake_video_frame_provider.h
index 50b6b27..53903c9 100644
--- a/cc/test/fake_video_frame_provider.h
+++ b/cc/test/fake_video_frame_provider.h
@@ -17,8 +17,10 @@ class FakeVideoFrameProvider : public VideoFrameProvider {
~FakeVideoFrameProvider() override;
void SetVideoFrameProviderClient(Client* client) override;
+ bool UpdateCurrentFrame(base::TimeTicks deadline_min,
+ base::TimeTicks deadline_max) override;
scoped_refptr<media::VideoFrame> GetCurrentFrame() override;
- void PutCurrentFrame(const scoped_refptr<media::VideoFrame>&) override {}
+ void PutCurrentFrame() override {}
Client* client() { return client_; }
diff --git a/cc/test/solid_color_content_layer_client.cc b/cc/test/solid_color_content_layer_client.cc
index 7e97bb8..fe13526 100644
--- a/cc/test/solid_color_content_layer_client.cc
+++ b/cc/test/solid_color_content_layer_client.cc
@@ -25,12 +25,11 @@ void SolidColorContentLayerClient::PaintContents(
paint);
}
-scoped_refptr<DisplayItemList>
-SolidColorContentLayerClient::PaintContentsToDisplayList(
+void SolidColorContentLayerClient::PaintContentsToDisplayList(
+ DisplayItemList* display_list,
const gfx::Rect& clip,
PaintingControlSetting painting_control) {
NOTIMPLEMENTED();
- return DisplayItemList::Create();
}
bool SolidColorContentLayerClient::FillsBoundsCompletely() const {
diff --git a/cc/test/solid_color_content_layer_client.h b/cc/test/solid_color_content_layer_client.h
index 1ab4c4d..3068f9ae 100644
--- a/cc/test/solid_color_content_layer_client.h
+++ b/cc/test/solid_color_content_layer_client.h
@@ -19,7 +19,8 @@ class SolidColorContentLayerClient : public ContentLayerClient {
void PaintContents(SkCanvas* canvas,
const gfx::Rect& rect,
PaintingControlSetting painting_control) override;
- scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
+ void PaintContentsToDisplayList(
+ DisplayItemList* display_list,
const gfx::Rect& clip,
PaintingControlSetting painting_control) override;
bool FillsBoundsCompletely() const override;