Title: [234644] trunk/Source/WebCore
Revision
234644
Author
[email protected]
Date
2018-08-07 02:08:49 -0700 (Tue, 07 Aug 2018)

Log Message

[Nicosia] Add Nicosia::CompositionLayerTextureMapperImpl
https://bugs.webkit.org/show_bug.cgi?id=188348

Reviewed by Carlos Garcia Campos.

Add the Nicosia::CompositionLayerTextureMapperImpl class, the
TextureMapper-specific implementation that will extend the
CompositionLayer class.

The important deatil of this implementation is the TextureMapperLayer
object that's expected to be managed by the composition controller. As
such, it is placed inside the CompositionState struct to clearly
indicate its utility and expected place of management. In the current
setup, this place would be the CoordinatedGraphicsScene class.

The Nicosia::CompositionLayer object that's spawned for each
CoordinatedGraphicsLayer instance is now switched to using the
CompositionLayerTextureMapperImpl object, with the local temporary no-op
CompositionLayer::Impl class removed.

* platform/TextureMapper.cmake:
* platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp: Added.
(Nicosia::CompositionLayerTextureMapperImpl::createFactory):
* platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h: Added.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(): Deleted.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (234643 => 234644)


--- trunk/Source/WebCore/ChangeLog	2018-08-07 09:03:57 UTC (rev 234643)
+++ trunk/Source/WebCore/ChangeLog	2018-08-07 09:08:49 UTC (rev 234644)
@@ -1,5 +1,35 @@
 2018-08-07  Zan Dobersek  <[email protected]>
 
+        [Nicosia] Add Nicosia::CompositionLayerTextureMapperImpl
+        https://bugs.webkit.org/show_bug.cgi?id=188348
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add the Nicosia::CompositionLayerTextureMapperImpl class, the
+        TextureMapper-specific implementation that will extend the
+        CompositionLayer class.
+
+        The important deatil of this implementation is the TextureMapperLayer
+        object that's expected to be managed by the composition controller. As
+        such, it is placed inside the CompositionState struct to clearly
+        indicate its utility and expected place of management. In the current
+        setup, this place would be the CoordinatedGraphicsScene class.
+
+        The Nicosia::CompositionLayer object that's spawned for each
+        CoordinatedGraphicsLayer instance is now switched to using the
+        CompositionLayerTextureMapperImpl object, with the local temporary no-op
+        CompositionLayer::Impl class removed.
+
+        * platform/TextureMapper.cmake:
+        * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp: Added.
+        (Nicosia::CompositionLayerTextureMapperImpl::createFactory):
+        * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h: Added.
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
+        (): Deleted.
+
+2018-08-07  Zan Dobersek  <[email protected]>
+
         [Nicosia] Add the TextureMapper-specific ContentLayer::Impl derivative
         https://bugs.webkit.org/show_bug.cgi?id=188344
 

Modified: trunk/Source/WebCore/platform/TextureMapper.cmake (234643 => 234644)


--- trunk/Source/WebCore/platform/TextureMapper.cmake	2018-08-07 09:03:57 UTC (rev 234643)
+++ trunk/Source/WebCore/platform/TextureMapper.cmake	2018-08-07 09:08:49 UTC (rev 234644)
@@ -44,6 +44,7 @@
     list(APPEND WebCore_INCLUDE_DIRECTORIES
         "${WEBCORE_DIR}/platform/graphics/nicosia"
         "${WEBCORE_DIR}/platform/graphics/nicosia/cairo"
+        "${WEBCORE_DIR}/platform/graphics/nicosia/texmap"
     )
     list(APPEND WebCore_SOURCES
         platform/graphics/nicosia/NicosiaBuffer.cpp
@@ -57,6 +58,7 @@
         platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp
         platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp
 
+        platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp
         platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp
     )
 else ()

Added: trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp (0 => 234644)


--- trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp	2018-08-07 09:08:49 UTC (rev 234644)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2018 Metrological Group B.V.
+ * Copyright (C) 2018 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 "NicosiaCompositionLayerTextureMapperImpl.h"
+
+#if USE(TEXTURE_MAPPER)
+
+#include "TextureMapperLayer.h"
+
+namespace Nicosia {
+
+auto CompositionLayerTextureMapperImpl::createFactory() -> Factory
+{
+    return Factory(
+        [](uint64_t, CompositionLayer&) {
+            return std::make_unique<CompositionLayerTextureMapperImpl>();
+        });
+}
+
+CompositionLayerTextureMapperImpl::CompositionLayerTextureMapperImpl() = default;
+CompositionLayerTextureMapperImpl::~CompositionLayerTextureMapperImpl() = default;
+
+} // namespace Nicosia
+
+#endif // USE(TEXTURE_MAPPER)

Added: trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h (0 => 234644)


--- trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h	2018-08-07 09:08:49 UTC (rev 234644)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2018 Metrological Group B.V.
+ * Copyright (C) 2018 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(TEXTURE_MAPPER)
+
+#include "NicosiaPlatformLayer.h"
+#include <memory>
+
+namespace WebCore {
+class TextureMapperLayer;
+}
+
+namespace Nicosia {
+
+class CompositionLayerTextureMapperImpl final : public CompositionLayer::Impl {
+public:
+    static Factory createFactory();
+
+    CompositionLayerTextureMapperImpl();
+    virtual ~CompositionLayerTextureMapperImpl();
+    bool isTextureMapperImpl() const override { return true; }
+
+    struct CompositionState {
+        std::unique_ptr<WebCore::TextureMapperLayer> layer;
+    };
+    CompositionState& compositionState() { return m_compositionState; }
+
+private:
+    CompositionState m_compositionState;
+};
+
+} // namespace Nicosia
+
+SPECIALIZE_TYPE_TRAITS_NICOSIA_COMPOSITIONLAYER_IMPL(CompositionLayerTextureMapperImpl, isTextureMapperImpl());
+
+#endif // USE(TEXTURE_MAPPER)

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (234643 => 234644)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2018-08-07 09:03:57 UTC (rev 234643)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2018-08-07 09:08:49 UTC (rev 234644)
@@ -30,6 +30,7 @@
 #include "GraphicsContext.h"
 #include "GraphicsLayer.h"
 #include "GraphicsLayerFactory.h"
+#include "NicosiaCompositionLayerTextureMapperImpl.h"
 #include "NicosiaPaintingEngine.h"
 #include "ScrollableArea.h"
 #include "TextureMapperPlatformLayerProxyProvider.h"
@@ -121,13 +122,6 @@
     setShouldUpdateVisibleRect();
 }
 
-// FIXME: this is a temporary helper class to keep Nicosia::CompositionLayer creation working.
-class CompositionLayerNoopImpl final : public Nicosia::CompositionLayer::Impl {
-public:
-    CompositionLayerNoopImpl() = default;
-    virtual ~CompositionLayerNoopImpl() = default;
-};
-
 CoordinatedGraphicsLayer::CoordinatedGraphicsLayer(Type layerType, GraphicsLayerClient& client)
     : GraphicsLayer(layerType, client)
 #ifndef NDEBUG
@@ -155,10 +149,7 @@
     m_id = nextLayerID++;
 
     m_nicosia.layer = Nicosia::CompositionLayer::create(m_id,
-        [](uint64_t, Nicosia::CompositionLayer&)
-        {
-            return std::make_unique<CompositionLayerNoopImpl>();
-        });
+        Nicosia::CompositionLayerTextureMapperImpl::createFactory());
 }
 
 CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to