Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.cpp

Issue 2335703002: Use sk_sp-based text blob APIs (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/Font.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/Font.cpp b/third_party/WebKit/Source/platform/fonts/Font.cpp
index 74b379a6b8a8358497ea29e3f8aaf880292464b2..59aac8597beb605fe758aae9e6b9084c0247db65 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -266,7 +266,7 @@ public:
bool done() const { return m_index >= m_buffer.size(); }
unsigned blobCount() const { return m_blobCount; }
- std::pair<sk_sp<const SkTextBlob>, BlobRotation> next()
+ std::pair<sk_sp<SkTextBlob>, BlobRotation> next()
{
ASSERT(!done());
const BlobRotation currentRotation = m_rotation;
@@ -291,7 +291,7 @@ public:
}
m_blobCount++;
- return std::make_pair(sk_sp<const SkTextBlob>(m_builder.build()), currentRotation);
+ return std::make_pair(m_builder.make(), currentRotation);
}
private:
@@ -350,7 +350,7 @@ void Font::drawGlyphBuffer(SkCanvas* canvas, const SkPaint& paint, const TextRun
const GlyphBuffer& glyphBuffer, const FloatPoint& point, float deviceScaleFactor) const
{
GlyphBufferBloberizer bloberizer(glyphBuffer, this, deviceScaleFactor);
- std::pair<sk_sp<const SkTextBlob>, BlobRotation> blob;
+ std::pair<sk_sp<SkTextBlob>, BlobRotation> blob;
while (!bloberizer.done()) {
blob = bloberizer.next();
@@ -365,7 +365,7 @@ void Font::drawGlyphBuffer(SkCanvas* canvas, const SkPaint& paint, const TextRun
canvas->concat(m);
}
- canvas->drawTextBlob(blob.first.get(), point.x(), point.y(), paint);
+ canvas->drawTextBlob(blob.first, point.x(), point.y(), paint);
}
// Cache results when
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/TextBlob.h » ('j') | third_party/WebKit/Source/platform/text/TextRun.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698