Chromium Code Reviews| Index: src/pdf/SkPDFDevice.h |
| diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h |
| index d38f282bb0702c6bcbd31201f363eba662a65a1e..310807d86ec4e54c1525519c2e7959e9599cadc0 100644 |
| --- a/src/pdf/SkPDFDevice.h |
| +++ b/src/pdf/SkPDFDevice.h |
| @@ -202,18 +202,30 @@ protected: |
| private: |
| struct RectWithData { |
| SkRect rect; |
| - SkData* data; |
| + sk_sp<SkData> data; |
| RectWithData(const SkRect& rect, SkData* data) |
| : rect(rect), data(SkRef(data)) {} |
| - ~RectWithData() { data->unref(); } |
| + RectWithData(RectWithData&& other) |
|
reed1
2016/03/07 20:47:42
Seems like these are explicitly written (as oppose
|
| + : rect(other.rect), data(std::move(other.data)) {} |
| + RectWithData& operator=(RectWithData&& other) { |
| + rect = other.rect; |
| + data = std::move(other.data); |
| + return *this; |
| + } |
| }; |
| struct NamedDestination { |
| - SkData* nameData; |
| + sk_sp<SkData> nameData; |
| SkPoint point; |
| NamedDestination(SkData* nameData, const SkPoint& point) |
| : nameData(SkRef(nameData)), point(point) {} |
| - ~NamedDestination() { nameData->unref(); } |
| + NamedDestination(NamedDestination&& other) |
| + : nameData(std::move(other.nameData)), point(other.point) {} |
| + NamedDestination& operator=(NamedDestination&& other) { |
| + nameData = std::move(other.nameData); |
| + point = other.point; |
| + return *this; |
| + } |
| }; |
| // TODO(vandebo): push most of SkPDFDevice's state into a core object in |