WebKit Bugzilla
Attachment 347255 Details for
Bug 188550
: [Nicosia] Add Nicosia::ImageBackingTextureMapperImpl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188550-20180816123849.patch (text/plain), 10.56 KB, created by
Zan Dobersek
on 2018-08-16 03:38:51 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Zan Dobersek
Created:
2018-08-16 03:38:51 PDT
Size:
10.56 KB
patch
obsolete
>Subversion Revision: 234915 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6033253ffbd476951c9c06a6ec13e193405e770e..7b608c7b17aa565e554be02b55b9bbfa53e2ecbe 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,50 @@ >+2018-08-16 Zan Dobersek <zdobersek@igalia.com> >+ >+ [Nicosia] Add Nicosia::ImageBackingTextureMapperImpl >+ https://bugs.webkit.org/show_bug.cgi?id=188550 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add the Nicosia::ImageBackingTextureMapperImpl class, the >+ TextureMapper-specific implementation that will extend the ImageBacking >+ class. >+ >+ This class will be used to contain and manage updates for layers that >+ are backed by image objects. The CoordinatedGraphicsLayer instance will >+ use the LayerState object to track the currently-presented image objects >+ and to store the latest update of these objects. The Update struct >+ contains information about the current visibility of the image in the >+ layer tree as well as the Nicosia::Buffer object containing the painted >+ image data that's to be presented on the screen. >+ >+ During the layer flush the flushUpdate() method will move the current >+ update data into the pending position, from which this data will be >+ gathered by the composition component through the takeUpdate() method >+ and used to update the CoordinatedBackingStore object that's kept in >+ the CompositionState object on this impl class. >+ >+ This will be deployed for use in the CoordinatedGraphicsLayer at a later >+ stage as it requires a larger rework in both CoordinatedGraphicsLayer as >+ well as the CoordinatedGraphicsScene classes. >+ >+ The implementation itself differs from the current image backing support >+ in CoordinatedGraphicsLayer and CompositingCoordinator by abandoning the >+ idea of sharing single image backings between layers that might be >+ backed by identical Image objects. We thus end up trading any memory >+ consumption benefit in these scenarios for a much simplified >+ implementation. Overall this area needs more research both in figuring >+ out whether there's worthy improvements in grouping image backings, as >+ well as investigating whether it's possible to avoid additional image >+ rasterization by just leveraging direct pixel data via the >+ NativeImagePtr object. >+ >+ * platform/TextureMapper.cmake: >+ * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: Added. >+ (Nicosia::ImageBackingTextureMapperImpl::createFactory): >+ (Nicosia::ImageBackingTextureMapperImpl::flushUpdate): >+ (Nicosia::ImageBackingTextureMapperImpl::takeUpdate): >+ * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h: Added. >+ > 2018-08-15 Ansh Shukla <ansh_shukla@apple.com> > > NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault >diff --git a/Source/WebCore/platform/TextureMapper.cmake b/Source/WebCore/platform/TextureMapper.cmake >index 9572f3dacbba81a0c3cce8daa03c05c95217ab29..4b49962360a9f3ad4b9b2240de03dcea7c827495 100644 >--- a/Source/WebCore/platform/TextureMapper.cmake >+++ b/Source/WebCore/platform/TextureMapper.cmake >@@ -62,6 +62,7 @@ if (USE_COORDINATED_GRAPHICS) > platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp > platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp > platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp >+ platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp > ) > else () > list(APPEND WebCore_SOURCES >diff --git a/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp b/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..a2ae34a31327e8715654146d18f77c7a67f24216 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp >@@ -0,0 +1,61 @@ >+/* >+ * 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 "NicosiaImageBackingTextureMapperImpl.h" >+ >+#if USE(TEXTURE_MAPPER) >+ >+namespace Nicosia { >+ >+auto ImageBackingTextureMapperImpl::createFactory() -> Factory >+{ >+ return Factory( >+ [](ImageBacking&) { >+ return std::make_unique<ImageBackingTextureMapperImpl>(); >+ }); >+} >+ >+ImageBackingTextureMapperImpl::ImageBackingTextureMapperImpl() = default; >+ImageBackingTextureMapperImpl::~ImageBackingTextureMapperImpl() = default; >+ >+void ImageBackingTextureMapperImpl::flushUpdate() >+{ >+ LockHolder locker(m_update.lock); >+ m_update.update = WTFMove(m_layerState.update); >+} >+ >+auto ImageBackingTextureMapperImpl::takeUpdate() -> Update >+{ >+ LockHolder locker(m_update.lock); >+ return WTFMove(m_update.update); >+} >+ >+} // namespace Nicosia >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h b/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h >new file mode 100644 >index 0000000000000000000000000000000000000000..1a623afa4093b22ac20d13b32936083acb08ea80 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h >@@ -0,0 +1,110 @@ >+/* >+ * 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 "CoordinatedBackingStore.h" >+#include "NicosiaBuffer.h" >+#include "NicosiaPlatformLayer.h" >+#include <wtf/Lock.h> >+ >+namespace WebCore { >+class Image; >+} >+ >+namespace Nicosia { >+ >+class ImageBackingTextureMapperImpl final : public ImageBacking::Impl { >+public: >+ static Factory createFactory(); >+ >+ ImageBackingTextureMapperImpl(); >+ virtual ~ImageBackingTextureMapperImpl(); >+ bool isTextureMapperImpl() const override { return true; } >+ >+ // A move-only update container. >+ struct Update { >+ Update() = default; >+ Update(const Update&) = delete; >+ Update& operator=(const Update&) = delete; >+ Update(Update&&) = default; >+ Update& operator=(Update&&) = default; >+ >+ bool isVisible { false }; >+ RefPtr<Nicosia::Buffer> buffer; >+ }; >+ >+ // An immutable layer-side state object. flushUpdate() prepares >+ // the current update for consumption by the composition-side. >+ struct LayerState { >+ LayerState() = default; >+ LayerState(const LayerState&) = delete; >+ LayerState& operator=(const LayerState&) = delete; >+ LayerState(LayerState&&) = delete; >+ LayerState& operator=(LayerState&&) = delete; >+ >+ uintptr_t imageID { 0 }; >+ uintptr_t nativeImageID { 0 }; >+ Update update; >+ }; >+ LayerState& layerState() { return m_layerState; } >+ >+ void flushUpdate(); >+ >+ // An immutable composition-side state object. takeUpdate() returns the update >+ // information that's to be fed to the CoordinatedBackingStore object. >+ struct CompositionState { >+ CompositionState() = default; >+ CompositionState(const CompositionState&) = delete; >+ CompositionState& operator=(const CompositionState&) = delete; >+ CompositionState(CompositionState&&) = delete; >+ CompositionState& operator=(CompositionState&&) = delete; >+ >+ RefPtr<WebCore::CoordinatedBackingStore> backingStore; >+ }; >+ CompositionState& compositionState() { return m_compositionState; } >+ >+ Update takeUpdate(); >+ >+private: >+ LayerState m_layerState; >+ CompositionState m_compositionState; >+ >+ struct { >+ Lock lock; >+ Update update; >+ } m_update; >+}; >+ >+} // namespace Nicosia >+ >+SPECIALIZE_TYPE_TRAITS_NICOSIA_IMAGEBACKING_IMPL(ImageBackingTextureMapperImpl, isTextureMapperImpl()); >+ >+#endif // USE(TEXTURE_MAPPER)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188550
:
347255
|
347256