Diff
Modified: trunk/Source/WebCore/ChangeLog (225265 => 225266)
--- trunk/Source/WebCore/ChangeLog 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebCore/ChangeLog 2017-11-29 14:30:27 UTC (rev 225266)
@@ -1,3 +1,39 @@
+2017-11-29 Zan Dobersek <zdober...@igalia.com>
+
+ [CoordGraphics] Rename CoordinatedBuffer to Nicosia::Buffer
+ https://bugs.webkit.org/show_bug.cgi?id=180135
+
+ Reviewed by Carlos Garcia Campos.
+
+ Rename CoordinatedBuffer to Nicosia::Buffer, starting an abstraction
+ layer that will in the future allow us to prototype and potentially
+ support different 2D rasterization libraries. The layer is envisioned
+ as separate from the CoordinatedGraphics code, but will in the mid-term
+ only be used there.
+
+ In order to keep CMake changes to a minimum for now, the source code is
+ included in the build along with the CoordinatedGraphics source files,
+ in TextureMapper.cmake.
+
+ No new tests -- no change in functionality.
+
+ * platform/TextureMapper.cmake:
+ * platform/graphics/nicosia/NicosiaBuffer.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp.
+ (Nicosia::Buffer::create):
+ (Nicosia::Buffer::Buffer):
+ (Nicosia::Buffer::context):
+ (Nicosia::Buffer::uploadImage):
+ * platform/graphics/nicosia/NicosiaBuffer.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.h.
+ (Nicosia::Buffer::size const):
+ * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+ (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
+ * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
+ * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
+ * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
+ (WebCore::CoordinatedImageBacking::update):
+ * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
+ * platform/graphics/texmap/coordinated/Tile.h:
+
2017-11-29 Antoine Quint <grao...@apple.com>
Pressing the space bar while watching a fullscreen video doesn't play or pause
Modified: trunk/Source/WebCore/platform/TextureMapper.cmake (225265 => 225266)
--- trunk/Source/WebCore/platform/TextureMapper.cmake 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebCore/platform/TextureMapper.cmake 2017-11-29 14:30:27 UTC (rev 225266)
@@ -35,12 +35,19 @@
platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp
- platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp
platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
platform/graphics/texmap/coordinated/Tile.cpp
platform/graphics/texmap/coordinated/TiledBackingStore.cpp
)
+
+ # FIXME: Move this into Nicosia.cmake once the component is set for long-term use.
+ list(APPEND WebCore_INCLUDE_DIRECTORIES
+ "${WEBCORE_DIR}/platform/graphics/nicosia"
+ )
+ list(APPEND WebCore_SOURCES
+ platform/graphics/nicosia/NicosiaBuffer.cpp
+ )
else ()
list(APPEND WebCore_SOURCES
platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
Added: trunk/Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp (0 => 225266)
--- trunk/Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp (rev 0)
+++ trunk/Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp 2017-11-29 14:30:27 UTC (rev 225266)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2017 Metrological Group B.V.
+ * Copyright (C) 2017 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NicosiaBuffer.h"
+
+#include "ImageBuffer.h"
+
+namespace Nicosia {
+
+Ref<Buffer> Buffer::create(const WebCore::IntSize& size, Flags flags)
+{
+ return adoptRef(*new Buffer(size, flags));
+}
+
+Buffer::Buffer(const WebCore::IntSize& size, Flags flags)
+ : m_imageBuffer(WebCore::ImageBuffer::create(size, WebCore::Unaccelerated))
+ , m_size(size)
+ , m_flags(flags)
+{
+}
+
+Buffer::~Buffer() = default;
+
+WebCore::GraphicsContext& Buffer::context()
+{
+ return m_imageBuffer->context();
+}
+
+RefPtr<WebCore::Image> Buffer::uploadImage()
+{
+ return m_imageBuffer->copyImage(WebCore::DontCopyBackingStore);
+}
+
+} // namespace Nicosia
Added: trunk/Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.h (0 => 225266)
--- trunk/Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.h (rev 0)
+++ trunk/Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.h 2017-11-29 14:30:27 UTC (rev 225266)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2017 Metrological Group B.V.
+ * Copyright (C) 2017 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "IntSize.h"
+#include <wtf/RefPtr.h>
+#include <wtf/ThreadSafeRefCounted.h>
+
+namespace WebCore {
+class GraphicsContext;
+class Image;
+class ImageBuffer;
+}
+
+namespace Nicosia {
+
+class Buffer : public ThreadSafeRefCounted<Buffer> {
+public:
+ enum Flag {
+ NoFlags = 0,
+ SupportsAlpha = 1 << 0,
+ };
+ using Flags = unsigned;
+
+ static Ref<Buffer> create(const WebCore::IntSize&, Flags);
+ ~Buffer();
+
+ bool supportsAlpha() const { return m_flags & SupportsAlpha; }
+ const WebCore::IntSize& size() const { return m_size; }
+
+ WebCore::GraphicsContext& context();
+ RefPtr<WebCore::Image> uploadImage();
+
+private:
+ Buffer(const WebCore::IntSize&, Flags);
+
+ std::unique_ptr<WebCore::ImageBuffer> m_imageBuffer;
+ WebCore::IntSize m_size;
+ Flags m_flags;
+};
+
+} // namespace Nicosia
Deleted: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp (225265 => 225266)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp 2017-11-29 14:30:27 UTC (rev 225266)
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2017 Metrological Group B.V.
- * Copyright (C) 2017 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "CoordinatedBuffer.h"
-
-#if USE(COORDINATED_GRAPHICS)
-
-#include "ImageBuffer.h"
-
-namespace WebCore {
-
-Ref<CoordinatedBuffer> CoordinatedBuffer::create(const IntSize& size, Flags flags)
-{
- return adoptRef(*new CoordinatedBuffer(size, flags));
-}
-
-CoordinatedBuffer::CoordinatedBuffer(const IntSize& size, Flags flags)
- : m_imageBuffer(ImageBuffer::create(size, Unaccelerated))
- , m_size(size)
- , m_flags(flags)
-{
-}
-
-CoordinatedBuffer::~CoordinatedBuffer() = default;
-
-GraphicsContext& CoordinatedBuffer::context()
-{
- return m_imageBuffer->context();
-}
-
-RefPtr<Image> CoordinatedBuffer::uploadImage()
-{
- return m_imageBuffer->copyImage(DontCopyBackingStore);
-}
-
-} // namespace WebCore
-
-#endif // USE(COORDINATED_GRAPHICS)
Deleted: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.h (225265 => 225266)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.h 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.h 2017-11-29 14:30:27 UTC (rev 225266)
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2017 Metrological Group B.V.
- * Copyright (C) 2017 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if USE(COORDINATED_GRAPHICS)
-
-#include "IntSize.h"
-#include <wtf/RefPtr.h>
-#include <wtf/ThreadSafeRefCounted.h>
-
-namespace WebCore {
-
-class GraphicsContext;
-class Image;
-class ImageBuffer;
-
-class CoordinatedBuffer : public ThreadSafeRefCounted<CoordinatedBuffer> {
-public:
- enum Flag {
- NoFlags = 0,
- SupportsAlpha = 1 << 0,
- };
- using Flags = unsigned;
-
- static Ref<CoordinatedBuffer> create(const IntSize&, Flags);
- ~CoordinatedBuffer();
-
- bool supportsAlpha() const { return m_flags & SupportsAlpha; }
- const IntSize& size() const { return m_size; }
-
- GraphicsContext& context();
- RefPtr<Image> uploadImage();
-
-private:
- CoordinatedBuffer(const IntSize&, Flags);
-
- std::unique_ptr<ImageBuffer> m_imageBuffer;
- IntSize m_size;
- Flags m_flags;
-};
-
-} // namespace WebCore
-
-#endif // USE(COORDINATED_GRAPHICS)
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (225265 => 225266)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp 2017-11-29 14:30:27 UTC (rev 225266)
@@ -970,7 +970,7 @@
SurfaceUpdateInfo updateInfo;
IntRect targetRect;
auto coordinatedBuffer = m_coordinator->getCoordinatedBuffer(dirtyRect.size(),
- contentsOpaque() ? CoordinatedBuffer::NoFlags : CoordinatedBuffer::SupportsAlpha,
+ contentsOpaque() ? Nicosia::Buffer::NoFlags : Nicosia::Buffer::SupportsAlpha,
updateInfo.atlasID, targetRect);
{
GraphicsContext& context = coordinatedBuffer->context();
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h (225265 => 225266)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h 2017-11-29 14:30:27 UTC (rev 225266)
@@ -30,6 +30,7 @@
#include "GraphicsLayerTransform.h"
#include "Image.h"
#include "IntSize.h"
+#include "NicosiaBuffer.h"
#include "TextureMapperAnimation.h"
#include "TiledBackingStore.h"
#include "TiledBackingStoreClient.h"
@@ -47,7 +48,7 @@
virtual FloatRect visibleContentsRect() const = 0;
virtual Ref<CoordinatedImageBacking> createImageBackingIfNeeded(Image&) = 0;
virtual void detachLayer(CoordinatedGraphicsLayer*) = 0;
- virtual Ref<CoordinatedBuffer> getCoordinatedBuffer(const IntSize&, CoordinatedBuffer::Flags, uint32_t&, IntRect&) = 0;
+ virtual Ref<Nicosia::Buffer> getCoordinatedBuffer(const IntSize&, Nicosia::Buffer::Flags, uint32_t&, IntRect&) = 0;
virtual void syncLayerState(CoordinatedLayerID, CoordinatedGraphicsLayerState&) = 0;
};
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h (225265 => 225266)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h 2017-11-29 14:30:27 UTC (rev 225266)
@@ -36,6 +36,7 @@
#include "FloatSize.h"
#include "IntRect.h"
#include "IntSize.h"
+#include "NicosiaBuffer.h"
#include "SurfaceUpdateInfo.h"
#include "TextureMapperAnimation.h"
#include "TransformationMatrix.h"
@@ -46,8 +47,6 @@
namespace WebCore {
-class CoordinatedBuffer;
-
typedef uint32_t CoordinatedLayerID;
enum { InvalidCoordinatedLayerID = 0 };
@@ -191,10 +190,10 @@
Vector<CoordinatedImageBackingID> imagesToCreate;
Vector<CoordinatedImageBackingID> imagesToRemove;
- Vector<std::pair<CoordinatedImageBackingID, RefPtr<CoordinatedBuffer>>> imagesToUpdate;
+ Vector<std::pair<CoordinatedImageBackingID, RefPtr<Nicosia::Buffer>>> imagesToUpdate;
Vector<CoordinatedImageBackingID> imagesToClear;
- Vector<std::pair<uint32_t /* atlasID */, RefPtr<CoordinatedBuffer>>> updateAtlasesToCreate;
+ Vector<std::pair<uint32_t /* atlasID */, RefPtr<Nicosia::Buffer>>> updateAtlasesToCreate;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp (225265 => 225266)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp 2017-11-29 14:30:27 UTC (rev 225266)
@@ -24,12 +24,13 @@
*/
#include "config.h"
+#include "CoordinatedImageBacking.h"
#if USE(COORDINATED_GRAPHICS)
-#include "CoordinatedImageBacking.h"
#include "CoordinatedGraphicsState.h"
#include "GraphicsContext.h"
+#include "NicosiaBuffer.h"
namespace WebCore {
@@ -100,7 +101,7 @@
}
}
- m_buffer = CoordinatedBuffer::create(IntSize(m_image->size()), !m_image->currentFrameKnownToBeOpaque() ? CoordinatedBuffer::SupportsAlpha : CoordinatedBuffer::NoFlags);
+ m_buffer = Nicosia::Buffer::create(IntSize(m_image->size()), !m_image->currentFrameKnownToBeOpaque() ? Nicosia::Buffer::SupportsAlpha : Nicosia::Buffer::NoFlags);
ASSERT(m_buffer);
IntRect rect(IntPoint::zero(), IntSize(m_image->size()));
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.h (225265 => 225266)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.h 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.h 2017-11-29 14:30:27 UTC (rev 225266)
@@ -28,7 +28,7 @@
#define CoordinatedImageBacking_h
#if USE(COORDINATED_GRAPHICS)
-#include "CoordinatedBuffer.h"
+
#include "CoordinatedGraphicsState.h"
#include "Image.h"
#include "Timer.h"
@@ -35,6 +35,10 @@
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
+namespace Nicosia {
+class Buffer;
+}
+
namespace WebCore {
class CoordinatedImageBacking : public RefCounted<CoordinatedImageBacking> {
@@ -42,7 +46,7 @@
class Client {
public:
virtual void createImageBacking(CoordinatedImageBackingID) = 0;
- virtual void updateImageBacking(CoordinatedImageBackingID, RefPtr<CoordinatedBuffer>&&) = 0;
+ virtual void updateImageBacking(CoordinatedImageBackingID, RefPtr<Nicosia::Buffer>&&) = 0;
virtual void clearImageBackingContents(CoordinatedImageBackingID) = 0;
virtual void removeImageBacking(CoordinatedImageBackingID) = 0;
};
@@ -80,7 +84,7 @@
CoordinatedImageBackingID m_id;
Vector<Host*> m_hosts;
- RefPtr<CoordinatedBuffer> m_buffer;
+ RefPtr<Nicosia::Buffer> m_buffer;
Timer m_clearContentsTimer;
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/Tile.h (225265 => 225266)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/Tile.h 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/Tile.h 2017-11-29 14:30:27 UTC (rev 225266)
@@ -28,7 +28,6 @@
#if USE(COORDINATED_GRAPHICS)
-#include "CoordinatedBuffer.h"
#include "IntPoint.h"
#include "IntPointHash.h"
#include "IntRect.h"
Modified: trunk/Source/WebKit/ChangeLog (225265 => 225266)
--- trunk/Source/WebKit/ChangeLog 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebKit/ChangeLog 2017-11-29 14:30:27 UTC (rev 225266)
@@ -1,3 +1,30 @@
+2017-11-29 Zan Dobersek <zdober...@igalia.com>
+
+ [CoordGraphics] Rename CoordinatedBuffer to Nicosia::Buffer
+ https://bugs.webkit.org/show_bug.cgi?id=180135
+
+ Reviewed by Carlos Garcia Campos.
+
+ Adjust code to the CoordinatedBuffer -> Nicosia::Buffer transition.
+
+ * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
+ (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
+ (WebKit::CoordinatedBackingStore::updateTile):
+ * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+ (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
+ (WebKit::CoordinatedGraphicsScene::updateImageBacking):
+ * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
+ * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
+ (WebKit::CompositingCoordinator::updateImageBacking):
+ (WebKit::CompositingCoordinator::createUpdateAtlas):
+ (WebKit::CompositingCoordinator::getCoordinatedBuffer):
+ * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
+ * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
+ (WebKit::UpdateAtlas::UpdateAtlas):
+ (WebKit::UpdateAtlas::getCoordinatedBuffer):
+ * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
+
2017-11-28 Brent Fulgham <bfulg...@apple.com>
Adopt updated NSKeyed[Un]Archiver API when available
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp (225265 => 225266)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp 2017-11-29 14:30:27 UTC (rev 225266)
@@ -22,8 +22,8 @@
#if USE(COORDINATED_GRAPHICS)
-#include <WebCore/CoordinatedBuffer.h>
#include <WebCore/GraphicsLayer.h>
+#include <WebCore/NicosiaBuffer.h>
#include <WebCore/TextureMapper.h>
#include <WebCore/TextureMapperGL.h>
@@ -53,7 +53,7 @@
m_buffer = nullptr;
}
-void CoordinatedBackingStoreTile::setBackBuffer(const IntRect& tileRect, const IntRect& sourceRect, RefPtr<CoordinatedBuffer>&& buffer, const IntPoint& offset)
+void CoordinatedBackingStoreTile::setBackBuffer(const IntRect& tileRect, const IntRect& sourceRect, RefPtr<Nicosia::Buffer>&& buffer, const IntPoint& offset)
{
m_sourceRect = sourceRect;
m_tileRect = tileRect;
@@ -79,7 +79,7 @@
m_tilesToRemove.add(key);
}
-void CoordinatedBackingStore::updateTile(uint32_t id, const IntRect& sourceRect, const IntRect& tileRect, RefPtr<CoordinatedBuffer>&& buffer, const IntPoint& offset)
+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());
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h (225265 => 225266)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h 2017-11-29 14:30:27 UTC (rev 225266)
@@ -29,8 +29,8 @@
#include <wtf/HashSet.h>
-namespace WebCore {
-class CoordinatedBuffer;
+namespace Nicosia {
+class Buffer;
}
namespace WebKit {
@@ -45,10 +45,10 @@
inline float scale() const { return m_scale; }
void swapBuffers(WebCore::TextureMapper&);
- void setBackBuffer(const WebCore::IntRect&, const WebCore::IntRect&, RefPtr<WebCore::CoordinatedBuffer>&&, const WebCore::IntPoint&);
+ void setBackBuffer(const WebCore::IntRect&, const WebCore::IntRect&, RefPtr<Nicosia::Buffer>&&, const WebCore::IntPoint&);
private:
- RefPtr<WebCore::CoordinatedBuffer> m_buffer;
+ RefPtr<Nicosia::Buffer> m_buffer;
WebCore::IntRect m_sourceRect;
WebCore::IntRect m_tileRect;
WebCore::IntPoint m_bufferOffset;
@@ -60,7 +60,7 @@
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<WebCore::CoordinatedBuffer>&&, const WebCore::IntPoint&);
+ 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&);
RefPtr<WebCore::BitmapTexture> texture() const override;
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (225265 => 225266)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2017-11-29 14:30:27 UTC (rev 225266)
@@ -20,11 +20,12 @@
*/
#include "config.h"
+#include "CoordinatedGraphicsScene.h"
#if USE(COORDINATED_GRAPHICS)
-#include "CoordinatedGraphicsScene.h"
#include "CoordinatedBackingStore.h"
+#include <WebCore/NicosiaBuffer.h>
#include <WebCore/TextureMapper.h>
#include <WebCore/TextureMapperBackingStore.h>
#include <WebCore/TextureMapperGL.h>
@@ -438,7 +439,7 @@
createUpdateAtlas(atlas.first, atlas.second.copyRef());
}
-void CoordinatedGraphicsScene::createUpdateAtlas(uint32_t atlasID, RefPtr<CoordinatedBuffer>&& buffer)
+void CoordinatedGraphicsScene::createUpdateAtlas(uint32_t atlasID, RefPtr<Nicosia::Buffer>&& buffer)
{
ASSERT(!m_surfaces.contains(atlasID));
m_surfaces.add(atlasID, WTFMove(buffer));
@@ -477,7 +478,7 @@
m_imageBackings.add(imageID, CoordinatedBackingStore::create());
}
-void CoordinatedGraphicsScene::updateImageBacking(CoordinatedImageBackingID imageID, RefPtr<CoordinatedBuffer>&& buffer)
+void CoordinatedGraphicsScene::updateImageBacking(CoordinatedImageBackingID imageID, RefPtr<Nicosia::Buffer>&& buffer)
{
ASSERT(m_imageBackings.contains(imageID));
auto it = m_imageBackings.find(imageID);
Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h (225265 => 225266)
--- trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h 2017-11-29 14:30:27 UTC (rev 225266)
@@ -23,7 +23,6 @@
#if USE(COORDINATED_GRAPHICS)
-#include <WebCore/CoordinatedBuffer.h>
#include <WebCore/CoordinatedGraphicsState.h>
#include <WebCore/GraphicsContext.h>
#include <WebCore/GraphicsLayer.h>
@@ -45,6 +44,10 @@
#include <WebCore/TextureMapperPlatformLayerProxy.h>
#endif
+namespace Nicosia {
+class Buffer;
+}
+
namespace WebCore {
class TextureMapperGL;
}
@@ -108,12 +111,12 @@
void setLayerRepaintCountIfNeeded(WebCore::TextureMapperLayer*, const WebCore::CoordinatedGraphicsLayerState&);
void syncUpdateAtlases(const WebCore::CoordinatedGraphicsState&);
- void createUpdateAtlas(uint32_t atlasID, RefPtr<WebCore::CoordinatedBuffer>&&);
+ void createUpdateAtlas(uint32_t atlasID, RefPtr<Nicosia::Buffer>&&);
void removeUpdateAtlas(uint32_t atlasID);
void syncImageBackings(const WebCore::CoordinatedGraphicsState&);
void createImageBacking(WebCore::CoordinatedImageBackingID);
- void updateImageBacking(WebCore::CoordinatedImageBackingID, RefPtr<WebCore::CoordinatedBuffer>&&);
+ void updateImageBacking(WebCore::CoordinatedImageBackingID, RefPtr<Nicosia::Buffer>&&);
void clearImageBackingContents(WebCore::CoordinatedImageBackingID);
void removeImageBacking(WebCore::CoordinatedImageBackingID);
@@ -162,7 +165,7 @@
HashMap<WebCore::TextureMapperLayer*, RefPtr<WebCore::TextureMapperPlatformLayerProxy>> m_platformLayerProxies;
#endif
- HashMap<uint32_t /* atlasID */, RefPtr<WebCore::CoordinatedBuffer>> m_surfaces;
+ HashMap<uint32_t /* atlasID */, RefPtr<Nicosia::Buffer>> m_surfaces;
// Below two members are accessed by only the main thread. The painting thread must lock the main thread to access both members.
CoordinatedGraphicsSceneClient* m_client;
Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp (225265 => 225266)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp 2017-11-29 14:30:27 UTC (rev 225266)
@@ -224,7 +224,7 @@
m_state.imagesToCreate.append(imageID);
}
-void CompositingCoordinator::updateImageBacking(CoordinatedImageBackingID imageID, RefPtr<CoordinatedBuffer>&& buffer)
+void CompositingCoordinator::updateImageBacking(CoordinatedImageBackingID imageID, RefPtr<Nicosia::Buffer>&& buffer)
{
m_shouldSyncFrame = true;
m_state.imagesToUpdate.append(std::make_pair(imageID, WTFMove(buffer)));
@@ -284,7 +284,7 @@
return std::unique_ptr<GraphicsLayer>(layer);
}
-void CompositingCoordinator::createUpdateAtlas(UpdateAtlas::ID id, Ref<CoordinatedBuffer>&& buffer)
+void CompositingCoordinator::createUpdateAtlas(UpdateAtlas::ID id, Ref<Nicosia::Buffer>&& buffer)
{
m_state.updateAtlasesToCreate.append(std::make_pair(id, WTFMove(buffer)));
}
@@ -376,10 +376,10 @@
m_updateAtlases.clear();
}
-Ref<CoordinatedBuffer> CompositingCoordinator::getCoordinatedBuffer(const IntSize& size, CoordinatedBuffer::Flags flags, uint32_t& atlasID, IntRect& allocatedRect)
+Ref<Nicosia::Buffer> CompositingCoordinator::getCoordinatedBuffer(const IntSize& size, Nicosia::Buffer::Flags flags, uint32_t& atlasID, IntRect& allocatedRect)
{
for (auto& atlas : m_updateAtlases) {
- if (atlas->supportsAlpha() == (flags & CoordinatedBuffer::SupportsAlpha)) {
+ if (atlas->supportsAlpha() == (flags & Nicosia::Buffer::SupportsAlpha)) {
if (auto buffer = atlas->getCoordinatedBuffer(size, atlasID, allocatedRect))
return *buffer;
}
Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h (225265 => 225266)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h 2017-11-29 14:30:27 UTC (rev 225266)
@@ -30,7 +30,6 @@
#if USE(COORDINATED_GRAPHICS)
#include "UpdateAtlas.h"
-#include <WebCore/CoordinatedBuffer.h>
#include <WebCore/CoordinatedGraphicsLayer.h>
#include <WebCore/CoordinatedGraphicsState.h>
#include <WebCore/CoordinatedImageBacking.h>
@@ -38,9 +37,9 @@
#include <WebCore/GraphicsLayerClient.h>
#include <WebCore/GraphicsLayerFactory.h>
#include <WebCore/IntRect.h>
+#include <WebCore/NicosiaBuffer.h>
namespace WebCore {
-class CoordinatedBuffer;
class GraphicsContext;
class GraphicsLayer;
class Page;
@@ -105,7 +104,7 @@
// CoordinatedImageBacking::Client
void createImageBacking(WebCore::CoordinatedImageBackingID) override;
- void updateImageBacking(WebCore::CoordinatedImageBackingID, RefPtr<WebCore::CoordinatedBuffer>&&) override;
+ void updateImageBacking(WebCore::CoordinatedImageBackingID, RefPtr<Nicosia::Buffer>&&) override;
void clearImageBackingContents(WebCore::CoordinatedImageBackingID) override;
void removeImageBacking(WebCore::CoordinatedImageBackingID) override;
@@ -114,11 +113,11 @@
WebCore::FloatRect visibleContentsRect() const override;
Ref<WebCore::CoordinatedImageBacking> createImageBackingIfNeeded(WebCore::Image&) override;
void detachLayer(WebCore::CoordinatedGraphicsLayer*) override;
- Ref<WebCore::CoordinatedBuffer> getCoordinatedBuffer(const WebCore::IntSize&, WebCore::CoordinatedBuffer::Flags, uint32_t&, WebCore::IntRect&) override;
+ Ref<Nicosia::Buffer> getCoordinatedBuffer(const WebCore::IntSize&, Nicosia::Buffer::Flags, uint32_t&, WebCore::IntRect&) override;
void syncLayerState(WebCore::CoordinatedLayerID, WebCore::CoordinatedGraphicsLayerState&) override;
// UpdateAtlas::Client
- void createUpdateAtlas(UpdateAtlas::ID, Ref<WebCore::CoordinatedBuffer>&&) override;
+ void createUpdateAtlas(UpdateAtlas::ID, Ref<Nicosia::Buffer>&&) override;
void removeUpdateAtlas(UpdateAtlas::ID) override;
// GraphicsLayerFactory
Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp (225265 => 225266)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp 2017-11-29 14:30:27 UTC (rev 225266)
@@ -31,9 +31,9 @@
namespace WebKit {
-UpdateAtlas::UpdateAtlas(Client& client, const IntSize& size, CoordinatedBuffer::Flags flags)
+UpdateAtlas::UpdateAtlas(Client& client, const IntSize& size, Nicosia::Buffer::Flags flags)
: m_client(client)
- , m_buffer(CoordinatedBuffer::create(size, flags))
+ , m_buffer(Nicosia::Buffer::create(size, flags))
{
static ID s_nextID { 0 };
m_id = ++s_nextID;
@@ -59,7 +59,7 @@
m_areaAllocator = nullptr;
}
-RefPtr<CoordinatedBuffer> UpdateAtlas::getCoordinatedBuffer(const IntSize& size, uint32_t& atlasID, IntRect& allocatedRect)
+RefPtr<Nicosia::Buffer> UpdateAtlas::getCoordinatedBuffer(const IntSize& size, uint32_t& atlasID, IntRect& allocatedRect)
{
m_inactivityInSeconds = 0;
buildLayoutIfNeeded();
Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h (225265 => 225266)
--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h 2017-11-29 13:31:36 UTC (rev 225265)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h 2017-11-29 14:30:27 UTC (rev 225266)
@@ -21,7 +21,7 @@
#pragma once
#include "AreaAllocator.h"
-#include <WebCore/CoordinatedBuffer.h>
+#include <WebCore/NicosiaBuffer.h>
#include <wtf/RefPtr.h>
#if USE(COORDINATED_GRAPHICS)
@@ -41,16 +41,16 @@
class Client {
public:
- virtual void createUpdateAtlas(ID, Ref<WebCore::CoordinatedBuffer>&&) = 0;
+ virtual void createUpdateAtlas(ID, Ref<Nicosia::Buffer>&&) = 0;
virtual void removeUpdateAtlas(ID) = 0;
};
- UpdateAtlas(Client&, const WebCore::IntSize&, WebCore::CoordinatedBuffer::Flags);
+ UpdateAtlas(Client&, const WebCore::IntSize&, Nicosia::Buffer::Flags);
~UpdateAtlas();
const WebCore::IntSize& size() const { return m_buffer->size(); }
- RefPtr<WebCore::CoordinatedBuffer> getCoordinatedBuffer(const WebCore::IntSize&, uint32_t&, WebCore::IntRect&);
+ RefPtr<Nicosia::Buffer> getCoordinatedBuffer(const WebCore::IntSize&, uint32_t&, WebCore::IntRect&);
void didSwapBuffers();
bool supportsAlpha() const { return m_buffer->supportsAlpha(); }
@@ -72,7 +72,7 @@
ID m_id { 0 };
Client& m_client;
std::unique_ptr<GeneralAreaAllocator> m_areaAllocator;
- Ref<WebCore::CoordinatedBuffer> m_buffer;
+ Ref<Nicosia::Buffer> m_buffer;
double m_inactivityInSeconds { 0 };
};