summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2015-04-08 11:49:00 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-08 18:49:38 +0000
commit3523bf887df5b18d4837012e2a40e9e509eec409 (patch)
tree2ea0241efb7ccab10c0f8d16fb006a480ca7d378 /skia
parent9cd6e0dccc8918b56d2d38bf1cbc72bfa3e324fd (diff)
downloadchromium_src-3523bf887df5b18d4837012e2a40e9e509eec409.zip
chromium_src-3523bf887df5b18d4837012e2a40e9e509eec409.tar.gz
chromium_src-3523bf887df5b18d4837012e2a40e9e509eec409.tar.bz2
Use SkPictureRecorder::endRecordingAsPicture() instead of endRecording()
endRecording() is deprecated. Review URL: https://codereview.chromium.org/1066273002 Cr-Commit-Position: refs/heads/master@{#324260}
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/analysis_canvas_unittest.cc7
-rw-r--r--skia/ext/pixel_ref_utils_unittest.cc36
2 files changed, 27 insertions, 16 deletions
diff --git a/skia/ext/analysis_canvas_unittest.cc b/skia/ext/analysis_canvas_unittest.cc
index 8263075..db8e7a2 100644
--- a/skia/ext/analysis_canvas_unittest.cc
+++ b/skia/ext/analysis_canvas_unittest.cc
@@ -183,7 +183,8 @@ TEST(AnalysisCanvasTest, FilterPaint) {
skia::AnalysisCanvas canvas(255, 255);
SkPaint paint;
- skia::RefPtr<SkImageFilter> filter = skia::AdoptRef(SkOffsetImageFilter::Create(10, 10));
+ skia::RefPtr<SkImageFilter> filter =
+ skia::AdoptRef(SkOffsetImageFilter::Create(10, 10));
paint.setImageFilter(filter.get());
canvas.drawRect(SkRect::MakeWH(255, 255), paint);
@@ -344,7 +345,8 @@ TEST(AnalysisCanvasTest, EarlyOutNotSolid) {
record_canvas->drawText(
text.c_str(), text.length(), point.fX, point.fY, paint);
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(recorder.endRecordingAsPicture());
// Draw the picture into the analysis canvas, using the canvas as a callback
// as well.
@@ -357,7 +359,6 @@ TEST(AnalysisCanvasTest, EarlyOutNotSolid) {
// Verify that we aborted drawing.
EXPECT_TRUE(canvas.abortDrawing());
-
}
TEST(AnalysisCanvasTest, ClipComplexRegion) {
diff --git a/skia/ext/pixel_ref_utils_unittest.cc b/skia/ext/pixel_ref_utils_unittest.cc
index 50aa40d..1e8f6ee 100644
--- a/skia/ext/pixel_ref_utils_unittest.cc
+++ b/skia/ext/pixel_ref_utils_unittest.cc
@@ -85,7 +85,7 @@ SkCanvas* StartRecording(SkPictureRecorder* recorder, gfx::Rect layer_rect) {
SkPicture* StopRecording(SkPictureRecorder* recorder, SkCanvas* canvas) {
canvas->restore();
- return recorder->endRecording();
+ return recorder->endRecordingAsPicture();
}
} // namespace
@@ -115,7 +115,8 @@ TEST(PixelRefUtilsTest, DrawPaint) {
canvas->clipRect(SkRect::MakeWH(100, 100));
canvas->drawPaint(third_paint);
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -168,7 +169,8 @@ TEST(PixelRefUtilsTest, DrawPoints) {
// (50, 55, 150, 145).
canvas->drawPoints(SkCanvas::kPolygon_PointMode, 3, points, third_paint);
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -216,7 +218,8 @@ TEST(PixelRefUtilsTest, DrawRect) {
// (50, 50, 50, 50)
canvas->drawRect(SkRect::MakeXYWH(0, 0, 100, 100), third_paint);
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -269,7 +272,8 @@ TEST(PixelRefUtilsTest, DrawRRect) {
// (50, 50, 50, 50)
canvas->drawRRect(rrect, third_paint);
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -321,7 +325,8 @@ TEST(PixelRefUtilsTest, DrawOval) {
// (50, 50, 50, 50)
canvas->drawRect(SkRect::MakeXYWH(0, 0, 100, 100), third_paint);
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -365,7 +370,8 @@ TEST(PixelRefUtilsTest, DrawPath) {
canvas->restore();
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -419,7 +425,8 @@ TEST(PixelRefUtilsTest, DrawBitmap) {
// At (0, 0), scaled by 5 and 6
canvas->drawBitmap(fifth, 0, 0);
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -435,7 +442,6 @@ TEST(PixelRefUtilsTest, DrawBitmap) {
gfx::SkRectToRectF(pixel_refs[3].pixel_ref_rect));
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 50, 60),
gfx::SkRectToRectF(pixel_refs[4].pixel_ref_rect));
-
}
TEST(PixelRefUtilsTest, DrawBitmapRect) {
@@ -473,7 +479,8 @@ TEST(PixelRefUtilsTest, DrawBitmapRect) {
canvas->restore();
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -536,7 +543,8 @@ TEST(PixelRefUtilsTest, DrawSprite) {
// (100, 100, 50, 50).
canvas->drawSprite(fifth, 100, 100, &first_paint);
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -583,7 +591,8 @@ TEST(PixelRefUtilsTest, DrawText) {
canvas->drawPosText("text", 4, points, first_paint);
canvas->drawTextOnPath("text", 4, path, NULL, first_paint);
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -656,7 +665,8 @@ TEST(PixelRefUtilsTest, DrawVertices) {
3,
third_paint);
- skia::RefPtr<SkPicture> picture = skia::AdoptRef(StopRecording(&recorder, canvas));
+ skia::RefPtr<SkPicture> picture =
+ skia::AdoptRef(StopRecording(&recorder, canvas));
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);