diff options
author | Brian Salomon <bsalomon@google.com> | 2017-02-06 14:11:51 -0500 |
---|---|---|
committer | Brian Salomon <bsalomon@google.com> | 2017-02-06 19:59:02 +0000 |
commit | 604c9890cc55a150591ae52fe0c34e759d6a5ebb (patch) | |
tree | c67cf791b82785f6df467a4d19b2e85330ed08de /src/gpu | |
parent | 8a945603e44d8a9fdb2004231c76a41a22f9b6ff (diff) |
Work around broken std::unique_ptr<const T[]> constructor from std::unique_ptr<T>&& in older libstdc++.
Change-Id: Ie4190800369515168203ff98b3e3fe0e2d790f1a
Reviewed-on: https://skia-review.googlesource.com/8072
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/ops/GrDrawVerticesOp.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp index 7420a5275a..fd49face0e 100644 --- a/src/gpu/ops/GrDrawVerticesOp.cpp +++ b/src/gpu/ops/GrDrawVerticesOp.cpp @@ -39,13 +39,19 @@ std::unique_ptr<GrDrawOp> GrDrawVerticesOp::Make( } static constexpr SkCanvas::VertexMode kIgnoredMode = SkCanvas::kTriangles_VertexMode; sk_sp<SkVertices> vertices; + // Older libstdc++ does not allow moving a std::unique_ptr<T[]> into a + // std::unique_ptr<const T[]>. Hence the release() calls below. if (indices) { - vertices = SkVertices::MakeIndexed(kIgnoredMode, std::move(pos), std::move(col), - std::move(lc), - vertexCount, std::move(idx), indexCount, bounds); + vertices = SkVertices::MakeIndexed( + kIgnoredMode, std::unique_ptr<const SkPoint[]>((const SkPoint*)pos.release()), + std::unique_ptr<const SkColor[]>(col.release()), + std::unique_ptr<const SkPoint[]>(lc.release()), vertexCount, + std::unique_ptr<const uint16_t[]>(idx.release()), indexCount, bounds); } else { - vertices = SkVertices::Make(kIgnoredMode, std::move(pos), std::move(col), std::move(lc), - vertexCount, bounds); + vertices = SkVertices::Make(kIgnoredMode, std::unique_ptr<const SkPoint[]>(pos.release()), + std::unique_ptr<const SkColor[]>(col.release()), + std::unique_ptr<const SkPoint[]>(lc.release()), vertexCount, + bounds); } if (!vertices) { return nullptr; |