Diff
Modified: trunk/Source/WebCore/ChangeLog (234454 => 234455)
--- trunk/Source/WebCore/ChangeLog 2018-08-01 06:47:22 UTC (rev 234454)
+++ trunk/Source/WebCore/ChangeLog 2018-08-01 08:01:39 UTC (rev 234455)
@@ -1,3 +1,20 @@
+2018-08-01 Zan Dobersek <[email protected]>
+
+ [CoordGraphics] Move CoordinatedBackingStore to WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=188158
+
+ Reviewed by Carlos Garcia Campos.
+
+ Move the CoordinatedBackingStore class from WebKit to WebCore. It has no
+ dependency on anything in the WebKit layer, and it's more suitable to
+ future needs to keep it in the WebCore layer.
+
+ * platform/TextureMapper.cmake:
+ * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp.
+ * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h.
+ (WebCore::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile):
+ (WebCore::CoordinatedBackingStore::rect const):
+
2018-07-31 Myles C. Maxfield <[email protected]>
[WIN] Fix tests for text with initial advances
Modified: trunk/Source/WebCore/platform/TextureMapper.cmake (234454 => 234455)
--- trunk/Source/WebCore/platform/TextureMapper.cmake 2018-08-01 06:47:22 UTC (rev 234454)
+++ trunk/Source/WebCore/platform/TextureMapper.cmake 2018-08-01 08:01:39 UTC (rev 234455)
@@ -33,6 +33,7 @@
platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp
+ platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp
platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
platform/graphics/texmap/coordinated/Tile.cpp
Added: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp (0 => 234455)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp (rev 0)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp 2018-08-01 08:01:39 UTC (rev 234455)
@@ -0,0 +1,170 @@
+/*
+ Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "CoordinatedBackingStore.h"
+
+#if USE(COORDINATED_GRAPHICS)
+
+#include "GraphicsLayer.h"
+#include "NicosiaBuffer.h"
+#include "TextureMapper.h"
+#include "TextureMapperGL.h"
+
+namespace WebCore {
+
+void CoordinatedBackingStoreTile::swapBuffers(TextureMapper& textureMapper)
+{
+ if (!m_buffer)
+ return;
+
+ ASSERT(textureMapper.maxTextureSize().width() >= m_tileRect.size().width());
+ ASSERT(textureMapper.maxTextureSize().height() >= m_tileRect.size().height());
+
+ FloatRect unscaledTileRect(m_tileRect);
+ unscaledTileRect.scale(1. / m_scale);
+
+ if (!m_texture || unscaledTileRect != rect()) {
+ setRect(unscaledTileRect);
+ m_texture = textureMapper.acquireTextureFromPool(m_tileRect.size(), m_buffer->supportsAlpha() ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
+ } else if (m_buffer->supportsAlpha() == m_texture->isOpaque())
+ m_texture->reset(m_tileRect.size(), m_buffer->supportsAlpha());
+
+ m_buffer->waitUntilPaintingComplete();
+ m_texture->updateContents(m_buffer->data(), m_sourceRect, m_bufferOffset, m_buffer->stride());
+ m_buffer = nullptr;
+}
+
+void CoordinatedBackingStoreTile::setBackBuffer(const IntRect& tileRect, const IntRect& sourceRect, RefPtr<Nicosia::Buffer>&& buffer, const IntPoint& offset)
+{
+ m_sourceRect = sourceRect;
+ m_tileRect = tileRect;
+ m_bufferOffset = offset;
+ m_buffer = WTFMove(buffer);
+}
+
+void CoordinatedBackingStore::createTile(uint32_t id, float scale)
+{
+ m_tiles.add(id, CoordinatedBackingStoreTile(scale));
+ m_scale = scale;
+}
+
+void CoordinatedBackingStore::removeTile(uint32_t id)
+{
+ ASSERT(m_tiles.contains(id));
+ m_tilesToRemove.add(id);
+}
+
+void CoordinatedBackingStore::removeAllTiles()
+{
+ for (auto& key : m_tiles.keys())
+ m_tilesToRemove.add(key);
+}
+
+void CoordinatedBackingStore::updateTile(uint32_t id, const IntRect& sourceRect, const IntRect& tileRect, RefPtr<Nicosia::Buffer>&& buffer, const IntPoint& offset)
+{
+ CoordinatedBackingStoreTileMap::iterator it = m_tiles.find(id);
+ ASSERT(it != m_tiles.end());
+ it->value.setBackBuffer(tileRect, sourceRect, WTFMove(buffer), offset);
+}
+
+void CoordinatedBackingStore::setSize(const FloatSize& size)
+{
+ m_pendingSize = size;
+}
+
+void CoordinatedBackingStore::paintTilesToTextureMapper(Vector<TextureMapperTile*>& tiles, TextureMapper& textureMapper, const TransformationMatrix& transform, float opacity, const FloatRect& rect)
+{
+ for (auto& tile : tiles)
+ tile->paint(textureMapper, transform, opacity, calculateExposedTileEdges(rect, tile->rect()));
+}
+
+TransformationMatrix CoordinatedBackingStore::adjustedTransformForRect(const FloatRect& targetRect)
+{
+ return TransformationMatrix::rectToRect(rect(), targetRect);
+}
+
+void CoordinatedBackingStore::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
+{
+ if (m_tiles.isEmpty())
+ return;
+ ASSERT(!m_size.isZero());
+
+ Vector<TextureMapperTile*> tilesToPaint;
+ Vector<TextureMapperTile*> previousTilesToPaint;
+
+ // We have to do this every time we paint, in case the opacity has changed.
+ FloatRect coveredRect;
+ for (auto& tile : m_tiles.values()) {
+ if (!tile.texture())
+ continue;
+
+ if (tile.scale() == m_scale) {
+ tilesToPaint.append(&tile);
+ coveredRect.unite(tile.rect());
+ continue;
+ }
+
+ // Only show the previous tile if the opacity is high, otherwise effect looks like a bug.
+ // We show the previous-scale tile anyway if it doesn't intersect with any current-scale tile.
+ if (opacity < 0.95 && coveredRect.intersects(tile.rect()))
+ continue;
+
+ previousTilesToPaint.append(&tile);
+ }
+
+ // targetRect is on the contents coordinate system, so we must compare two rects on the contents coordinate system.
+ // See TiledBackingStore.
+ TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
+
+ paintTilesToTextureMapper(previousTilesToPaint, textureMapper, adjustedTransform, opacity, rect());
+ paintTilesToTextureMapper(tilesToPaint, textureMapper, adjustedTransform, opacity, rect());
+}
+
+void CoordinatedBackingStore::drawBorder(TextureMapper& textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
+{
+ TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
+ for (auto& tile : m_tiles.values())
+ textureMapper.drawBorder(borderColor, borderWidth, tile.rect(), adjustedTransform);
+}
+
+void CoordinatedBackingStore::drawRepaintCounter(TextureMapper& textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
+{
+ TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
+ for (auto& tile : m_tiles.values())
+ textureMapper.drawNumber(repaintCount, borderColor, tile.rect().location(), adjustedTransform);
+}
+
+void CoordinatedBackingStore::commitTileOperations(TextureMapper& textureMapper)
+{
+ if (!m_pendingSize.isZero()) {
+ m_size = m_pendingSize;
+ m_pendingSize = FloatSize();
+ }
+
+ for (auto& tileToRemove : m_tilesToRemove)
+ m_tiles.remove(tileToRemove);
+ m_tilesToRemove.clear();
+
+ for (auto& tile : m_tiles.values())
+ tile.swapBuffers(textureMapper);
+}
+
+} // namespace WebCore
+#endif // USE(COORDINATED_GRAPHICS)
Added: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.h (0 => 234455)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.h 2018-08-01 08:01:39 UTC (rev 234455)
@@ -0,0 +1,89 @@
+/*
+ Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+#if USE(COORDINATED_GRAPHICS)
+
+#include "TextureMapper.h"
+#include "TextureMapperBackingStore.h"
+#include "TextureMapperTile.h"
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/RefCounted.h>
+
+namespace Nicosia {
+class Buffer;
+}
+
+namespace WebCore {
+
+class CoordinatedBackingStoreTile : public TextureMapperTile {
+public:
+ explicit CoordinatedBackingStoreTile(float scale = 1)
+ : TextureMapperTile(FloatRect())
+ , m_scale(scale)
+ {
+ }
+
+ inline float scale() const { return m_scale; }
+ void swapBuffers(TextureMapper&);
+ void setBackBuffer(const IntRect&, const IntRect&, RefPtr<Nicosia::Buffer>&&, const IntPoint&);
+
+private:
+ RefPtr<Nicosia::Buffer> m_buffer;
+ IntRect m_sourceRect;
+ IntRect m_tileRect;
+ IntPoint m_bufferOffset;
+ float m_scale;
+};
+
+class CoordinatedBackingStore : public RefCounted<CoordinatedBackingStore>, public TextureMapperBackingStore {
+public:
+ void createTile(uint32_t tileID, float);
+ void removeTile(uint32_t tileID);
+ void removeAllTiles();
+ void updateTile(uint32_t tileID, const IntRect&, const IntRect&, RefPtr<Nicosia::Buffer>&&, const IntPoint&);
+ static Ref<CoordinatedBackingStore> create() { return adoptRef(*new CoordinatedBackingStore); }
+ void commitTileOperations(TextureMapper&);
+ void setSize(const FloatSize&);
+ void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float) override;
+ void drawBorder(TextureMapper&, const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) override;
+ void drawRepaintCounter(TextureMapper&, int repaintCount, const Color&, const FloatRect&, const TransformationMatrix&) override;
+
+private:
+ CoordinatedBackingStore()
+ : m_scale(1.)
+ { }
+ void paintTilesToTextureMapper(Vector<TextureMapperTile*>&, TextureMapper&, const TransformationMatrix&, float, const FloatRect&);
+ TransformationMatrix adjustedTransformForRect(const FloatRect&);
+ FloatRect rect() const { return FloatRect(FloatPoint::zero(), m_size); }
+
+ typedef HashMap<uint32_t, CoordinatedBackingStoreTile> CoordinatedBackingStoreTileMap;
+ CoordinatedBackingStoreTileMap m_tiles;
+ HashSet<uint32_t> m_tilesToRemove;
+ // FIXME: m_pendingSize should be removed after the following bug is fixed: https://bugs.webkit.org/show_bug.cgi?id=108294
+ FloatSize m_pendingSize;
+ FloatSize m_size;
+ float m_scale;
+};
+
+} // namespace WebKit
+
+#endif // USE(COORDINATED_GRAPHICS)
Modified: trunk/Source/WebKit/ChangeLog (234454 => 234455)
--- trunk/Source/WebKit/ChangeLog 2018-08-01 06:47:22 UTC (rev 234454)
+++ trunk/Source/WebKit/ChangeLog 2018-08-01 08:01:39 UTC (rev 234455)
@@ -1,3 +1,19 @@
+2018-08-01 Zan Dobersek <[email protected]>
+
+ [CoordGraphics] Move CoordinatedBackingStore to WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=188158
+
+ Reviewed by Carlos Garcia Campos.
+
+ Move the CoordinatedBackingStore class from WebKit to WebCore. It has no
+ dependency on anything in the WebKit layer, and it's more suitable to
+ future needs to keep it in the WebCore layer.
+
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
+ * SourcesGTK.txt:
+ * SourcesWPE.txt:
+
2018-07-31 Alex Christensen <[email protected]>
REGRESSION (r231107): MoviStar+ launches to a blank black screen
Deleted: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp (234454 => 234455)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp 2018-08-01 06:47:22 UTC (rev 234454)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp 2018-08-01 08:01:39 UTC (rev 234455)
@@ -1,171 +0,0 @@
-/*
- Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "CoordinatedBackingStore.h"
-
-#if USE(COORDINATED_GRAPHICS)
-
-#include <WebCore/GraphicsLayer.h>
-#include <WebCore/NicosiaBuffer.h>
-#include <WebCore/TextureMapper.h>
-#include <WebCore/TextureMapperGL.h>
-
-namespace WebKit {
-using namespace WebCore;
-
-void CoordinatedBackingStoreTile::swapBuffers(TextureMapper& textureMapper)
-{
- if (!m_buffer)
- return;
-
- ASSERT(textureMapper.maxTextureSize().width() >= m_tileRect.size().width());
- ASSERT(textureMapper.maxTextureSize().height() >= m_tileRect.size().height());
-
- FloatRect unscaledTileRect(m_tileRect);
- unscaledTileRect.scale(1. / m_scale);
-
- if (!m_texture || unscaledTileRect != rect()) {
- setRect(unscaledTileRect);
- m_texture = textureMapper.acquireTextureFromPool(m_tileRect.size(), m_buffer->supportsAlpha() ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
- } else if (m_buffer->supportsAlpha() == m_texture->isOpaque())
- m_texture->reset(m_tileRect.size(), m_buffer->supportsAlpha());
-
- m_buffer->waitUntilPaintingComplete();
- m_texture->updateContents(m_buffer->data(), m_sourceRect, m_bufferOffset, m_buffer->stride());
- m_buffer = nullptr;
-}
-
-void CoordinatedBackingStoreTile::setBackBuffer(const IntRect& tileRect, const IntRect& sourceRect, RefPtr<Nicosia::Buffer>&& buffer, const IntPoint& offset)
-{
- m_sourceRect = sourceRect;
- m_tileRect = tileRect;
- m_bufferOffset = offset;
- m_buffer = WTFMove(buffer);
-}
-
-void CoordinatedBackingStore::createTile(uint32_t id, float scale)
-{
- m_tiles.add(id, CoordinatedBackingStoreTile(scale));
- m_scale = scale;
-}
-
-void CoordinatedBackingStore::removeTile(uint32_t id)
-{
- ASSERT(m_tiles.contains(id));
- m_tilesToRemove.add(id);
-}
-
-void CoordinatedBackingStore::removeAllTiles()
-{
- for (auto& key : m_tiles.keys())
- m_tilesToRemove.add(key);
-}
-
-void CoordinatedBackingStore::updateTile(uint32_t id, const IntRect& sourceRect, const IntRect& tileRect, RefPtr<Nicosia::Buffer>&& buffer, const IntPoint& offset)
-{
- CoordinatedBackingStoreTileMap::iterator it = m_tiles.find(id);
- ASSERT(it != m_tiles.end());
- it->value.setBackBuffer(tileRect, sourceRect, WTFMove(buffer), offset);
-}
-
-void CoordinatedBackingStore::setSize(const FloatSize& size)
-{
- m_pendingSize = size;
-}
-
-void CoordinatedBackingStore::paintTilesToTextureMapper(Vector<TextureMapperTile*>& tiles, TextureMapper& textureMapper, const TransformationMatrix& transform, float opacity, const FloatRect& rect)
-{
- for (auto& tile : tiles)
- tile->paint(textureMapper, transform, opacity, calculateExposedTileEdges(rect, tile->rect()));
-}
-
-TransformationMatrix CoordinatedBackingStore::adjustedTransformForRect(const FloatRect& targetRect)
-{
- return TransformationMatrix::rectToRect(rect(), targetRect);
-}
-
-void CoordinatedBackingStore::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
-{
- if (m_tiles.isEmpty())
- return;
- ASSERT(!m_size.isZero());
-
- Vector<TextureMapperTile*> tilesToPaint;
- Vector<TextureMapperTile*> previousTilesToPaint;
-
- // We have to do this every time we paint, in case the opacity has changed.
- FloatRect coveredRect;
- for (auto& tile : m_tiles.values()) {
- if (!tile.texture())
- continue;
-
- if (tile.scale() == m_scale) {
- tilesToPaint.append(&tile);
- coveredRect.unite(tile.rect());
- continue;
- }
-
- // Only show the previous tile if the opacity is high, otherwise effect looks like a bug.
- // We show the previous-scale tile anyway if it doesn't intersect with any current-scale tile.
- if (opacity < 0.95 && coveredRect.intersects(tile.rect()))
- continue;
-
- previousTilesToPaint.append(&tile);
- }
-
- // targetRect is on the contents coordinate system, so we must compare two rects on the contents coordinate system.
- // See TiledBackingStore.
- TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
-
- paintTilesToTextureMapper(previousTilesToPaint, textureMapper, adjustedTransform, opacity, rect());
- paintTilesToTextureMapper(tilesToPaint, textureMapper, adjustedTransform, opacity, rect());
-}
-
-void CoordinatedBackingStore::drawBorder(TextureMapper& textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
-{
- TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
- for (auto& tile : m_tiles.values())
- textureMapper.drawBorder(borderColor, borderWidth, tile.rect(), adjustedTransform);
-}
-
-void CoordinatedBackingStore::drawRepaintCounter(TextureMapper& textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
-{
- TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
- for (auto& tile : m_tiles.values())
- textureMapper.drawNumber(repaintCount, borderColor, tile.rect().location(), adjustedTransform);
-}
-
-void CoordinatedBackingStore::commitTileOperations(TextureMapper& textureMapper)
-{
- if (!m_pendingSize.isZero()) {
- m_size = m_pendingSize;
- m_pendingSize = FloatSize();
- }
-
- for (auto& tileToRemove : m_tilesToRemove)
- m_tiles.remove(tileToRemove);
- m_tilesToRemove.clear();
-
- for (auto& tile : m_tiles.values())
- tile.swapBuffers(textureMapper);
-}
-
-} // namespace WebCore
-#endif // USE(COORDINATED_GRAPHICS)
Deleted: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h (234454 => 234455)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h 2018-08-01 06:47:22 UTC (rev 234454)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h 2018-08-01 08:01:39 UTC (rev 234455)
@@ -1,92 +0,0 @@
-/*
- Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
- */
-
-#ifndef CoordinatedBackingStore_h
-#define CoordinatedBackingStore_h
-
-#if USE(COORDINATED_GRAPHICS)
-
-#include <WebCore/TextureMapper.h>
-#include <WebCore/TextureMapperBackingStore.h>
-#include <WebCore/TextureMapperTile.h>
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/RefCounted.h>
-
-namespace Nicosia {
-class Buffer;
-}
-
-namespace WebKit {
-
-class CoordinatedBackingStoreTile : public WebCore::TextureMapperTile {
-public:
- explicit CoordinatedBackingStoreTile(float scale = 1)
- : WebCore::TextureMapperTile(WebCore::FloatRect())
- , m_scale(scale)
- {
- }
-
- inline float scale() const { return m_scale; }
- void swapBuffers(WebCore::TextureMapper&);
- void setBackBuffer(const WebCore::IntRect&, const WebCore::IntRect&, RefPtr<Nicosia::Buffer>&&, const WebCore::IntPoint&);
-
-private:
- RefPtr<Nicosia::Buffer> m_buffer;
- WebCore::IntRect m_sourceRect;
- WebCore::IntRect m_tileRect;
- WebCore::IntPoint m_bufferOffset;
- float m_scale;
-};
-
-class CoordinatedBackingStore : public RefCounted<CoordinatedBackingStore>, public WebCore::TextureMapperBackingStore {
-public:
- void createTile(uint32_t tileID, float);
- void removeTile(uint32_t tileID);
- void removeAllTiles();
- void updateTile(uint32_t tileID, const WebCore::IntRect&, const WebCore::IntRect&, RefPtr<Nicosia::Buffer>&&, const WebCore::IntPoint&);
- static Ref<CoordinatedBackingStore> create() { return adoptRef(*new CoordinatedBackingStore); }
- void commitTileOperations(WebCore::TextureMapper&);
- void setSize(const WebCore::FloatSize&);
- void paintToTextureMapper(WebCore::TextureMapper&, const WebCore::FloatRect&, const WebCore::TransformationMatrix&, float) override;
- void drawBorder(WebCore::TextureMapper&, const WebCore::Color&, float borderWidth, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) override;
- void drawRepaintCounter(WebCore::TextureMapper&, int repaintCount, const WebCore::Color&, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) override;
-
-private:
- CoordinatedBackingStore()
- : m_scale(1.)
- { }
- void paintTilesToTextureMapper(Vector<WebCore::TextureMapperTile*>&, WebCore::TextureMapper&, const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&);
- WebCore::TransformationMatrix adjustedTransformForRect(const WebCore::FloatRect&);
- WebCore::FloatRect rect() const { return WebCore::FloatRect(WebCore::FloatPoint::zero(), m_size); }
-
- typedef HashMap<uint32_t, CoordinatedBackingStoreTile> CoordinatedBackingStoreTileMap;
- CoordinatedBackingStoreTileMap m_tiles;
- HashSet<uint32_t> m_tilesToRemove;
- // FIXME: m_pendingSize should be removed after the following bug is fixed: https://bugs.webkit.org/show_bug.cgi?id=108294
- WebCore::FloatSize m_pendingSize;
- WebCore::FloatSize m_size;
- float m_scale;
-};
-
-} // namespace WebKit
-
-#endif // USE(COORDINATED_GRAPHICS)
-
-#endif // CoordinatedBackingStore_h
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (234454 => 234455)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2018-08-01 06:47:22 UTC (rev 234454)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2018-08-01 08:01:39 UTC (rev 234455)
@@ -24,7 +24,7 @@
#if USE(COORDINATED_GRAPHICS)
-#include "CoordinatedBackingStore.h"
+#include <WebCore/CoordinatedBackingStore.h>
#include <WebCore/NicosiaBuffer.h>
#include <WebCore/TextureMapper.h>
#include <WebCore/TextureMapperBackingStore.h>
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h (234454 => 234455)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h 2018-08-01 06:47:22 UTC (rev 234454)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h 2018-08-01 08:01:39 UTC (rev 234455)
@@ -49,13 +49,12 @@
}
namespace WebCore {
+class CoordinatedBackingStore;
class TextureMapperGL;
}
namespace WebKit {
-class CoordinatedBackingStore;
-
class CoordinatedGraphicsSceneClient {
public:
virtual ~CoordinatedGraphicsSceneClient() { }
@@ -93,8 +92,8 @@
CommitScope(CommitScope&) = delete;
CommitScope& operator=(const CommitScope&) = delete;
- Vector<RefPtr<CoordinatedBackingStore>> releasedImageBackings;
- HashSet<RefPtr<CoordinatedBackingStore>> backingStoresWithPendingBuffers;
+ Vector<RefPtr<WebCore::CoordinatedBackingStore>> releasedImageBackings;
+ HashSet<RefPtr<WebCore::CoordinatedBackingStore>> backingStoresWithPendingBuffers;
};
void setRootLayerID(WebCore::CoordinatedLayerID);
@@ -145,8 +144,8 @@
std::unique_ptr<WebCore::TextureMapper> m_textureMapper;
- HashMap<WebCore::CoordinatedImageBackingID, RefPtr<CoordinatedBackingStore>> m_imageBackings;
- HashMap<WebCore::TextureMapperLayer*, RefPtr<CoordinatedBackingStore>> m_backingStores;
+ HashMap<WebCore::CoordinatedImageBackingID, RefPtr<WebCore::CoordinatedBackingStore>> m_imageBackings;
+ HashMap<WebCore::TextureMapperLayer*, RefPtr<WebCore::CoordinatedBackingStore>> m_backingStores;
#if USE(COORDINATED_GRAPHICS_THREADED)
HashMap<WebCore::TextureMapperLayer*, RefPtr<WebCore::TextureMapperPlatformLayerProxy>> m_platformLayerProxies;
Modified: trunk/Source/WebKit/SourcesGTK.txt (234454 => 234455)
--- trunk/Source/WebKit/SourcesGTK.txt 2018-08-01 06:47:22 UTC (rev 234454)
+++ trunk/Source/WebKit/SourcesGTK.txt 2018-08-01 08:01:39 UTC (rev 234455)
@@ -70,7 +70,6 @@
Shared/API/glib/WebKitURIRequest.cpp @no-unify
Shared/API/glib/WebKitURIResponse.cpp @no-unify
-Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp
Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
Shared/CoordinatedGraphics/SimpleViewportController.cpp
Modified: trunk/Source/WebKit/SourcesWPE.txt (234454 => 234455)
--- trunk/Source/WebKit/SourcesWPE.txt 2018-08-01 06:47:22 UTC (rev 234454)
+++ trunk/Source/WebKit/SourcesWPE.txt 2018-08-01 08:01:39 UTC (rev 234455)
@@ -67,7 +67,6 @@
Shared/API/glib/WebKitURIRequest.cpp @no-unify
Shared/API/glib/WebKitURIResponse.cpp @no-unify
-Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp
Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
Shared/CoordinatedGraphics/SimpleViewportController.cpp