Changeset 239371 in webkit
- Timestamp:
- Dec 18, 2018 11:41:19 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r239369 r239371 1 2018-12-18 Zan Dobersek <zdobersek@igalia.com> 2 3 REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab 4 https://bugs.webkit.org/show_bug.cgi?id=192230 5 6 Reviewed by Carlos Garcia Campos. 7 8 Single tile can after r235165 be assigned multiple content updates 9 without a commit occurring between each update, whereas before these 10 commits were done for each update. 11 12 To avoid repeating updates for a single tile purging information about 13 the previous update, these updates are now accumulated inside a Vector 14 and then iterated over during the commit phase. 15 16 * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp: 17 (WebCore::CoordinatedBackingStoreTile::addUpdate): 18 (WebCore::CoordinatedBackingStoreTile::swapBuffers): 19 (WebCore::CoordinatedBackingStore::updateTile): 20 (WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted. 21 * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h: 22 (WebCore::CoordinatedBackingStoreTile::scale const): 23 1 24 2018-12-18 Wenson Hsieh <wenson_hsieh@apple.com> 2 25 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp
r234455 r239371 30 30 namespace WebCore { 31 31 32 void CoordinatedBackingStoreTile::addUpdate(Update&& update) 33 { 34 m_updates.append(WTFMove(update)); 35 } 36 32 37 void CoordinatedBackingStoreTile::swapBuffers(TextureMapper& textureMapper) 33 38 { 34 if (!m_buffer) 35 return; 39 auto updates = WTFMove(m_updates); 40 for (auto& update : updates) { 41 if (!update.buffer) 42 continue; 36 43 37 ASSERT(textureMapper.maxTextureSize().width() >= m_tileRect.size().width());38 ASSERT(textureMapper.maxTextureSize().height() >= m_tileRect.size().height());44 ASSERT(textureMapper.maxTextureSize().width() >= update.tileRect.size().width()); 45 ASSERT(textureMapper.maxTextureSize().height() >= update.tileRect.size().height()); 39 46 40 FloatRect unscaledTileRect(m_tileRect);41 unscaledTileRect.scale(1. / m_scale);47 FloatRect unscaledTileRect(update.tileRect); 48 unscaledTileRect.scale(1. / m_scale); 42 49 43 if (!m_texture || unscaledTileRect != rect()) {44 setRect(unscaledTileRect);45 m_texture = textureMapper.acquireTextureFromPool(m_tileRect.size(), m_buffer->supportsAlpha() ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);46 } else if (m_buffer->supportsAlpha() == m_texture->isOpaque())47 m_texture->reset(m_tileRect.size(), m_buffer->supportsAlpha());50 if (!m_texture || unscaledTileRect != rect()) { 51 setRect(unscaledTileRect); 52 m_texture = textureMapper.acquireTextureFromPool(update.tileRect.size(), update.buffer->supportsAlpha() ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag); 53 } else if (update.buffer->supportsAlpha() == m_texture->isOpaque()) 54 m_texture->reset(update.tileRect.size(), update.buffer->supportsAlpha()); 48 55 49 m_buffer->waitUntilPaintingComplete(); 50 m_texture->updateContents(m_buffer->data(), m_sourceRect, m_bufferOffset, m_buffer->stride()); 51 m_buffer = nullptr; 52 } 53 54 void CoordinatedBackingStoreTile::setBackBuffer(const IntRect& tileRect, const IntRect& sourceRect, RefPtr<Nicosia::Buffer>&& buffer, const IntPoint& offset) 55 { 56 m_sourceRect = sourceRect; 57 m_tileRect = tileRect; 58 m_bufferOffset = offset; 59 m_buffer = WTFMove(buffer); 56 update.buffer->waitUntilPaintingComplete(); 57 m_texture->updateContents(update.buffer->data(), update.sourceRect, update.bufferOffset, update.buffer->stride()); 58 update.buffer = nullptr; 59 } 60 60 } 61 61 … … 82 82 CoordinatedBackingStoreTileMap::iterator it = m_tiles.find(id); 83 83 ASSERT(it != m_tiles.end()); 84 it->value. setBackBuffer(tileRect, sourceRect, WTFMove(buffer), offset);84 it->value.addUpdate({ WTFMove(buffer), sourceRect, tileRect, offset }); 85 85 } 86 86 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.h
r234455 r239371 28 28 #include <wtf/HashSet.h> 29 29 #include <wtf/RefCounted.h> 30 #include <wtf/Vector.h> 30 31 31 32 namespace Nicosia { … … 43 44 } 44 45 45 inline float scale() const { return m_scale; } 46 float scale() const { return m_scale; } 47 48 struct Update { 49 RefPtr<Nicosia::Buffer> buffer; 50 IntRect sourceRect; 51 IntRect tileRect; 52 IntPoint bufferOffset; 53 }; 54 void addUpdate(Update&&); 55 46 56 void swapBuffers(TextureMapper&); 47 void setBackBuffer(const IntRect&, const IntRect&, RefPtr<Nicosia::Buffer>&&, const IntPoint&);48 57 49 58 private: 50 RefPtr<Nicosia::Buffer> m_buffer; 51 IntRect m_sourceRect; 52 IntRect m_tileRect; 53 IntPoint m_bufferOffset; 59 Vector<Update> m_updates; 54 60 float m_scale; 55 61 };
Note: See TracChangeset
for help on using the changeset viewer.