Source/WebCore/ChangeLog

 12020-03-03 Wenson Hsieh <wenson_hsieh@apple.com>
 2
 3 Address post-commit feedback after r257732
 4 https://bugs.webkit.org/show_bug.cgi?id=208265
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Remove the private initializeOrCopyPlatformPathIfNeeded() helper,
 9 and move its logic into ensurePlatformPath().
 10
 11 * platform/graphics/Path.h:
 12 * platform/graphics/cg/PathCG.cpp:
 13 (WebCore::Path::ensurePlatformPath):
 14 (WebCore::Path::initializeOrCopyPlatformPathIfNeeded): Deleted.
 15
1162020-03-03 Carlos Garcia Campos <cgarcia@igalia.com>
217
318 [GTK][WPE] Fix current time and duration formatting in media controls

Source/WebCore/platform/graphics/Path.h

@@public:
216216private:
217217#if USE(CG)
218218 void swap(Path&);
219  void initializeOrCopyPlatformPathIfNeeded();
220219#endif
221220
222221#if USE(DIRECT2D)

Source/WebCore/platform/graphics/cg/PathCG.cpp

@@Path::~Path()
100100
101101PlatformPathPtr Path::ensurePlatformPath()
102102{
103  initializeOrCopyPlatformPathIfNeeded();
 103 if (!m_path)
 104 m_path = CGPathCreateMutable();
 105 else if (m_copyPathBeforeMutation) {
 106 if (CFGetRetainCount(m_path) > 1) {
 107 auto pathToCopy = m_path;
 108 m_path = CGPathCreateMutableCopy(pathToCopy);
 109 CFRelease(pathToCopy);
 110 }
 111 m_copyPathBeforeMutation = false;
 112 }
104113 return m_path;
105114}
106115

@@void Path::swap(Path& otherPath)
126135 std::swap(m_copyPathBeforeMutation, otherPath.m_copyPathBeforeMutation);
127136}
128137
129 void Path::initializeOrCopyPlatformPathIfNeeded()
130 {
131  if (!m_path) {
132  m_path = CGPathCreateMutable();
133  return;
134  }
135 
136  if (m_copyPathBeforeMutation) {
137  if (CFGetRetainCount(m_path) > 1) {
138  auto pathToCopy = m_path;
139  m_path = CGPathCreateMutableCopy(pathToCopy);
140  CFRelease(pathToCopy);
141  }
142  m_copyPathBeforeMutation = false;
143  }
144 }
145 
146138Path& Path::operator=(const Path& other)
147139{
148140 Path copy { other };