+2014-12-23 Myles C. Maxfield <mmaxfield@apple.com>
+
+ [SVG -> OTF Converter] Make Placeholder a move-only type
+ https://bugs.webkit.org/show_bug.cgi?id=139870
+
+ Reviewed by Anders Carlsson.
+
+ No new tests because there is no behavior change.
+
+ * svg/SVGToOTFFontConversion.cpp:
+ (WebCore::SVGToOTFFontConverter::Placeholder::Placeholder):
+ (WebCore::SVGToOTFFontConverter::Placeholder::populate):
+ (WebCore::SVGToOTFFontConverter::Placeholder::~Placeholder):
+
2014-12-23 Chris Dumez <cdumez@apple.com>
Move color CSS properties to the new StyleBuilder
: m_converter(converter)
, m_baseOfOffset(baseOfOffset)
, m_location(m_converter.m_result.size())
+ {
+ m_converter.append16(0);
+ }
+
+ Placeholder(Placeholder&& other)
+ : m_converter(other.m_converter)
+ , m_baseOfOffset(other.m_baseOfOffset)
+ , m_location(other.m_location)
#if !ASSERT_DISABLED
- , m_written(false)
+ , m_active(other.m_active)
#endif
{
- m_converter.append16(0);
+#if !ASSERT_DISABLED
+ other.m_active = false;
+#endif
}
+
void populate()
{
- ASSERT(!m_written);
+ ASSERT(m_active);
size_t delta = m_converter.m_result.size() - m_baseOfOffset;
ASSERT(delta < std::numeric_limits<uint16_t>::max());
m_converter.overwrite16(m_location, delta);
#if !ASSERT_DISABLED
- m_written = true;
+ m_active = false;
#endif
}
+
~Placeholder()
{
- ASSERT(m_written);
+ ASSERT(!m_active);
}
+
private:
SVGToOTFFontConverter& m_converter;
const size_t m_baseOfOffset;
const size_t m_location;
#if !ASSERT_DISABLED
- bool m_written;
+ bool m_active = { true };
#endif
};