summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfmalita <fmalita@chromium.org>2016-03-22 06:32:10 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-22 13:33:15 +0000
commit2d743288889c7804e6431bf389cdc6084aaa49ef (patch)
tree95409a0d222e17f9e678b97040c0567ede58c4bc
parentc2db76301d3eb61575d807d2897da86d637cbd34 (diff)
downloadchromium_src-2d743288889c7804e6431bf389cdc6084aaa49ef.zip
chromium_src-2d743288889c7804e6431bf389cdc6084aaa49ef.tar.gz
chromium_src-2d743288889c7804e6431bf389cdc6084aaa49ef.tar.bz2
Use sk_sp-based picture recording APIs
1) use SkPictureRecorder::finishRecordingAsPicture() over endRecordingAsPicture() 2) convert to sk_sp<SkPicture> fields/params where feasible BUG=skia:5077 R=reed@google.com,danakj@chromium.org,enne@chromium.org TBR=pdr@chromium.org,alekseys@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1819683002 Cr-Commit-Position: refs/heads/master@{#382563}
-rw-r--r--cc/blink/web_display_item_list_impl.cc6
-rw-r--r--cc/blink/web_display_item_list_impl.h3
-rw-r--r--cc/layers/layer.cc4
-rw-r--r--cc/layers/layer.h3
-rw-r--r--cc/layers/layer_impl.cc4
-rw-r--r--cc/layers/layer_impl.h3
-rw-r--r--cc/layers/picture_image_layer.cc6
-rw-r--r--cc/layers/picture_layer.cc4
-rw-r--r--cc/layers/picture_layer.h2
-rw-r--r--cc/layers/picture_layer_impl.cc2
-rw-r--r--cc/layers/picture_layer_impl.h2
-rw-r--r--cc/playback/display_item_list.cc5
-rw-r--r--cc/playback/display_item_list.h2
-rw-r--r--cc/playback/display_item_list_unittest.cc36
-rw-r--r--cc/playback/display_list_raster_source.cc6
-rw-r--r--cc/playback/display_list_raster_source.h3
-rw-r--r--cc/playback/drawing_display_item.cc10
-rw-r--r--cc/playback/drawing_display_item.h8
-rw-r--r--cc/raster/gpu_rasterizer.cc3
-rw-r--r--cc/test/fake_content_layer_client.cc7
-rw-r--r--cc/test/solid_color_content_layer_client.cc2
-rw-r--r--cc/trees/layer_tree_host_pixeltest_masks.cc6
-rw-r--r--cc/trees/layer_tree_host_pixeltest_tiles.cc2
-rw-r--r--content/renderer/gpu/gpu_benchmarking_extension.cc2
-rw-r--r--printing/pdf_metafile_skia.cc6
-rw-r--r--skia/ext/analysis_canvas_unittest.cc3
-rw-r--r--skia/ext/pixel_ref_utils_unittest.cc34
-rw-r--r--third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp4
-rw-r--r--third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp2
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp2
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.cpp4
-rw-r--r--third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.h4
-rw-r--r--third_party/WebKit/Source/web/LinkHighlightImpl.cpp4
-rw-r--r--third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.cpp2
-rw-r--r--third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.h2
-rw-r--r--third_party/WebKit/public/platform/WebDisplayItemList.h4
-rw-r--r--ui/compositor/paint_recorder.cc2
37 files changed, 89 insertions, 115 deletions
diff --git a/cc/blink/web_display_item_list_impl.cc b/cc/blink/web_display_item_list_impl.cc
index 451a5d5..810a559 100644
--- a/cc/blink/web_display_item_list_impl.cc
+++ b/cc/blink/web_display_item_list_impl.cc
@@ -50,12 +50,12 @@ WebDisplayItemListImpl::WebDisplayItemListImpl(
void WebDisplayItemListImpl::appendDrawingItem(
const blink::WebRect& visual_rect,
- const SkPicture* picture) {
+ sk_sp<const SkPicture> picture) {
if (display_item_list_->RetainsIndividualDisplayItems()) {
display_item_list_->CreateAndAppendItem<cc::DrawingDisplayItem>(
- visual_rect, skia::SharePtr(picture));
+ visual_rect, std::move(picture));
} else {
- cc::DrawingDisplayItem item(skia::SharePtr(picture));
+ cc::DrawingDisplayItem item(std::move(picture));
display_item_list_->RasterIntoCanvas(item);
}
}
diff --git a/cc/blink/web_display_item_list_impl.h b/cc/blink/web_display_item_list_impl.h
index 17e58d5..a54ac0e 100644
--- a/cc/blink/web_display_item_list_impl.h
+++ b/cc/blink/web_display_item_list_impl.h
@@ -42,7 +42,8 @@ class WebDisplayItemListImpl : public blink::WebDisplayItemList {
~WebDisplayItemListImpl() override;
// blink::WebDisplayItemList implementation.
- void appendDrawingItem(const blink::WebRect&, const SkPicture*) override;
+ void appendDrawingItem(const blink::WebRect&,
+ sk_sp<const SkPicture>) override;
void appendClipItem(
const blink::WebRect& visual_rect,
const blink::WebRect& clip_rect,
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 7f1dd1d..0567738 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -217,8 +217,8 @@ bool Layer::IsPropertyChangeAllowed() const {
return !layer_tree_host_->in_paint_layer_contents();
}
-skia::RefPtr<SkPicture> Layer::GetPicture() const {
- return skia::RefPtr<SkPicture>();
+sk_sp<SkPicture> Layer::GetPicture() const {
+ return nullptr;
}
void Layer::SetParent(Layer* layer) {
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 3005401..86c6e67 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -28,7 +28,6 @@
#include "cc/layers/paint_properties.h"
#include "cc/output/filter_operations.h"
#include "cc/trees/property_tree.h"
-#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkPicture.h"
@@ -400,7 +399,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
virtual ScrollbarLayerInterface* ToScrollbarLayer();
- virtual skia::RefPtr<SkPicture> GetPicture() const;
+ virtual sk_sp<SkPicture> GetPicture() const;
// Constructs a LayerImpl of the correct runtime type for this Layer type.
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl);
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 3d4294d..d2c627f 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -464,8 +464,8 @@ bool LayerImpl::user_scrollable(ScrollbarOrientation orientation) const {
: user_scrollable_vertical_;
}
-skia::RefPtr<SkPicture> LayerImpl::GetPicture() {
- return skia::RefPtr<SkPicture>();
+sk_sp<SkPicture> LayerImpl::GetPicture() {
+ return nullptr;
}
scoped_ptr<LayerImpl> LayerImpl::CreateLayerImpl(LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index 4564544..31cdfba 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -32,7 +32,6 @@
#include "cc/quads/shared_quad_state.h"
#include "cc/resources/resource_provider.h"
#include "cc/tiles/tile_priority.h"
-#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkPicture.h"
@@ -530,7 +529,7 @@ class CC_EXPORT LayerImpl {
// ReleaseResources call.
virtual void RecreateResources();
- virtual skia::RefPtr<SkPicture> GetPicture();
+ virtual sk_sp<SkPicture> GetPicture();
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl);
virtual void PushPropertiesTo(LayerImpl* layer);
diff --git a/cc/layers/picture_image_layer.cc b/cc/layers/picture_image_layer.cc
index 05cbb0c..3c17c8c 100644
--- a/cc/layers/picture_image_layer.cc
+++ b/cc/layers/picture_image_layer.cc
@@ -80,10 +80,8 @@ scoped_refptr<DisplayItemList> PictureImageLayer::PaintContentsToDisplayList(
// transparent images blend correctly.
canvas->drawImage(image_.get(), 0, 0);
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(recorder.endRecordingAsPicture());
- display_list->CreateAndAppendItem<DrawingDisplayItem>(PaintableRegion(),
- std::move(picture));
+ display_list->CreateAndAppendItem<DrawingDisplayItem>(
+ PaintableRegion(), recorder.finishRecordingAsPicture());
display_list->Finalize();
return display_list;
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index af5cfb4..2763cf90 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -129,12 +129,12 @@ void PictureLayer::SetIsMask(bool is_mask) {
is_mask_ = is_mask;
}
-skia::RefPtr<SkPicture> PictureLayer::GetPicture() const {
+sk_sp<SkPicture> PictureLayer::GetPicture() const {
// We could either flatten the DisplayListRecordingSource into a single
// SkPicture, or paint a fresh one depending on what we intend to do with the
// picture. For now we just paint a fresh one to get consistent results.
if (!DrawsContent())
- return skia::RefPtr<SkPicture>();
+ return nullptr;
gfx::Size layer_size = bounds();
scoped_ptr<DisplayListRecordingSource> recording_source(
diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h
index 2d2a03b..727c846 100644
--- a/cc/layers/picture_layer.h
+++ b/cc/layers/picture_layer.h
@@ -32,7 +32,7 @@ class CC_EXPORT PictureLayer : public Layer {
void SetNeedsDisplayRect(const gfx::Rect& layer_rect) override;
bool Update() override;
void SetIsMask(bool is_mask) override;
- skia::RefPtr<SkPicture> GetPicture() const override;
+ sk_sp<SkPicture> GetPicture() const override;
bool IsSuitableForGpuRasterization() const override;
void RunMicroBenchmark(MicroBenchmark* benchmark) override;
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 4f5ce15..6f5c125 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -649,7 +649,7 @@ void PictureLayerImpl::RecreateResources() {
layer_tree_impl()->set_needs_update_draw_properties();
}
-skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() {
+sk_sp<SkPicture> PictureLayerImpl::GetPicture() {
return raster_source_->GetFlattenedPicture();
}
diff --git a/cc/layers/picture_layer_impl.h b/cc/layers/picture_layer_impl.h
index df9bdcf..c4f4257 100644
--- a/cc/layers/picture_layer_impl.h
+++ b/cc/layers/picture_layer_impl.h
@@ -49,7 +49,7 @@ class CC_EXPORT PictureLayerImpl
void DidBeginTracing() override;
void ReleaseResources() override;
void RecreateResources() override;
- skia::RefPtr<SkPicture> GetPicture() override;
+ sk_sp<SkPicture> GetPicture() override;
Region GetInvalidationRegionForDebugging() override;
// PictureLayerTilingClient overrides.
diff --git a/cc/playback/display_item_list.cc b/cc/playback/display_item_list.cc
index b88a65a..91f9cf2 100644
--- a/cc/playback/display_item_list.cc
+++ b/cc/playback/display_item_list.cc
@@ -184,7 +184,7 @@ void DisplayItemList::Finalize() {
// Convert to an SkPicture for faster rasterization.
DCHECK(settings_.use_cached_picture);
DCHECK(!picture_);
- picture_ = skia::AdoptRef(recorder_->endRecordingAsPicture());
+ picture_ = recorder_->finishRecordingAsPicture();
DCHECK(picture_);
picture_memory_usage_ =
SkPictureUtils::ApproximateBytesUsed(picture_.get());
@@ -265,8 +265,7 @@ DisplayItemList::AsValue(bool include_items) const {
canvas->translate(-layer_rect_.x(), -layer_rect_.y());
canvas->clipRect(gfx::RectToSkRect(layer_rect_));
Raster(canvas, NULL, gfx::Rect(), 1.f);
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(recorder.endRecordingAsPicture());
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
std::string b64_picture;
PictureDebugUtil::SerializeAsBase64(picture.get(), &b64_picture);
diff --git a/cc/playback/display_item_list.h b/cc/playback/display_item_list.h
index 9022fd1..5d33d24 100644
--- a/cc/playback/display_item_list.h
+++ b/cc/playback/display_item_list.h
@@ -126,7 +126,7 @@ class CC_EXPORT DisplayItemList
// |items_| . These rects are intentionally kept separate
// because they are not needed while walking the |items_| for raster.
std::vector<gfx::Rect> visual_rects_;
- skia::RefPtr<SkPicture> picture_;
+ sk_sp<SkPicture> picture_;
scoped_ptr<SkPictureRecorder> recorder_;
skia::RefPtr<SkCanvas> canvas_;
diff --git a/cc/playback/display_item_list_unittest.cc b/cc/playback/display_item_list_unittest.cc
index a6aac41..f75d12d 100644
--- a/cc/playback/display_item_list_unittest.cc
+++ b/cc/playback/display_item_list_unittest.cc
@@ -56,7 +56,7 @@ void AppendFirstSerializationTestPicture(scoped_refptr<DisplayItemList> list,
canvas->translate(offset.x(), offset.y());
canvas->drawRectCoords(0.f, 0.f, 4.f, 4.f, red_paint);
list->CreateAndAppendItem<DrawingDisplayItem>(
- kVisualRect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ kVisualRect, recorder.finishRecordingAsPicture());
}
void AppendSecondSerializationTestPicture(scoped_refptr<DisplayItemList> list,
@@ -73,7 +73,7 @@ void AppendSecondSerializationTestPicture(scoped_refptr<DisplayItemList> list,
canvas->translate(offset.x(), offset.y());
canvas->drawRectCoords(3.f, 3.f, 7.f, 7.f, blue_paint);
list->CreateAndAppendItem<DrawingDisplayItem>(
- kVisualRect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ kVisualRect, recorder.finishRecordingAsPicture());
}
void ValidateDisplayItemListSerialization(const gfx::Size& layer_size,
@@ -256,7 +256,6 @@ TEST(DisplayItemListTest, SingleDrawingItem) {
gfx::Rect layer_rect(100, 100);
SkPictureRecorder recorder;
skia::RefPtr<SkCanvas> canvas;
- skia::RefPtr<SkPicture> picture;
SkPaint blue_paint;
blue_paint.setColor(SK_ColorBLUE);
SkPaint red_paint;
@@ -273,9 +272,8 @@ TEST(DisplayItemListTest, SingleDrawingItem) {
canvas->translate(offset.x(), offset.y());
canvas->drawRectCoords(0.f, 0.f, 60.f, 60.f, red_paint);
canvas->drawRectCoords(50.f, 50.f, 75.f, 75.f, blue_paint);
- picture = skia::AdoptRef(recorder.endRecordingAsPicture());
- list->CreateAndAppendItem<DrawingDisplayItem>(kVisualRect,
- std::move(picture));
+ list->CreateAndAppendItem<DrawingDisplayItem>(
+ kVisualRect, recorder.finishRecordingAsPicture());
list->Finalize();
DrawDisplayList(pixels, layer_rect, list);
@@ -317,7 +315,7 @@ TEST(DisplayItemListTest, ClipItem) {
canvas->translate(first_offset.x(), first_offset.y());
canvas->drawRectCoords(0.f, 0.f, 60.f, 60.f, red_paint);
list->CreateAndAppendItem<DrawingDisplayItem>(
- kVisualRect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ kVisualRect, recorder.finishRecordingAsPicture());
gfx::Rect clip_rect(60, 60, 10, 10);
list->CreateAndAppendItem<ClipDisplayItem>(kVisualRect, clip_rect,
@@ -331,7 +329,7 @@ TEST(DisplayItemListTest, ClipItem) {
canvas->translate(second_offset.x(), second_offset.y());
canvas->drawRectCoords(50.f, 50.f, 75.f, 75.f, blue_paint);
list->CreateAndAppendItem<DrawingDisplayItem>(
- kVisualRect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ kVisualRect, recorder.finishRecordingAsPicture());
list->CreateAndAppendItem<EndClipDisplayItem>(kVisualRect);
list->Finalize();
@@ -377,7 +375,7 @@ TEST(DisplayItemListTest, TransformItem) {
canvas->translate(first_offset.x(), first_offset.y());
canvas->drawRectCoords(0.f, 0.f, 60.f, 60.f, red_paint);
list->CreateAndAppendItem<DrawingDisplayItem>(
- kVisualRect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ kVisualRect, recorder.finishRecordingAsPicture());
gfx::Transform transform;
transform.Rotate(45.0);
@@ -391,7 +389,7 @@ TEST(DisplayItemListTest, TransformItem) {
canvas->translate(second_offset.x(), second_offset.y());
canvas->drawRectCoords(50.f, 50.f, 75.f, 75.f, blue_paint);
list->CreateAndAppendItem<DrawingDisplayItem>(
- kVisualRect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ kVisualRect, recorder.finishRecordingAsPicture());
list->CreateAndAppendItem<EndTransformDisplayItem>(kVisualRect);
list->Finalize();
@@ -472,7 +470,6 @@ TEST(DisplayItemListTest, CompactingItems) {
gfx::Rect layer_rect(100, 100);
SkPictureRecorder recorder;
skia::RefPtr<SkCanvas> canvas;
- skia::RefPtr<SkPicture> picture;
SkPaint blue_paint;
blue_paint.setColor(SK_ColorBLUE);
SkPaint red_paint;
@@ -492,7 +489,7 @@ TEST(DisplayItemListTest, CompactingItems) {
canvas->translate(offset.x(), offset.y());
canvas->drawRectCoords(0.f, 0.f, 60.f, 60.f, red_paint);
canvas->drawRectCoords(50.f, 50.f, 75.f, 75.f, blue_paint);
- picture = skia::AdoptRef(recorder.endRecordingAsPicture());
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
list_without_caching->CreateAndAppendItem<DrawingDisplayItem>(kVisualRect,
picture);
list_without_caching->Finalize();
@@ -535,8 +532,7 @@ TEST(DisplayItemListTest, IsSuitableForGpuRasterizationWithCachedPicture) {
paint.setAntiAlias(true);
canvas->drawPath(path, paint);
- skia::RefPtr<SkPicture> suitable_picture =
- skia::AdoptRef(recorder.endRecordingAsPicture());
+ sk_sp<SkPicture> suitable_picture = recorder.finishRecordingAsPicture();
list->CreateAndAppendItem<DrawingDisplayItem>(kVisualRect, suitable_picture);
list->Finalize();
@@ -556,8 +552,7 @@ TEST(DisplayItemListTest, IsSuitableForGpuRasterizationWithCachedPicture) {
skia::SharePtr(recorder.beginRecording(gfx::RectToSkRect(layer_rect)));
for (int i = 0; i < 10; ++i)
canvas->drawPath(path, paint);
- skia::RefPtr<SkPicture> unsuitable_picture =
- skia::AdoptRef(recorder.endRecordingAsPicture());
+ sk_sp<SkPicture> unsuitable_picture = recorder.finishRecordingAsPicture();
list->CreateAndAppendItem<DrawingDisplayItem>(kVisualRect,
unsuitable_picture);
list->Finalize();
@@ -600,7 +595,7 @@ TEST(DisplayItemListTest, IsSuitableForGpuRasterizationWithoutCachedPicture) {
canvas->drawPath(path, paint);
list->CreateAndAppendItem<DrawingDisplayItem>(
- kVisualRect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ kVisualRect, recorder.finishRecordingAsPicture());
list->Finalize();
// A single DrawingDisplayItem with a large AA concave path shouldn't trigger
@@ -613,7 +608,7 @@ TEST(DisplayItemListTest, IsSuitableForGpuRasterizationWithoutCachedPicture) {
for (int i = 0; i < 10; ++i)
canvas->drawPath(path, paint);
list->CreateAndAppendItem<DrawingDisplayItem>(
- kVisualRect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ kVisualRect, recorder.finishRecordingAsPicture());
list->Finalize();
// A single DrawingDisplayItem with several large AA concave paths should
@@ -626,7 +621,7 @@ TEST(DisplayItemListTest, IsSuitableForGpuRasterizationWithoutCachedPicture) {
skia::SharePtr(recorder.beginRecording(gfx::RectToSkRect(layer_rect)));
canvas->drawPath(path, paint);
list->CreateAndAppendItem<DrawingDisplayItem>(
- kVisualRect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ kVisualRect, recorder.finishRecordingAsPicture());
}
list->Finalize();
@@ -649,8 +644,7 @@ TEST(DisplayItemListTest, ApproximateMemoryUsage) {
SkCanvas* canvas = recorder.beginRecording(gfx::RectToSkRect(layer_rect));
for (int i = 0; i < kNumCommandsInTestSkPicture; i++)
canvas->drawPaint(blue_paint);
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(recorder.endRecordingAsPicture());
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
size_t picture_size = SkPictureUtils::ApproximateBytesUsed(picture.get());
ASSERT_GE(picture_size, kNumCommandsInTestSkPicture * sizeof(blue_paint));
diff --git a/cc/playback/display_list_raster_source.cc b/cc/playback/display_list_raster_source.cc
index a6d2c84..970648f 100644
--- a/cc/playback/display_list_raster_source.cc
+++ b/cc/playback/display_list_raster_source.cc
@@ -260,7 +260,7 @@ void DisplayListRasterSource::RasterCommon(
}
}
-skia::RefPtr<SkPicture> DisplayListRasterSource::GetFlattenedPicture() {
+sk_sp<SkPicture> DisplayListRasterSource::GetFlattenedPicture() {
TRACE_EVENT0("cc", "DisplayListRasterSource::GetFlattenedPicture");
gfx::Rect display_list_rect(size_);
@@ -272,10 +272,8 @@ skia::RefPtr<SkPicture> DisplayListRasterSource::GetFlattenedPicture() {
1.f);
RasterCommon(canvas, nullptr, display_list_rect, display_list_rect, 1.f);
}
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(recorder.endRecordingAsPicture());
- return picture;
+ return recorder.finishRecordingAsPicture();
}
size_t DisplayListRasterSource::GetPictureMemoryUsage() const {
diff --git a/cc/playback/display_list_raster_source.h b/cc/playback/display_list_raster_source.h
index 361019c..f9df196 100644
--- a/cc/playback/display_list_raster_source.h
+++ b/cc/playback/display_list_raster_source.h
@@ -18,7 +18,6 @@
#include "cc/debug/rendering_stats_instrumentation.h"
#include "cc/playback/display_list_recording_source.h"
#include "skia/ext/analysis_canvas.h"
-#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkPicture.h"
namespace cc {
@@ -103,7 +102,7 @@ class CC_EXPORT DisplayListRasterSource
// Tracing functionality.
virtual void DidBeginTracing();
virtual void AsValueInto(base::trace_event::TracedValue* array) const;
- virtual skia::RefPtr<SkPicture> GetFlattenedPicture();
+ virtual sk_sp<SkPicture> GetFlattenedPicture();
virtual size_t GetPictureMemoryUsage() const;
// Return true if LCD anti-aliasing may be used when rastering text.
diff --git a/cc/playback/drawing_display_item.cc b/cc/playback/drawing_display_item.cc
index f8832cb..9d8b978 100644
--- a/cc/playback/drawing_display_item.cc
+++ b/cc/playback/drawing_display_item.cc
@@ -26,7 +26,7 @@ namespace cc {
DrawingDisplayItem::DrawingDisplayItem() {}
-DrawingDisplayItem::DrawingDisplayItem(skia::RefPtr<const SkPicture> picture) {
+DrawingDisplayItem::DrawingDisplayItem(sk_sp<const SkPicture> picture) {
SetNew(std::move(picture));
}
@@ -35,13 +35,13 @@ DrawingDisplayItem::DrawingDisplayItem(
ImageSerializationProcessor* image_serialization_processor) {
DCHECK_EQ(proto::DisplayItem::Type_Drawing, proto.type());
- skia::RefPtr<SkPicture> picture;
+ sk_sp<SkPicture> picture;
const proto::DrawingDisplayItem& details = proto.drawing_item();
if (details.has_picture()) {
SkMemoryStream stream(details.picture().data(), details.picture().size());
- picture = skia::AdoptRef(SkPicture::CreateFromStream(
- &stream, image_serialization_processor->GetPixelDeserializer()));
+ picture = SkPicture::MakeFromStream(
+ &stream, image_serialization_processor->GetPixelDeserializer());
}
SetNew(std::move(picture));
@@ -54,7 +54,7 @@ DrawingDisplayItem::DrawingDisplayItem(const DrawingDisplayItem& item) {
DrawingDisplayItem::~DrawingDisplayItem() {
}
-void DrawingDisplayItem::SetNew(skia::RefPtr<const SkPicture> picture) {
+void DrawingDisplayItem::SetNew(sk_sp<const SkPicture> picture) {
picture_ = std::move(picture);
}
diff --git a/cc/playback/drawing_display_item.h b/cc/playback/drawing_display_item.h
index 8045904..0e7c640 100644
--- a/cc/playback/drawing_display_item.h
+++ b/cc/playback/drawing_display_item.h
@@ -10,7 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "cc/base/cc_export.h"
#include "cc/playback/display_item.h"
-#include "skia/ext/refptr.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
#include "ui/gfx/geometry/point_f.h"
class SkCanvas;
@@ -22,7 +22,7 @@ class ImageSerializationProcessor;
class CC_EXPORT DrawingDisplayItem : public DisplayItem {
public:
DrawingDisplayItem();
- explicit DrawingDisplayItem(skia::RefPtr<const SkPicture> picture);
+ explicit DrawingDisplayItem(sk_sp<const SkPicture> picture);
explicit DrawingDisplayItem(
const proto::DisplayItem& proto,
ImageSerializationProcessor* image_serialization_processor);
@@ -45,9 +45,9 @@ class CC_EXPORT DrawingDisplayItem : public DisplayItem {
void CloneTo(DrawingDisplayItem* item) const;
private:
- void SetNew(skia::RefPtr<const SkPicture> picture);
+ void SetNew(sk_sp<const SkPicture> picture);
- skia::RefPtr<const SkPicture> picture_;
+ sk_sp<const SkPicture> picture_;
};
} // namespace cc
diff --git a/cc/raster/gpu_rasterizer.cc b/cc/raster/gpu_rasterizer.cc
index 7e8c131..18c83f7 100644
--- a/cc/raster/gpu_rasterizer.cc
+++ b/cc/raster/gpu_rasterizer.cc
@@ -55,8 +55,7 @@ void GpuRasterizer::RasterizeSource(
raster_source->PlaybackToCanvas(canvas.get(), raster_full_rect, playback_rect,
scale, include_images);
canvas->restore();
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(recorder.endRecordingAsPicture());
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
// Turn on distance fields for layers that have ever animated.
bool use_distance_field_text =
diff --git a/cc/test/fake_content_layer_client.cc b/cc/test/fake_content_layer_client.cc
index 88c4f80..49cf38f 100644
--- a/cc/test/fake_content_layer_client.cc
+++ b/cc/test/fake_content_layer_client.cc
@@ -67,8 +67,7 @@ FakeContentLayerClient::PaintContentsToDisplayList(
skia::SharePtr(recorder.beginRecording(gfx::RectFToSkRect(draw_rect)));
canvas->drawRect(gfx::RectFToSkRect(draw_rect), paint);
display_list->CreateAndAppendItem<DrawingDisplayItem>(
- ToEnclosingRect(draw_rect),
- skia::AdoptRef(recorder.endRecordingAsPicture()));
+ ToEnclosingRect(draw_rect), recorder.finishRecordingAsPicture());
}
for (ImageVector::const_iterator it = draw_images_.begin();
@@ -82,7 +81,7 @@ FakeContentLayerClient::PaintContentsToDisplayList(
canvas->drawImage(it->image.get(), it->point.x(), it->point.y(),
&it->paint);
display_list->CreateAndAppendItem<DrawingDisplayItem>(
- PaintableRegion(), skia::AdoptRef(recorder.endRecordingAsPicture()));
+ PaintableRegion(), recorder.finishRecordingAsPicture());
if (!it->transform.IsIdentity()) {
display_list->CreateAndAppendItem<EndTransformDisplayItem>(
PaintableRegion());
@@ -99,7 +98,7 @@ FakeContentLayerClient::PaintContentsToDisplayList(
skia::SharePtr(recorder.beginRecording(gfx::RectToSkRect(draw_rect)));
canvas->drawIRect(gfx::RectToSkIRect(draw_rect), paint);
display_list->CreateAndAppendItem<DrawingDisplayItem>(
- draw_rect, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ draw_rect, recorder.finishRecordingAsPicture());
draw_rect.Inset(1, 1);
}
}
diff --git a/cc/test/solid_color_content_layer_client.cc b/cc/test/solid_color_content_layer_client.cc
index 2973aff..5e384ac 100644
--- a/cc/test/solid_color_content_layer_client.cc
+++ b/cc/test/solid_color_content_layer_client.cc
@@ -43,7 +43,7 @@ SolidColorContentLayerClient::PaintContentsToDisplayList(
DisplayItemList::Create(clip, settings);
display_list->CreateAndAppendItem<DrawingDisplayItem>(
- clip, skia::AdoptRef(recorder.endRecordingAsPicture()));
+ clip, recorder.finishRecordingAsPicture());
display_list->Finalize();
return display_list;
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc
index 890e94a..3a6f127 100644
--- a/cc/trees/layer_tree_host_pixeltest_masks.cc
+++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -61,7 +61,7 @@ class MaskContentLayerClient : public ContentLayerClient {
scoped_refptr<DisplayItemList> display_list =
DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings());
display_list->CreateAndAppendItem<DrawingDisplayItem>(
- PaintableRegion(), skia::AdoptRef(recorder.endRecordingAsPicture()));
+ PaintableRegion(), recorder.finishRecordingAsPicture());
display_list->Finalize();
return display_list;
@@ -329,7 +329,7 @@ class CheckerContentLayerClient : public ContentLayerClient {
scoped_refptr<DisplayItemList> display_list =
DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings());
display_list->CreateAndAppendItem<DrawingDisplayItem>(
- PaintableRegion(), skia::AdoptRef(recorder.endRecordingAsPicture()));
+ PaintableRegion(), recorder.finishRecordingAsPicture());
display_list->Finalize();
return display_list;
@@ -367,7 +367,7 @@ class CircleContentLayerClient : public ContentLayerClient {
scoped_refptr<DisplayItemList> display_list =
DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings());
display_list->CreateAndAppendItem<DrawingDisplayItem>(
- PaintableRegion(), skia::AdoptRef(recorder.endRecordingAsPicture()));
+ PaintableRegion(), recorder.finishRecordingAsPicture());
display_list->Finalize();
return display_list;
diff --git a/cc/trees/layer_tree_host_pixeltest_tiles.cc b/cc/trees/layer_tree_host_pixeltest_tiles.cc
index fecc47e..764e37d 100644
--- a/cc/trees/layer_tree_host_pixeltest_tiles.cc
+++ b/cc/trees/layer_tree_host_pixeltest_tiles.cc
@@ -133,7 +133,7 @@ class BlueYellowClient : public ContentLayerClient {
canvas->drawRect(gfx::RectToSkRect(yellow_rect), paint);
display_list->CreateAndAppendItem<DrawingDisplayItem>(
- PaintableRegion(), skia::AdoptRef(recorder.endRecordingAsPicture()));
+ PaintableRegion(), recorder.finishRecordingAsPicture());
display_list->Finalize();
return display_list;
}
diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc
index 560b70b..742481a 100644
--- a/content/renderer/gpu/gpu_benchmarking_extension.cc
+++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
@@ -127,7 +127,7 @@ class SkPictureSerializer {
Serialize(children[i].get());
}
- skia::RefPtr<SkPicture> picture = layer->GetPicture();
+ sk_sp<SkPicture> picture = layer->GetPicture();
if (!picture)
return;
diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc
index 6ba04c7..104970e 100644
--- a/printing/pdf_metafile_skia.cc
+++ b/printing/pdf_metafile_skia.cc
@@ -51,7 +51,7 @@ struct Page {
SkSize page_size_;
SkRect content_area_;
float scale_factor_;
- skia::RefPtr<SkPicture> content_;
+ sk_sp<SkPicture> content_;
};
bool WriteAssetToBuffer(const SkStreamAsset* asset,
@@ -144,7 +144,7 @@ bool PdfMetafileSkia::FinishPage() {
return false;
DCHECK(!(data_->pages_.back().content_));
data_->pages_.back().content_ =
- skia::AdoptRef(data_->recorder_.endRecordingAsPicture());
+ data_->recorder_.finishRecordingAsPicture();
return true;
}
@@ -173,7 +173,7 @@ bool PdfMetafileSkia::FinishDocument() {
page.page_size_.width(), page.page_size_.height(), &page.content_area_);
// No need to save/restore, since this canvas is not reused after endPage()
canvas->scale(page.scale_factor_, page.scale_factor_);
- canvas->drawPicture(page.content_.get());
+ canvas->drawPicture(page.content_);
pdf_doc->endPage();
}
if (!pdf_doc->close())
diff --git a/skia/ext/analysis_canvas_unittest.cc b/skia/ext/analysis_canvas_unittest.cc
index 5436b81..bac22b1 100644
--- a/skia/ext/analysis_canvas_unittest.cc
+++ b/skia/ext/analysis_canvas_unittest.cc
@@ -345,8 +345,7 @@ TEST(AnalysisCanvasTest, EarlyOutNotSolid) {
record_canvas->drawText(
text.c_str(), text.length(), point.fX, point.fY, paint);
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(recorder.endRecordingAsPicture());
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
// Draw the picture into the analysis canvas, using the canvas as a callback
// as well.
diff --git a/skia/ext/pixel_ref_utils_unittest.cc b/skia/ext/pixel_ref_utils_unittest.cc
index 7af706b..dc28cfe 100644
--- a/skia/ext/pixel_ref_utils_unittest.cc
+++ b/skia/ext/pixel_ref_utils_unittest.cc
@@ -58,9 +58,9 @@ SkCanvas* StartRecording(SkPictureRecorder* recorder, gfx::Rect layer_rect) {
return canvas;
}
-SkPicture* StopRecording(SkPictureRecorder* recorder, SkCanvas* canvas) {
+sk_sp<SkPicture> StopRecording(SkPictureRecorder* recorder, SkCanvas* canvas) {
canvas->restore();
- return recorder->endRecordingAsPicture();
+ return recorder->finishRecordingAsPicture();
}
} // namespace
@@ -104,8 +104,7 @@ TEST(PixelRefUtilsTest, DrawPaint) {
canvas->clipRect(SkRect::MakeWH(100, 100));
canvas->drawPaint(third_paint);
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(StopRecording(&recorder, canvas));
+ sk_sp<SkPicture> picture = StopRecording(&recorder, canvas);
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -164,8 +163,7 @@ 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));
+ sk_sp<SkPicture> picture = StopRecording(&recorder, canvas);
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -216,8 +214,7 @@ TEST(PixelRefUtilsTest, DrawRect) {
// (20, 20, 100, 100)
canvas->drawRect(SkRect::MakeXYWH(0, 0, 100, 100), third_paint);
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(StopRecording(&recorder, canvas));
+ sk_sp<SkPicture> picture = StopRecording(&recorder, canvas);
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -273,8 +270,7 @@ TEST(PixelRefUtilsTest, DrawRRect) {
// (20, 20, 100, 100)
canvas->drawRRect(rrect, third_paint);
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(StopRecording(&recorder, canvas));
+ sk_sp<SkPicture> picture = StopRecording(&recorder, canvas);
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -329,8 +325,7 @@ TEST(PixelRefUtilsTest, DrawOval) {
// (20, 20, 100, 100).
canvas->drawRect(SkRect::MakeXYWH(0, 0, 100, 100), third_paint);
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(StopRecording(&recorder, canvas));
+ sk_sp<SkPicture> picture = StopRecording(&recorder, canvas);
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -379,8 +374,7 @@ TEST(PixelRefUtilsTest, DrawPath) {
canvas->restore();
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(StopRecording(&recorder, canvas));
+ sk_sp<SkPicture> picture = StopRecording(&recorder, canvas);
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -422,8 +416,7 @@ 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));
+ sk_sp<SkPicture> picture = StopRecording(&recorder, canvas);
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -494,8 +487,7 @@ TEST(PixelRefUtilsTest, DrawVertices) {
3,
third_paint);
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(StopRecording(&recorder, canvas));
+ sk_sp<SkPicture> picture = StopRecording(&recorder, canvas);
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -563,8 +555,7 @@ TEST(PixelRefUtilsTest, DrawImage) {
canvas->restore();
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(StopRecording(&recorder, canvas));
+ sk_sp<SkPicture> picture = StopRecording(&recorder, canvas);
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
@@ -627,8 +618,7 @@ TEST(PixelRefUtilsTest, DrawImageRect) {
canvas->restore();
- skia::RefPtr<SkPicture> picture =
- skia::AdoptRef(StopRecording(&recorder, canvas));
+ sk_sp<SkPicture> picture = StopRecording(&recorder, canvas);
std::vector<skia::PixelRefUtils::PositionPixelRef> pixel_refs;
skia::PixelRefUtils::GatherDiscardablePixelRefs(picture.get(), &pixel_refs);
diff --git a/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp b/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp
index da8a4ae..5c21c9c 100644
--- a/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp
@@ -57,8 +57,8 @@ static void paintArtifactToWebDisplayItemList(WebDisplayItemList* list, const Pa
// separate layers and send those to the compositor, instead of sending
// one big flat SkPicture.
SkRect skBounds = SkRect::MakeXYWH(bounds.x(), bounds.y(), bounds.width(), bounds.height());
- RefPtr<SkPicture> picture = paintArtifactToSkPicture(artifact, skBounds);
- list->appendDrawingItem(WebRect(bounds.x(), bounds.y(), bounds.width(), bounds.height()), picture.get());
+ list->appendDrawingItem(WebRect(bounds.x(), bounds.y(), bounds.width(), bounds.height()),
+ paintArtifactToSkPicture(artifact, skBounds));
return;
}
artifact.appendToWebDisplayItemList(list);
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
index ca7d534..a1a5329 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -84,7 +84,7 @@ static void appendDisplayItemToCcDisplayItemList(const DisplayItem& displayItem,
if (!picture)
return;
gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut());
- list->CreateAndAppendItem<cc::DrawingDisplayItem>(bounds, skia::SharePtr(picture));
+ list->CreateAndAppendItem<cc::DrawingDisplayItem>(bounds, sk_ref_sp(picture));
}
}
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
index b630917..c291fda 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
@@ -25,7 +25,7 @@ void DrawingDisplayItem::replay(GraphicsContext& context) const
void DrawingDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect, WebDisplayItemList* list) const
{
if (m_picture)
- list->appendDrawingItem(visualRect, m_picture.get());
+ list->appendDrawingItem(visualRect, toSkSp(m_picture));
}
bool DrawingDisplayItem::drawsContent() const
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.cpp
index e95d832..1bd718d 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.cpp
@@ -136,12 +136,12 @@ void paintArtifactToSkCanvas(const PaintArtifact& artifact, SkCanvas* canvas)
}
}
-PassRefPtr<SkPicture> paintArtifactToSkPicture(const PaintArtifact& artifact, const SkRect& bounds)
+sk_sp<const SkPicture> paintArtifactToSkPicture(const PaintArtifact& artifact, const SkRect& bounds)
{
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(bounds);
paintArtifactToSkCanvas(artifact, canvas);
- return adoptRef(recorder.endRecordingAsPicture());
+ return recorder.finishRecordingAsPicture();
}
} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.h b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.h
index 6550497..7a2db65 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.h
@@ -6,7 +6,7 @@
#define PaintArtifactToSkCanvas_h
#include "platform/PlatformExport.h"
-#include "wtf/PassRefPtr.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
class SkCanvas;
class SkPicture;
@@ -26,7 +26,7 @@ class PaintArtifact;
PLATFORM_EXPORT void paintArtifactToSkCanvas(const PaintArtifact&, SkCanvas*);
// Using the previous, converts the paint artifact to an SkPicture.
-PLATFORM_EXPORT PassRefPtr<SkPicture> paintArtifactToSkPicture(
+PLATFORM_EXPORT sk_sp<const SkPicture> paintArtifactToSkPicture(
const PaintArtifact&, const SkRect& bounds);
} // namespace blink
diff --git a/third_party/WebKit/Source/web/LinkHighlightImpl.cpp b/third_party/WebKit/Source/web/LinkHighlightImpl.cpp
index edb360a..7d8e6e6 100644
--- a/third_party/WebKit/Source/web/LinkHighlightImpl.cpp
+++ b/third_party/WebKit/Source/web/LinkHighlightImpl.cpp
@@ -273,8 +273,8 @@ void LinkHighlightImpl::paintContents(WebDisplayItemList* webDisplayItemList, We
paint.setColor(m_node->layoutObject()->style()->tapHighlightColor().rgb());
canvas->drawPath(m_path.getSkPath(), paint);
- RefPtr<const SkPicture> picture = adoptRef(recorder.endRecording());
- webDisplayItemList->appendDrawingItem(WebRect(visualRect.x(), visualRect.y(), visualRect.width(), visualRect.height()), picture.get());
+ webDisplayItemList->appendDrawingItem(WebRect(visualRect.x(), visualRect.y(),
+ visualRect.width(), visualRect.height()), recorder.finishRecordingAsPicture());
}
void LinkHighlightImpl::startHighlightAnimationIfNeeded()
diff --git a/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.cpp b/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.cpp
index 20225a1..52abc19 100644
--- a/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.cpp
+++ b/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.cpp
@@ -16,7 +16,7 @@ SimDisplayItemList::SimDisplayItemList()
{
}
-void SimDisplayItemList::appendDrawingItem(const WebRect&, const SkPicture* picture)
+void SimDisplayItemList::appendDrawingItem(const WebRect&, sk_sp<const SkPicture> picture)
{
m_containsText |= picture->hasText();
diff --git a/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.h b/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.h
index 4a7f1b93..d8136c9 100644
--- a/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.h
+++ b/third_party/WebKit/Source/web/tests/sim/SimDisplayItemList.h
@@ -15,7 +15,7 @@ class SimDisplayItemList final : public WebDisplayItemList {
public:
SimDisplayItemList();
- void appendDrawingItem(const WebRect&, const SkPicture*) override;
+ void appendDrawingItem(const WebRect&, sk_sp<const SkPicture>) override;
int drawCount() const { return m_commands.size(); }
diff --git a/third_party/WebKit/public/platform/WebDisplayItemList.h b/third_party/WebKit/public/platform/WebDisplayItemList.h
index e9dd954..b71d422 100644
--- a/third_party/WebKit/public/platform/WebDisplayItemList.h
+++ b/third_party/WebKit/public/platform/WebDisplayItemList.h
@@ -14,6 +14,7 @@
#include "third_party/skia/include/core/SkColorFilter.h"
#include "third_party/skia/include/core/SkRRect.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "third_party/skia/include/core/SkXfermode.h"
#include "third_party/skia/include/utils/SkMatrix44.h"
@@ -36,8 +37,7 @@ class WebDisplayItemList {
public:
virtual ~WebDisplayItemList() { }
- // This grabs a ref on the passed-in SkPicture.
- virtual void appendDrawingItem(const WebRect& visualRect, const SkPicture*) { }
+ virtual void appendDrawingItem(const WebRect& visualRect, sk_sp<const SkPicture>) { }
virtual void appendClipItem(const WebRect& visualRect, const WebRect& clipRect, const WebVector<SkRRect>& roundedClipRects) { }
virtual void appendEndClipItem(const WebRect& visualRect) { }
diff --git a/ui/compositor/paint_recorder.cc b/ui/compositor/paint_recorder.cc
index 3ed48a7..163a7a7 100644
--- a/ui/compositor/paint_recorder.cc
+++ b/ui/compositor/paint_recorder.cc
@@ -43,7 +43,7 @@ PaintRecorder::~PaintRecorder() {
const auto& item =
context_.list_->CreateAndAppendItem<cc::DrawingDisplayItem>(
bounds_in_layer_,
- skia::AdoptRef(context_.recorder_->endRecordingAsPicture()));
+ context_.recorder_->finishRecordingAsPicture());
if (cache_)
cache_->SetCache(item);
}