[webkit-changes] [295735] trunk/Source/WebKit/WebProcess/GPU/graphics/ RemoteRenderingBackendProxy.cpp

2022-06-22 Thread mmaxfield
Title: [295735] trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp








Revision 295735
Author mmaxfi...@apple.com
Date 2022-06-22 10:13:56 -0700 (Wed, 22 Jun 2022)


Log Message
[GPUP] Avoid race in GPUP teardown
https://bugs.webkit.org/show_bug.cgi?id=241770

Reviewed by Simon Fraser.

When there's a low memory warning, the GPU process runs GPUProcess::tryExitIfUnused(), which sends a message
to the UI process to kill the GPU process. The Web process notices this, and runs
RemoteRenderingBackendProxy::disconnectGPUProcess(), which doesn't destroy the RemoteRenderingBackendProxy,
but does set it's internal m_gpuProcessConnection to nullptr.

However, we may be in the middle of a rendering update in the web process. If there's a rendering update
pending, WebPage::finalizeRenderingUpdate() runs, which calls finalizeRenderingUpdate() on the
RemoteRenderingBackendProxy if it exists, which then immediately tries to send a stream message to the GPU
process. Sending a message to the GPU process of course runs ensureGPUProcessConnection() to lazily create
the GPU process.

Therefore, if the low memory warning happens in the middle of a rendering update, the GPU process is killed,
but then it is immediately respawned, just to do 0 work and live forever. This is contrary to the point of
killing the GPU process under memory pressure.

This patch changes the logic of RemoteRenderingBackendProxy::finalizeRenderingUpdate() to avoid restarting
the GPU Process if the connection to it is destroyed. Philosophically, it doesn't make much sense for the
_finalization_ routine of a rendering update to start up the whole GPU process. If we're in the middle of an
animation or something, the GPU process probably won't get killed (because it isn't idle), but even if it does,
the next frame of the animation will start up the GPU process again. This patch just modifies the behavior of
the finalization routine.

I hit this when working on https://github.com/WebKit/WebKit/pull/1464. With this patch applied, the failure
rate of GPUProcess.ExitsUnderMemoryPressureCanvasCase goes from 60% to 0%.

Test: GPUProcess.ExitsUnderMemoryPressureCanvasCase

* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::finalizeRenderingUpdate):

Canonical link: https://commits.webkit.org/251740@main

Modified Paths

trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp




Diff

Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp (295734 => 295735)

--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp	2022-06-22 17:11:51 UTC (rev 295734)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp	2022-06-22 17:13:56 UTC (rev 295735)
@@ -396,6 +396,8 @@
 
 void RemoteRenderingBackendProxy::finalizeRenderingUpdate()
 {
+if (!m_gpuProcessConnection)
+return;
 sendToStream(Messages::RemoteRenderingBackend::FinalizeRenderingUpdate(m_renderingUpdateID));
 m_remoteResourceCacheProxy.finalizeRenderingUpdate();
 m_renderingUpdateID.increment();






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295476] trunk

2022-06-11 Thread mmaxfield
Title: [295476] trunk








Revision 295476
Author mmaxfi...@apple.com
Date 2022-06-11 16:44:42 -0700 (Sat, 11 Jun 2022)


Log Message
Delay system font shorthand resolution until after parsing
https://bugs.webkit.org/show_bug.cgi?id=241454

Reviewed by Antti Koivisto.

This is the fifth piece of https://bugs.webkit.org/show_bug.cgi?id=237817, and is the main crux
of the fix to that bug. When content says something like "font: caption" or "font: -apple-system-body"
we have to map that to CSS properties like font-size and font-weight, so inheritance works properly
across different elements. On iOS, system settings can affect this mapping. Before this patch, we
were performing this mapping inside the parser, which is wrong because we'll never re-parse things
in response to a change in the environment. So, if the page is live, and then the user changes a setting
in system preferences, we won't re-parse, which means the page won't update to accomodate the new setting
the user changed.

This patch changes the parser to not do this mapping, but instead just to emit CSSValues which directly
and simply represent the value that was present in the CSS source itself. So, if the content says
"font: caption" we'll create CSSPrimitiveValues which just hold "caption" and use that for all the longhands
of the font property. Then, we do the mapping when the values are applied, inside StyleBuilder. StyleBuilder
is re-run in response to environment changes, so this piece is necessary for system settings to immediately
take effect without a reload of the page.

This change is web-exposed, because the contents of CSSValues are exposed to webpages via inspecting the
CSSStyleSheet in _javascript_. So, the change is a little scary, but I think it's the only way to have the
right thing happen with system settings.

This patch also deletes the now-unused system font shorthand cache, which was reimplemented in
https://github.com/WebKit/WebKit/commit/10cdfcb983187328f4229d5812a0da2a4210e4ef.

This patch isn't sufficient to make system settings fully work - there are some follow-up patches which
are still necessary on top of this:
1. Have font creation code actually interrogate system settings, and react accordingly, to create fonts
   with the appropriate size/weight
2. Make sure the right things get invalidated, so we don't get erroneous cache hits when system settings
   change
3. Make sure the right events are being delivered to the right places, and triggering the right invalidation,
   in response to system settings being changed.

* LayoutTests/fast/text/font-shorthand-resolution-expected.txt: Added.
* LayoutTests/fast/text/font-shorthand-resolution.html: Added.
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeSystemFont):
(WebCore::CSSPropertyParser::parseShorthand):
* Source/WebCore/css/parser/CSSPropertyParserHelpers.h:
(WebCore::CSSPropertyParserHelpers::isSystemFontShorthand):
(WebCore::CSSPropertyParserHelpers::lowerFontShorthand):
* Source/WebCore/platform/graphics/SystemFontDatabase.h:
* Source/WebCore/rendering/RenderTheme.h:
* Source/WebCore/rendering/RenderThemeCocoa.h:
* Source/WebCore/rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::systemFont const): Deleted.
* Source/WebCore/rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::systemFont const): Deleted.
* Source/WebCore/rendering/RenderThemePlayStation.cpp:
(WebCore::RenderThemePlayStation::systemFont const): Deleted.
* Source/WebCore/rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::systemFont const): Deleted.
* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertFontWeight):
(WebCore::Style::BuilderConverter::convertFontVariantCaps):
(WebCore::Style::BuilderConverter::convertLineHeight):
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueFontFamily):
(WebCore::Style::BuilderCustom::applyValueFontStyle):
(WebCore::Style::BuilderCustom::applyValueFontSize):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::contentSizeCategoryDidChange):
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::accessibilityPreferencesDidChange):

Canonical link: https://commits.webkit.org/251481@main

Modified Paths

trunk/Source/WebCore/css/CSSProperties.json
trunk/Source/WebCore/css/StyleProperties.cpp
trunk/Source/WebCore/css/StyleProperties.h
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h
trunk/Source/WebCore/editing/EditingStyle.cpp
trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp
trunk/Source/WebCore/platform/graphics/SystemFontDatabase.h
trunk/Source/WebCore/platform/graphics/wpe/SystemFontDatabaseWPE.cpp
trunk/Source/WebCore/rendering/RenderTheme.h
trunk/Source/WebCore/rendering/RenderThemeAdwaita.h
trunk/Source/WebCore/rendering/RenderThemeCocoa.h
trunk/Source/WebCore/render

[webkit-changes] [295461] trunk/Source

2022-06-10 Thread mmaxfield
Title: [295461] trunk/Source








Revision 295461
Author mmaxfi...@apple.com
Date 2022-06-10 13:36:55 -0700 (Fri, 10 Jun 2022)


Log Message
Adopt EnumeratedArray in SystemFontDatabase
https://bugs.webkit.org/show_bug.cgi?id=241506

Reviewed by Cameron McCormack.

This is why we created EnumeratedArray in the first place.

* Source/WebCore/platform/graphics/SystemFontDatabase.cpp:
(WebCore::SystemFontDatabase::systemFontShorthandInfo const):
* Source/WebCore/platform/graphics/SystemFontDatabase.h:

Canonical link: https://commits.webkit.org/251467@main

Modified Paths

trunk/Source/WTF/wtf/CMakeLists.txt
trunk/Source/WebCore/platform/graphics/SystemFontDatabase.cpp
trunk/Source/WebCore/platform/graphics/SystemFontDatabase.h




Diff

Modified: trunk/Source/WTF/wtf/CMakeLists.txt (295460 => 295461)

--- trunk/Source/WTF/wtf/CMakeLists.txt	2022-06-10 20:23:56 UTC (rev 295460)
+++ trunk/Source/WTF/wtf/CMakeLists.txt	2022-06-10 20:36:55 UTC (rev 295461)
@@ -67,6 +67,7 @@
 EmbeddedFixedVector.h
 EnumClassOperatorOverloads.h
 EnumTraits.h
+EnumeratedArray.h
 Expected.h
 ExperimentalFeatureNames.h
 ExportMacros.h


Modified: trunk/Source/WebCore/platform/graphics/SystemFontDatabase.cpp (295460 => 295461)

--- trunk/Source/WebCore/platform/graphics/SystemFontDatabase.cpp	2022-06-10 20:23:56 UTC (rev 295460)
+++ trunk/Source/WebCore/platform/graphics/SystemFontDatabase.cpp	2022-06-10 20:36:55 UTC (rev 295461)
@@ -31,12 +31,11 @@
 SystemFontDatabase::SystemFontDatabase() = default;
 
 auto SystemFontDatabase::systemFontShorthandInfo(FontShorthand fontShorthand) -> const SystemFontShorthandInfo& {
-auto index = static_cast(fontShorthand);
-if (auto& entry = m_systemFontShorthandCache[index])
+if (auto& entry = m_systemFontShorthandCache[fontShorthand])
 return *entry;
 
-m_systemFontShorthandCache[index] = platformSystemFontShorthandInfo(fontShorthand);
-return *m_systemFontShorthandCache[index];
+m_systemFontShorthandCache[fontShorthand] = platformSystemFontShorthandInfo(fontShorthand);
+return *m_systemFontShorthandCache[fontShorthand];
 }
 
 const AtomString& SystemFontDatabase::systemFontShorthandFamily(FontShorthand fontShorthand)


Modified: trunk/Source/WebCore/platform/graphics/SystemFontDatabase.h (295460 => 295461)

--- trunk/Source/WebCore/platform/graphics/SystemFontDatabase.h	2022-06-10 20:23:56 UTC (rev 295460)
+++ trunk/Source/WebCore/platform/graphics/SystemFontDatabase.h	2022-06-10 20:36:55 UTC (rev 295461)
@@ -28,6 +28,7 @@
 #include "FontSelectionAlgorithm.h"
 #include 
 #include 
+#include 
 #include 
 
 namespace WebCore {
@@ -65,10 +66,8 @@
 AppleSystemTitle3,
 AppleSystemTitle4,
 #endif
-StatusBar,
+StatusBar, // This has to be kept in sync with SystemFontShorthandCache below.
 };
-using FontShorthandUnderlyingType = std::underlying_type::type;
-static constexpr auto fontShorthandCount = static_cast(FontShorthand::StatusBar) + 1;
 
 const AtomString& systemFontShorthandFamily(FontShorthand);
 float systemFontShorthandSize(FontShorthand);
@@ -88,7 +87,7 @@
 const SystemFontShorthandInfo& systemFontShorthandInfo(FontShorthand);
 static SystemFontShorthandInfo platformSystemFontShorthandInfo(FontShorthand);
 
-using SystemFontShorthandCache = std::array, fontShorthandCount>;
+using SystemFontShorthandCache = EnumeratedArray, FontShorthand::StatusBar>;
 SystemFontShorthandCache m_systemFontShorthandCache;
 };
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295447] trunk

2022-06-09 Thread mmaxfield
Title: [295447] trunk








Revision 295447
Author mmaxfi...@apple.com
Date 2022-06-09 23:29:03 -0700 (Thu, 09 Jun 2022)


Log Message
Add EnumeratedArray type
https://bugs.webkit.org/show_bug.cgi?id=241451

Reviewed by Cameron McCormack.

This is an std::array where the indices of the array are values of an enum (rather than a size_t).
This assumes the values of the enum start at 0 and monotonically increase by 1
(so the conversion function between size_t and the enum is just a simple static_cast).

EnumeratedArray includes almost all of the functions from std::array, except for a few which I
intentionally omitted.

* Source/WTF/WTF.xcodeproj/project.pbxproj:
* Source/WTF/wtf/EnumeratedArray.h: Added.
(WTF::EnumeratedArray::EnumeratedArray):
(WTF::EnumeratedArray::operator=):
(WTF::EnumeratedArray::at):
(WTF::EnumeratedArray::at const):
(WTF::EnumeratedArray::operator[]):
(WTF::EnumeratedArray::operator[] const):
(WTF::EnumeratedArray::front):
(WTF::EnumeratedArray::front const):
(WTF::EnumeratedArray::back):
(WTF::EnumeratedArray::back const):
(WTF::EnumeratedArray::fill):
(WTF::EnumeratedArray::operator== const):
(WTF::EnumeratedArray::operator!= const):
(WTF::EnumeratedArray::operator< const):
(WTF::EnumeratedArray::operator<= const):
(WTF::EnumeratedArray::operator> const):
(WTF::EnumeratedArray::operator>= const):
(WTF::EnumeratedArray::index):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WTF/EnumeratedArray.cpp: Added.
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/251453@main

Modified Paths

trunk/Source/WTF/WTF.xcodeproj/project.pbxproj
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj


Added Paths

trunk/Source/WTF/wtf/EnumeratedArray.h
trunk/Tools/TestWebKitAPI/Tests/WTF/EnumeratedArray.cpp




Diff

Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (295446 => 295447)

--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2022-06-10 06:25:28 UTC (rev 295446)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2022-06-10 06:29:03 UTC (rev 295447)
@@ -51,6 +51,7 @@
 		1C96836926BE76B600A2A2F9 /* LoggingCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C96836826BE76B600A2A2F9 /* LoggingCocoa.mm */; };
 		1CA85CA9241B0B260071C2F5 /* RuntimeApplicationChecksCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CA85CA8241B0B260071C2F5 /* RuntimeApplicationChecksCocoa.cpp */; };
 		1CF18F3B26BB579E004B1722 /* LogChannels.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CF18F3926BB579E004B1722 /* LogChannels.cpp */; };
+		1CFD5D3D2851AB3E00A0E30B /* EnumeratedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CFD5D3B2851AB3E00A0E30B /* EnumeratedArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1FA47C8A152502DA00568D1B /* WebCoreThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FA47C88152502DA00568D1B /* WebCoreThread.cpp */; };
 		2CCD892A15C0390200285083 /* GregorianDateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CCD892915C0390200285083 /* GregorianDateTime.cpp */; };
 		2CDED0EF18115C38004DBA70 /* RunLoopCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0EE18115C38004DBA70 /* RunLoopCF.cpp */; };
@@ -1049,6 +1050,7 @@
 		1CCDB14D1E566898006C73C0 /* TextBreakIteratorICU.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextBreakIteratorICU.h; sourceTree = ""; };
 		1CF18F3926BB579E004B1722 /* LogChannels.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LogChannels.cpp; sourceTree = ""; };
 		1CF18F3A26BB579E004B1722 /* LogChannels.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LogChannels.h; sourceTree = ""; };
+		1CFD5D3B2851AB3E00A0E30B /* EnumeratedArray.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EnumeratedArray.h; sourceTree = ""; };
 		1FA47C88152502DA00568D1B /* WebCoreThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreThread.cpp; sourceTree = ""; };
 		1FA47C89152502DA00568D1B /* WebCoreThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreThread.h; sourceTree = ""; };
 		24F1B248619F412296D1C19C /* RandomDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomDevice.h; sourceTree = ""; };
@@ -1981,6 +1983,7 @@
 A8A47298151A825A004123FF /* dtoa.h */,
 E3538D4C276220880075DA50 /* EmbeddedFixedVector.h */,
 5338EBA423AB04D100382662 /* EnumClassOperatorOverloads.h */,
+1CFD5D3B2851AB3E00A0E30B /* EnumeratedArray.h */,
 1AEA88E11D6BBCF400E5AD64 /* EnumTraits.h */,
 AD7C434A1DD2A4A70026888B /* Expected.h */,
 DF292D55278F9BC600BB2918 /* ExperimentalFeatureNames.h */,
@@ -2911,6 +2914,7 @@
 DD3DC94C27A4BF8E007E5B61 /* EmbeddedFixedVector.h in Headers */,
 DDF3076327C086CD006A

[webkit-changes] [295410] trunk/Source/WebCore

2022-06-08 Thread mmaxfield
Title: [295410] trunk/Source/WebCore








Revision 295410
Author mmaxfi...@apple.com
Date 2022-06-08 22:12:01 -0700 (Wed, 08 Jun 2022)


Log Message
Cache system font shorthand information
https://bugs.webkit.org/show_bug.cgi?id=241404

Reviewed by Cameron McCormack.

This is the fourth piece of https://bugs.webkit.org/show_bug.cgi?id=237817.

System font shorthands are things like "font: caption" or "font: -apple-system-body".

There used to be a cache that was supposed to map each shorthand value to a CTFontDescriptor.
However, the cache didn't work, so I deleted it in
https://github.com/WebKit/WebKit/commit/6ead5274db5f92656360fa1fbae3e0091481fc4f. This patch
reimplements it, but does so in platform/graphics/SystemFontDatabase, which is the natural
place to put it.

One of the repercussions of putting it in platform/ is that it can't use real CSSValuesIDs
as keys into the cache (because it's a layering violation to make things in platform/ see
CSS things). Therefore, this patch creates its own enum, which lives in platform/, which
conveniently exactly matches the relevant values from CSSValueID.

The Cocoa ports already have a SystemFontDatabaseCoreText which does similar things, but this
new cache is not platform-specific, so I'm putting it in SystemFontDatabase instead of
SystemFontDatabaseCoreText. SystemFontDatabaseCoreText will now inherit from SystemFontDatabase,
with 0 virtual methods. I've also taken the existing code that populates the previous cache
and temporarily duplicated it in SystemFontDabase***.cpp to make it populate this cache.

This patch doesn't actually _call_ the new cache, because doing so is somewhat complicated and
deserves its own patch. This patch just implements the cache itself. Also, because callers
aren't migrated to use this new cache yet, this patch doesn't delete the old cache either.
Both of those things will come in a follow-up patch.

* Source/WebCore/PAL/pal/spi/cf/CoreTextSPI.h:
* Source/WebCore/PlatformPlayStation.cmake:
* Source/WebCore/PlatformWin.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/SourcesGTK.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/SystemFontDatabase.cpp: Added.
(WebCore::SystemFontDatabase::systemFontShorthandInfo const):
(WebCore::SystemFontDatabase::systemFontShorthandFamily):
(WebCore::SystemFontDatabase::systemFontShorthandSize):
(WebCore::SystemFontDatabase::systemFontShorthandWeight):
(WebCore::SystemFontDatabase::clear):
* Source/WebCore/platform/graphics/SystemFontDatabase.h: Added.
* Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::normalizeCTWeight):
(WebCore::denormalizeCTWeight):
* Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h:
* Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCocoa.mm: Added.
(WebCore::cocoaFontClass):
(WebCore::SystemFontDatabaseCoreText::smallCaptionFontDescriptor):
(WebCore::SystemFontDatabaseCoreText::menuFontDescriptor):
(WebCore::SystemFontDatabaseCoreText::statusBarFontDescriptor):
(WebCore::SystemFontDatabaseCoreText::miniControlFontDescriptor):
(WebCore::SystemFontDatabaseCoreText::smallControlFontDescriptor):
(WebCore::SystemFontDatabaseCoreText::controlFontDescriptor):
* Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabase::singleton):
(WebCore::SystemFontDatabaseCoreText::clear):
(WebCore::cssWeightOfSystemFontDescriptor):
(WebCore::SystemFontDatabase::platformSystemFontShorthandInfo):
* Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
* Source/WebCore/platform/graphics/gtk/SystemFontDatabaseGTK.cpp: Added.
(WebCore::SystemFontDatabase::singleton):
(WebCore::SystemFontDatabase::platformSystemFontShorthandInfo):
* Source/WebCore/platform/graphics/playstation/SystemFontDatabasePlayStation.cpp: Added.
(WebCore::SystemFontDatabase::singleton):
(WebCore::SystemFontDatabase::platformSystemFontShorthandInfo):
* Source/WebCore/platform/graphics/win/SystemFontDatabaseWin.cpp: Added.
(WebCore::SystemFontDatabase::singleton):
(WebCore::SystemFontDatabase::platformSystemFontShorthandInfo):
* Source/WebCore/rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):

Canonical link: https://commits.webkit.org/251416@main

Modified Paths

trunk/Source/WebCore/PAL/pal/spi/cf/CoreTextSPI.h
trunk/Source/WebCore/PlatformPlayStation.cmake
trunk/Source/WebCore/PlatformWin.cmake
trunk/Source/WebCore/Sources.txt
trunk/Source/WebCore/SourcesCocoa.txt
trunk/Source/WebCore/SourcesGTK.txt
trunk/Source/WebCore/SourcesWPE.txt
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/css/CSSValueKeywords.in
trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h
trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseC

[webkit-changes] [295351] trunk

2022-06-07 Thread mmaxfield
Title: [295351] trunk








Revision 295351
Author mmaxfi...@apple.com
Date 2022-06-07 09:33:17 -0700 (Tue, 07 Jun 2022)


Log Message
[Cocoa] Move contentSizeCategory to platform/
https://bugs.webkit.org/show_bug.cgi?id=241360

Reviewed by Cameron McCormack.

There are 2 reasons for moving it:
1. There are already layering violations where existing code in platform/ is calling into RenderTheme
   to get the contentSizeCategory.
2. For https://bugs.webkit.org/show_bug.cgi?id=237817, I'm going to be adding a new system font cache,
   and the most natural place to put it is in SystemFontDatabase in platform/. This new cache needs
   access to the contentSizeCategory, so contentSizeCategory needs to be in platform/.

This patch adds FontCacheCocoa.mm because the contentSizeCategory stuff is exposed via Objective-C, and
FontCacheCoreText.cpp is a C++ source.

* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/cocoa/FontCacheCocoa.mm: Copied from Source/WebCore/rendering/RenderThemeCocoa.h.
(WebCore::getUIContentSizeCategoryDidChangeNotificationName):
(WebCore::_contentSizeCategory):
(WebCore::contentSizeCategory):
(WebCore::setContentSizeCategory):
* Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::platformInit):
(WebCore::fontWithFamilySpecialCase):
* Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h:
* Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::createTextStyleFont):
* Source/WebCore/rendering/RenderThemeCocoa.h:
* Source/WebCore/rendering/RenderThemeIOS.h:
* Source/WebCore/rendering/RenderThemeIOS.mm:
(WebCore::attachmentActionFont):
(WebCore::attachmentTitleFont):
(WebCore::attachmentDynamicTypeScaleFactor):
(WebCore::contentSizeCategoryDidChange): Deleted.
(WebCore::RenderThemeIOS::RenderThemeIOS): Deleted.
(WebCore::_contentSizeCategory): Deleted.
(WebCore::RenderThemeIOS::contentSizeCategory const): Deleted.
(WebCore::RenderThemeIOS::setContentSizeCategory): Deleted.
* Source/WebCore/rendering/RenderThemeMac.h:
* Source/WebCore/rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::contentSizeCategory const): Deleted.
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setContentSizeCategory):
* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::contentSizeCategoryDidChange):
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
* Tools/TestWebKitAPI/Tests/ios/TextStyleFontSize.mm:
(TEST):

Canonical link: https://commits.webkit.org/251365@main

Modified Paths

trunk/Source/WebCore/SourcesCocoa.txt
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h
trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp
trunk/Source/WebCore/rendering/RenderThemeCocoa.h
trunk/Source/WebCore/rendering/RenderThemeCocoa.mm
trunk/Source/WebCore/rendering/RenderThemeIOS.h
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
trunk/Source/WebCore/rendering/RenderThemeMac.h
trunk/Source/WebCore/rendering/RenderThemeMac.mm
trunk/Source/WebCore/testing/Internals.cpp
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
trunk/Tools/TestWebKitAPI/Tests/ios/TextStyleFontSize.mm


Added Paths

trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCocoa.mm




Diff

Modified: trunk/Source/WebCore/SourcesCocoa.txt (295350 => 295351)

--- trunk/Source/WebCore/SourcesCocoa.txt	2022-06-07 16:29:26 UTC (rev 295350)
+++ trunk/Source/WebCore/SourcesCocoa.txt	2022-06-07 16:33:17 UTC (rev 295351)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2020 Apple Inc. All rights reserved.
+// Copyright (C) 2017-2022 Apple Inc. All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions
@@ -390,6 +390,7 @@
 platform/graphics/cocoa/CMUtilities.mm @no-unify
 platform/graphics/cocoa/ColorCocoa.mm
 platform/graphics/cocoa/FloatRectCocoa.mm
+platform/graphics/cocoa/FontCacheCocoa.mm
 platform/graphics/cocoa/FontCacheCoreText.cpp
 platform/graphics/cocoa/FontCascadeCocoa.cpp
 platform/graphics/cocoa/FontCocoa.cpp


Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (295350 => 295351)

--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-06-07 16:29:26 UTC (rev 295350)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-06-07 16:33:17 UTC (rev 295351)
@@ -7162,6 +7162,7 @@
 		1C12AC281EE778AE0079E0A0 /* FontFamilySpecificationCoreText.cpp */ 

[webkit-changes] [295326] trunk/Source/WebCore

2022-06-06 Thread mmaxfield
Title: [295326] trunk/Source/WebCore








Revision 295326
Author mmaxfi...@apple.com
Date 2022-06-06 20:44:44 -0700 (Mon, 06 Jun 2022)


Log Message
Delete RenderTheme::cachedSystemFontDescription() because it does nothing
https://bugs.webkit.org/show_bug.cgi?id=241329

Reviewed by Cameron McCormack.

RenderTheme::cachedSystemFontDescription() is supposed to maintain storage for cached font descriptors.
However, every time this storage is referenced, it is immediately copied from, leaving the storage
in its default uninitialized state. There's no point in keeping default initialized objects around
for no reason.

This is the second piece in a sequence of patches to fix the accessibility bold setting in web content.

* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeSystemFont):
* Source/WebCore/rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
* Source/WebCore/rendering/RenderTheme.cpp:
(WebCore::RenderTheme::cachedSystemFontDescription const): Deleted.
(WebCore::RenderTheme::systemFont const): Deleted.
* Source/WebCore/rendering/RenderTheme.h:
(WebCore::RenderTheme::canPaint const):
* Source/WebCore/rendering/RenderThemeAdwaita.h:
* Source/WebCore/rendering/RenderThemeCocoa.h:
* Source/WebCore/rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::systemFont const):
(WebCore::RenderThemeCocoa::cachedSystemFontDescription const): Deleted.
(WebCore::RenderThemeCocoa::updateCachedSystemFontDescription const): Deleted.
* Source/WebCore/rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::systemFont const):
(WebCore::RenderThemeGtk::updateCachedSystemFontDescription const): Deleted.
* Source/WebCore/rendering/RenderThemeGtk.h:
* Source/WebCore/rendering/RenderThemePlayStation.cpp:
(WebCore::RenderThemePlayStation::systemFont const):
(WebCore::RenderThemePlayStation::updateCachedSystemFontDescription const): Deleted.
* Source/WebCore/rendering/RenderThemePlayStation.h:
* Source/WebCore/rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::systemFont const):
(WebCore::fillFontDescription): Deleted.
(WebCore::RenderThemeWin::updateCachedSystemFontDescription const): Deleted.
* Source/WebCore/rendering/RenderThemeWin.h:

Canonical link: https://commits.webkit.org/251350@main

Modified Paths

trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp
trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp
trunk/Source/WebCore/rendering/RenderTheme.cpp
trunk/Source/WebCore/rendering/RenderTheme.h
trunk/Source/WebCore/rendering/RenderThemeAdwaita.h
trunk/Source/WebCore/rendering/RenderThemeCocoa.h
trunk/Source/WebCore/rendering/RenderThemeCocoa.mm
trunk/Source/WebCore/rendering/RenderThemeGtk.cpp
trunk/Source/WebCore/rendering/RenderThemeGtk.h
trunk/Source/WebCore/rendering/RenderThemePlayStation.cpp
trunk/Source/WebCore/rendering/RenderThemePlayStation.h
trunk/Source/WebCore/rendering/RenderThemeWin.cpp
trunk/Source/WebCore/rendering/RenderThemeWin.h




Diff

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (295325 => 295326)

--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2022-06-07 03:43:00 UTC (rev 295325)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2022-06-07 03:44:44 UTC (rev 295326)
@@ -1,5 +1,5 @@
 // Copyright 2015 The Chromium Authors. All rights reserved.
-// Copyright (C) 2016-2021 Apple Inc. All rights reserved.
+// Copyright (C) 2016-2022 Apple Inc. All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
@@ -5196,8 +5196,7 @@
 if (!m_range.atEnd())
 return false;
 
-FontCascadeDescription fontDescription;
-RenderTheme::singleton().systemFont(systemFontID, fontDescription);
+auto fontDescription = RenderTheme::singleton().systemFont(systemFontID);
 if (!fontDescription.isAbsoluteSize())
 return false;
 


Modified: trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp (295325 => 295326)

--- trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp	2022-06-07 03:43:00 UTC (rev 295325)
+++ trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp	2022-06-07 03:44:44 UTC (rev 295326)
@@ -75,8 +75,7 @@
 ResourceUsageOverlayPainter(ResourceUsageOverlay& overlay)
 : m_overlay(overlay)
 {
-FontCascadeDescription fontDescription;
-RenderTheme::singleton().systemFont(CSSValueMessageBox, fontDescription);
+auto fontDescription = RenderTheme::singleton().systemFont(CSSValueMessageBox);
 fontDescription.setComputedSize(gFontSize);
 m_textFont = FontCascade(WTFMove(fontDescription), 0, 0);
 m_textFont.update(nullptr);


Modified: trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp (295325 => 295326)

--- trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp	2022-06-07 03:43:00 UT

[webkit-changes] [295250] trunk

2022-06-03 Thread mmaxfield
Title: [295250] trunk








Revision 295250
Author mmaxfi...@apple.com
Date 2022-06-03 16:45:34 -0700 (Fri, 03 Jun 2022)


Log Message
[Cocoa] Mail compose doesn't use Bulgarian letter forms when the system language is set to Bulgarian
https://bugs.webkit.org/show_bug.cgi?id=241253


Reviewed by Cameron McCormack.

Mail compose doesn't set `lang`, which causes us to have a null locale string.
String::createCFString() transforms a null string to CFSTR(""), which indicates to Core Text
that it shouldn't use the shaping from the system language. Instead, if the locale string
is null, we should give Core Text a null locale string, so they use the correct shaping.

* LayoutTests/TestExpectations:
* LayoutTests/fast/text/bulgarian-system-language-shaping-expected-mismatch.html: Added.
* LayoutTests/fast/text/bulgarian-system-language-shaping.html: Added.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/platform/graphics/coretext/FontCoreText.cpp:
(WebCore::Font::applyTransforms const):

Canonical link: https://commits.webkit.org/251298@main

Modified Paths

trunk/LayoutTests/TestExpectations
trunk/LayoutTests/platform/ios/TestExpectations
trunk/LayoutTests/platform/mac/TestExpectations
trunk/Source/WebCore/platform/graphics/coretext/FontCoreText.cpp


Added Paths

trunk/LayoutTests/fast/text/bulgarian-system-language-shaping-expected-mismatch.html
trunk/LayoutTests/fast/text/bulgarian-system-language-shaping.html




Diff

Modified: trunk/LayoutTests/TestExpectations (295249 => 295250)

--- trunk/LayoutTests/TestExpectations	2022-06-03 23:39:34 UTC (rev 295249)
+++ trunk/LayoutTests/TestExpectations	2022-06-03 23:45:34 UTC (rev 295250)
@@ -5291,3 +5291,6 @@
 
 # Image controls menu is mac only.
 fast/attachment/attachment-image-controls-basic.html [ Skip ]
+
+# This test requires a system font that has Bulgarian-specific shaping.
+fast/text/bulgarian-system-language-shaping.html [ ImageOnlyFailure ]


Added: trunk/LayoutTests/fast/text/bulgarian-system-language-shaping-expected-mismatch.html (0 => 295250)

--- trunk/LayoutTests/fast/text/bulgarian-system-language-shaping-expected-mismatch.html	(rev 0)
+++ trunk/LayoutTests/fast/text/bulgarian-system-language-shaping-expected-mismatch.html	2022-06-03 23:45:34 UTC (rev 295250)
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+


Added: trunk/LayoutTests/fast/text/bulgarian-system-language-shaping.html (0 => 295250)

--- trunk/LayoutTests/fast/text/bulgarian-system-language-shaping.html	(rev 0)
+++ trunk/LayoutTests/fast/text/bulgarian-system-language-shaping.html	2022-06-03 23:45:34 UTC (rev 295250)
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+


Modified: trunk/LayoutTests/platform/ios/TestExpectations (295249 => 295250)

--- trunk/LayoutTests/platform/ios/TestExpectations	2022-06-03 23:39:34 UTC (rev 295249)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2022-06-03 23:45:34 UTC (rev 295250)
@@ -3648,4 +3648,6 @@
 webkit.org/b/241048 imported/w3c/web-platform-tests/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-ImageBitmap-video.html [ Failure ] 
 webkit.org/b/241048 imported/w3c/web-platform-tests/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-video.html [ Failure ] 
 
-webkit.org/b/241205 fast/forms/textfield-outline.html [ Pass Failure ]
\ No newline at end of file
+webkit.org/b/241205 fast/forms/textfield-outline.html [ Pass Failure ]
+
+fast/text/bulgarian-system-language-shaping.html [ Pass ]


Modified: trunk/LayoutTests/platform/mac/TestExpectations (295249 => 295250)

--- trunk/LayoutTests/platform/mac/TestExpectations	2022-06-03 23:39:34 UTC (rev 295249)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2022-06-03 23:45:34 UTC (rev 295250)
@@ -2302,3 +2302,5 @@
 webkit.org/b/227845 [ Debug ] webaudio/audioworket-out-of-memory.html [ Pass Timeout DumpJSConsoleLogInStdErr ]
 
 webkit.org/b/240989 http/tests/media/hls/hls-webvtt-flashing.html [ Pass Failure ]
+
+[ Monterey+ ] fast/text/bulgarian-system-language-shaping.html [ Pass ]


Modified: trunk/Source/WebCore/platform/graphics/coretext/FontCoreText.cpp (295249 => 295250)

--- trunk/Source/WebCore/platform/graphics/coretext/FontCoreText.cpp	2022-06-03 23:39:34 UTC (rev 295249)
+++ trunk/Source/WebCore/platform/graphics/coretext/FontCoreText.cpp	2022-06-03 23:45:34 UTC (rev 295250)
@@ -619,7 +619,7 @@
 
 auto substring = text.substring(beginningStringIndex);
 auto upconvertedCharacters = substring.upconvertedCharacters();
-auto localeString = LocaleCocoa::canonicalLanguageIdentifierFromString(locale).string().createCFString();
+auto localeString = locale.isNull() ? nullptr : LocaleCocoa::canonicalLanguageIdentifierFromString(locale).string().createCFString();
 auto numberOfInputGlyphs = glyphBuffer.size() - beginningGlyphIndex;
 // FIXME: Enable kerning for single glyphs when rdar://82195405 is fixed
 CTFontShapeOptions options = kCTFo

[webkit-changes] [295038] trunk/Source/WebCore/platform/graphics/cocoa/ FontCacheCoreText.cpp

2022-05-30 Thread mmaxfield
Title: [295038] trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp








Revision 295038
Author mmaxfi...@apple.com
Date 2022-05-30 16:59:45 -0700 (Mon, 30 May 2022)


Log Message
[Cocoa] Rename [de]normalizeWeight() to [de]normalizeGXWeight()
https://bugs.webkit.org/show_bug.cgi?id=241112

Reviewed by Alan Bujtas.

Weights are measured in 3 different scales:
1. CSS weights (1 - 999)
2. Core Text weights (-1.0 - 1.0)
3. TrueType GX weights (0.0ish to 2.0ish, it's not really defined, only the "default" value
   of 1.0 is defined).

Our current functions convert between CSS weights and TrueType GX weights, so this makes that more
clear. A subsequent patch will add conversions between CSS weights and Core Text weights.

No new tests because there is no behavior change.

* Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::normalizeGXWeight):
(WebCore::denormalizeGXWeight):
(WebCore::preparePlatformFont):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::normalizeWeight): Deleted.
(WebCore::denormalizeWeight): Deleted.

Canonical link: https://commits.webkit.org/251132@main

Modified Paths

trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp




Diff

Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (295037 => 295038)

--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2022-05-30 23:58:55 UTC (rev 295037)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2022-05-30 23:59:45 UTC (rev 295038)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -364,7 +364,7 @@
 
 // These values were calculated by performing a linear regression on the CSS weights/widths/slopes and Core Text weights/widths/slopes of San Francisco.
 // FIXME:  Get the real values from Core Text.
-static inline float normalizeWeight(float value)
+static inline float normalizeGXWeight(float value)
 {
 return 523.7 * value - 109.3;
 }
@@ -374,7 +374,7 @@
 return value * 300;
 }
 
-static inline float denormalizeWeight(float value)
+static inline float denormalizeGXWeight(float value)
 {
 return (value + 109.3) / 523.7;
 }
@@ -605,7 +605,7 @@
 if (auto slopeValue = fontCreationContext.fontFaceCapabilities().weight)
 slope = std::max(std::min(slope, static_cast(slopeValue->maximum)), static_cast(slopeValue->minimum));
 if (needsConversion) {
-weight = denormalizeWeight(weight);
+weight = denormalizeGXWeight(weight);
 width = denormalizeVariationWidth(width);
 slope = denormalizeSlope(slope);
 }
@@ -1064,7 +1064,7 @@
 
 if (FontType(font.get()).variationType == FontType::VariationType::TrueTypeGX && !optOutFromGXNormalization) {
 if (result.weight)
-result.weight = { { normalizeWeight(result.weight.value().minimum), normalizeWeight(result.weight.value().maximum) } };
+result.weight = { { normalizeGXWeight(result.weight.value().minimum), normalizeGXWeight(result.weight.value().maximum) } };
 if (result.width)
 result.width = { { normalizeVariationWidth(result.width.value().minimum), normalizeVariationWidth(result.width.value().maximum) } };
 if (result.slope)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294671] trunk/metadata/contributors.json

2022-05-23 Thread mmaxfield
Title: [294671] trunk/metadata/contributors.json








Revision 294671
Author mmaxfi...@apple.com
Date 2022-05-23 12:51:12 -0700 (Mon, 23 May 2022)


Log Message
Add Mike Wyrzykowski to contributors.json
https://bugs.webkit.org/show_bug.cgi?id=240816

Unreviewed.

He is a contributor.

* metadata/contributors.json:

Canonical link: https://commits.webkit.org/250885@main

Modified Paths

trunk/metadata/contributors.json




Diff

Modified: trunk/metadata/contributors.json (294670 => 294671)

--- trunk/metadata/contributors.json	2022-05-23 19:46:17 UTC (rev 294670)
+++ trunk/metadata/contributors.json	2022-05-23 19:51:12 UTC (rev 294671)
@@ -5040,6 +5040,14 @@
},
{
   "emails" : [
+ "mwyrzykow...@apple.com"
+  ],
+  "expertise" : "Graphics",
+  "github" : "mwyrzykowski",
+  "name" : "Mike Wyrzykowski"
+   },
+   {
+  "emails" : [
  "mnaga...@chromium.org"
   ],
   "name" : "Mikhail Naganov"






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294654] trunk/LayoutTests

2022-05-23 Thread mmaxfield
Title: [294654] trunk/LayoutTests








Revision 294654
Author mmaxfi...@apple.com
Date 2022-05-23 10:57:51 -0700 (Mon, 23 May 2022)


Log Message
[Cocoa] fast/text/international/generic-font-family-language-traditional.html is failing due to language minimization
https://bugs.webkit.org/show_bug.cgi?id=240751


Reviewed by Chris Dumez.

We're saying the language list ["en", "zh-tw"] gets minimized to ["en"], which then removes the signal about whether we should render simplified or traditional Chinese.

On one hand, this is kind of good, because the whole point of minimization is to make different browser configurations in the same bucket as identical. On the other hand, it means a user with these language preferences won't get the rendering they expect.

I could change the test to just use the language list ["zh-tw"] and I think it would still test the thing it's trying to test, so that's what this patch does.

* LayoutTests/fast/text/international/generic-font-family-language-traditional.html:
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:

Canonical link: https://commits.webkit.org/250878@main

Modified Paths

trunk/LayoutTests/fast/text/international/generic-font-family-language-traditional.html
trunk/LayoutTests/platform/ios/TestExpectations
trunk/LayoutTests/platform/mac/TestExpectations




Diff

Modified: trunk/LayoutTests/fast/text/international/generic-font-family-language-traditional.html (294653 => 294654)

--- trunk/LayoutTests/fast/text/international/generic-font-family-language-traditional.html	2022-05-23 17:54:14 UTC (rev 294653)
+++ trunk/LayoutTests/fast/text/international/generic-font-family-language-traditional.html	2022-05-23 17:57:51 UTC (rev 294654)
@@ -2,7 +2,7 @@
 
 
 
-window.internals.setUserPreferredLanguages(["en", "zh-tw"]);
+window.internals.setUserPreferredLanguages(["zh-tw"]);
 
 
 


Modified: trunk/LayoutTests/platform/ios/TestExpectations (294653 => 294654)

--- trunk/LayoutTests/platform/ios/TestExpectations	2022-05-23 17:54:14 UTC (rev 294653)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2022-05-23 17:57:51 UTC (rev 294654)
@@ -3583,8 +3583,6 @@
 webkit.org/b/239564 fast/forms/control-restrict-line-height.html [ Failure ]
 webkit.org/b/239564 tables/mozilla/bugs/bug2479-3.html [ Failure ]
 
-webkit.org/b/240268 fast/text/international/generic-font-family-language-traditional.html [ ImageOnlyFailure ]
-
 webkit.org/b/239625 imported/w3c/web-platform-tests/css/css-color/opacity-overlapping-letters.html [ ImageOnlyFailure ]
 
 webkit.org/b/239567 tables/mozilla/bugs/bug26178.html [ Pass Failure ]


Modified: trunk/LayoutTests/platform/mac/TestExpectations (294653 => 294654)

--- trunk/LayoutTests/platform/mac/TestExpectations	2022-05-23 17:54:14 UTC (rev 294653)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2022-05-23 17:57:51 UTC (rev 294654)
@@ -2263,8 +2263,6 @@
 
 webkit.org/b/235660 [ Debug ] fast/replaced/encrypted-pdf-as-object-and-embed.html [ Skip ]
 
-webkit.org/b/240268 fast/text/international/generic-font-family-language-traditional.html [ ImageOnlyFailure ]
-
 #  tests involving the ready promise can only work on Monterey and up
 [ BigSur ] model-element/model-element-ready.html [ Skip ]
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294373] trunk/Source/WebCore/Modules/WebGPU

2022-05-17 Thread mmaxfield
Title: [294373] trunk/Source/WebCore/Modules/WebGPU








Revision 294373
Author mmaxfi...@apple.com
Date 2022-05-17 18:09:07 -0700 (Tue, 17 May 2022)


Log Message
[WebGPU] Work around https://bugs.webkit.org/show_bug.cgi?id=240219
https://bugs.webkit.org/show_bug.cgi?id=240441

https://bugs.webkit.org/show_bug.cgi?id=240219 is about a bug where we can't
say "optional thingy = 0" in an IDL file. This patch works around that in WebGPU
by replacing it with "optional thingy" and then "thingy.value_or(0)" in the C++
code. This is temporary, until https://bugs.webkit.org/show_bug.cgi?id=240219 is
fixed.

No new tests because there is no behavior change.

* Modules/WebGPU/GPUBuffer.cpp:
(WebCore::GPUBuffer::mapAsync):
(WebCore::GPUBuffer::getMappedRange):
* Modules/WebGPU/GPUBuffer.h:
* Modules/WebGPU/GPUBuffer.idl:

Canonical link: https://commits.webkit.org/250668@main

Modified Paths

trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.cpp
trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.h
trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.idl




Diff

Modified: trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.cpp (294372 => 294373)

--- trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.cpp	2022-05-18 00:59:47 UTC (rev 294372)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.cpp	2022-05-18 01:09:07 UTC (rev 294373)
@@ -38,16 +38,16 @@
 m_backing->setLabel(WTFMove(label));
 }
 
-void GPUBuffer::mapAsync(GPUMapModeFlags mode, GPUSize64 offset, std::optional size, MapAsyncPromise&& promise)
+void GPUBuffer::mapAsync(GPUMapModeFlags mode, std::optional offset, std::optional size, MapAsyncPromise&& promise)
 {
-m_backing->mapAsync(convertMapModeFlagsToBacking(mode), offset, size, [promise = WTFMove(promise)] () mutable {
+m_backing->mapAsync(convertMapModeFlagsToBacking(mode), offset.value_or(0), size, [promise = WTFMove(promise)] () mutable {
 promise.resolve(nullptr);
 });
 }
 
-Ref GPUBuffer::getMappedRange(GPUSize64 offset, std::optional size)
+Ref GPUBuffer::getMappedRange(std::optional offset, std::optional size)
 {
-auto mappedRange = m_backing->getMappedRange(offset, size);
+auto mappedRange = m_backing->getMappedRange(offset.value_or(0), size);
 return ArrayBuffer::create(mappedRange.source, mappedRange.byteLength);
 }
 


Modified: trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.h (294372 => 294373)

--- trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.h	2022-05-18 00:59:47 UTC (rev 294372)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.h	2022-05-18 01:09:07 UTC (rev 294373)
@@ -49,8 +49,8 @@
 void setLabel(String&&);
 
 using MapAsyncPromise = DOMPromiseDeferred;
-void mapAsync(GPUMapModeFlags, GPUSize64 offset, std::optional sizeForMap, MapAsyncPromise&&);
-Ref getMappedRange(GPUSize64 offset, std::optional rangeSize);
+void mapAsync(GPUMapModeFlags, std::optional offset, std::optional sizeForMap, MapAsyncPromise&&);
+Ref getMappedRange(std::optional offset, std::optional rangeSize);
 void unmap();
 
 void destroy();


Modified: trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.idl (294372 => 294373)

--- trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.idl	2022-05-18 00:59:47 UTC (rev 294372)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUBuffer.idl	2022-05-18 01:09:07 UTC (rev 294373)
@@ -35,8 +35,9 @@
 SecureContext
 ]
 interface GPUBuffer {
-Promise mapAsync(GPUMapModeFlags mode, optional GPUSize64 offset = 0, optional GPUSize64 size);
-ArrayBuffer getMappedRange(optional GPUSize64 offset = 0, optional GPUSize64 size);
+// FIXME: https://bugs.webkit.org/show_bug.cgi?id=240219 The next two lines should be able to say "optional thingy = 0" instead of just "optional thingy".
+Promise mapAsync(GPUMapModeFlags mode, optional GPUSize64 offset, optional GPUSize64 size);
+ArrayBuffer getMappedRange(optional GPUSize64 offset, optional GPUSize64 size);
 undefined unmap();
 
 undefined destroy();






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294259] trunk/Source/WebCore/css/CSSProperties.json

2022-05-16 Thread mmaxfield
Title: [294259] trunk/Source/WebCore/css/CSSProperties.json








Revision 294259
Author mmaxfi...@apple.com
Date 2022-05-16 14:21:12 -0700 (Mon, 16 May 2022)


Log Message
Fix URL to offset-rotate property in CSSProperties.json
https://bugs.webkit.org/show_bug.cgi?id=240474

Reviewed by Myles C. Maxfield.

No new tests, not a functional change.

* Source/WebCore/css/CSSProperties.json:

Canonical link: https://commits.webkit.org/250608@main

Modified Paths

trunk/Source/WebCore/css/CSSProperties.json




Diff

Modified: trunk/Source/WebCore/css/CSSProperties.json (294258 => 294259)

--- trunk/Source/WebCore/css/CSSProperties.json	2022-05-16 21:21:07 UTC (rev 294258)
+++ trunk/Source/WebCore/css/CSSProperties.json	2022-05-16 21:21:12 UTC (rev 294259)
@@ -3715,7 +3715,7 @@
 },
 "specification": {
 "category": "css-motion-path",
-"url": "https://drafts.fxtf.org/motion-1/#offset-anchor-property"
+"url": "https://drafts.fxtf.org/motion-1/#offset-rotate-property"
 }
 },
 "offset": {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [293937] trunk/Source/WebGPU

2022-05-06 Thread mmaxfield
Title: [293937] trunk/Source/WebGPU








Revision 293937
Author mmaxfi...@apple.com
Date 2022-05-06 17:48:53 -0700 (Fri, 06 May 2022)


Log Message
[WebGPU] Fix build on downlevel OSes in Apple's build system
https://bugs.webkit.org/show_bug.cgi?id=240159


Reviewed by Alexey Proskuryakov.

Some variables from WebKitTargetConditionals.xcconfig and
PlatformSupport.xcconfig are used, so we have to make sure
we include them. Also refactor the INSTALL_PATH variable a
bit.

* Configurations/Base.xcconfig:
* Configurations/WebGPU.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig: Added.
* WebGPU.xcodeproj/project.pbxproj:

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/Configurations/Base.xcconfig
trunk/Source/WebGPU/Configurations/WebGPU.xcconfig
trunk/Source/WebGPU/WebGPU.xcodeproj/project.pbxproj


Added Paths

trunk/Source/WebGPU/Configurations/WebKitTargetConditionals.xcconfig




Diff

Modified: trunk/Source/WebGPU/ChangeLog (293936 => 293937)

--- trunk/Source/WebGPU/ChangeLog	2022-05-07 00:41:26 UTC (rev 293936)
+++ trunk/Source/WebGPU/ChangeLog	2022-05-07 00:48:53 UTC (rev 293937)
@@ -1,3 +1,21 @@
+2022-05-06  Myles C. Maxfield  
+
+[WebGPU] Fix build on downlevel OSes in Apple's build system
+https://bugs.webkit.org/show_bug.cgi?id=240159
+
+
+Reviewed by Alexey Proskuryakov.
+
+Some variables from WebKitTargetConditionals.xcconfig and
+PlatformSupport.xcconfig are used, so we have to make sure
+we include them. Also refactor the INSTALL_PATH variable a
+bit.
+
+* Configurations/Base.xcconfig:
+* Configurations/WebGPU.xcconfig:
+* Configurations/WebKitTargetConditionals.xcconfig: Added.
+* WebGPU.xcodeproj/project.pbxproj:
+
 2022-05-03  Myles C. Maxfield  
 
 [WebGPU] Device creation should not always fail if supported features are requested


Modified: trunk/Source/WebGPU/Configurations/Base.xcconfig (293936 => 293937)

--- trunk/Source/WebGPU/Configurations/Base.xcconfig	2022-05-07 00:41:26 UTC (rev 293936)
+++ trunk/Source/WebGPU/Configurations/Base.xcconfig	2022-05-07 00:48:53 UTC (rev 293937)
@@ -22,7 +22,9 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include? "../../../../Internal/Configurations/HaveInternalSDK.xcconfig"
+#include? "/AppleInternal/XcodeConfig/PlatformSupport.xcconfig"
 #include "SDKVariant.xcconfig"
+#include "WebKitTargetConditionals.xcconfig"
 
 CODE_SIGN_IDENTITY = -;
 AD_HOC_CODE_SIGNING_ALLOWED = YES;


Modified: trunk/Source/WebGPU/Configurations/WebGPU.xcconfig (293936 => 293937)

--- trunk/Source/WebGPU/Configurations/WebGPU.xcconfig	2022-05-07 00:41:26 UTC (rev 293936)
+++ trunk/Source/WebGPU/Configurations/WebGPU.xcconfig	2022-05-07 00:48:53 UTC (rev 293937)
@@ -38,10 +38,9 @@
 
 INFOPLIST_FILE = Info.plist;
 
-INSTALL_PATH = $(INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_$(USE_SYSTEM_CONTENT_PATH));
-INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_YES = $(SYSTEM_CONTENT_PATH)$(WEBGPU_FRAMEWORKS_DIR);
-INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_ = $(INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_NO);
-INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_NO = $(WEBGPU_FRAMEWORKS_DIR);
+INSTALL_PATH_PREFIX = $(INSTALL_PATH_PREFIX_$(USE_SYSTEM_CONTENT_PATH));
+INSTALL_PATH_PREFIX_YES = $(SYSTEM_CONTENT_PATH);
+INSTALL_PATH = $(INSTALL_PATH_PREFIX)$(WEBGPU_FRAMEWORKS_DIR);
 SECONDARY_STAGED_FRAMEWORK_DIRECTORY = $(SYSTEM_SECONDARY_CONTENT_PATH)$(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari
 COPY_STAGED_FRAMEWORKS_TO_SECONDARY_PATH = $(COPY_STAGED_FRAMEWORKS_TO_SECONDARY_PATH_SDK_VARIANT_$(SDK_VARIANT));
 COPY_STAGED_FRAMEWORKS_TO_SECONDARY_PATH_SDK_VARIANT_ = NO


Added: trunk/Source/WebGPU/Configurations/WebKitTargetConditionals.xcconfig (0 => 293937)

--- trunk/Source/WebGPU/Configurations/WebKitTargetConditionals.xcconfig	(rev 0)
+++ trunk/Source/WebGPU/Configurations/WebKitTargetConditionals.xcconfig	2022-05-07 00:48:53 UTC (rev 293937)
@@ -0,0 +1,227 @@
+// Copyright (C) 2018-2022 Apple Inc. All rights reserved.
+//
+// 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 APPLE INC. ``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 APPLE INC. OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 

[webkit-changes] [293718] trunk/Source/WebGPU

2022-05-03 Thread mmaxfield
Title: [293718] trunk/Source/WebGPU








Revision 293718
Author mmaxfi...@apple.com
Date 2022-05-03 00:47:42 -0700 (Tue, 03 May 2022)


Log Message
[WebGPU] Device creation should not always fail if supported features are requested
https://bugs.webkit.org/show_bug.cgi?id=239955

Reviewed by Kimmo Kinnunen.

Somehow a block of code was remaining from before we implemented optional features.

Test: webgpu/api/validation/createTexture

* WebGPU/Adapter.mm:
(WebGPU::Adapter::requestDevice):
* WebGPU/Instance.mm:
(WebGPU::Instance::requestAdapter):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Adapter.mm
trunk/Source/WebGPU/WebGPU/Instance.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (293717 => 293718)

--- trunk/Source/WebGPU/ChangeLog	2022-05-03 06:11:41 UTC (rev 293717)
+++ trunk/Source/WebGPU/ChangeLog	2022-05-03 07:47:42 UTC (rev 293718)
@@ -1,3 +1,19 @@
+2022-05-03  Myles C. Maxfield  
+
+[WebGPU] Device creation should not always fail if supported features are requested
+https://bugs.webkit.org/show_bug.cgi?id=239955
+
+Reviewed by Kimmo Kinnunen.
+
+Somehow a block of code was remaining from before we implemented optional features.
+
+Test: webgpu/api/validation/createTexture
+
+* WebGPU/Adapter.mm:
+(WebGPU::Adapter::requestDevice):
+* WebGPU/Instance.mm:
+(WebGPU::Instance::requestAdapter):
+
 2022-05-02  Alex Christensen  
 
 Fix tvOS build


Modified: trunk/Source/WebGPU/WebGPU/Adapter.mm (293717 => 293718)

--- trunk/Source/WebGPU/WebGPU/Adapter.mm	2022-05-03 06:11:41 UTC (rev 293717)
+++ trunk/Source/WebGPU/WebGPU/Adapter.mm	2022-05-03 07:47:42 UTC (rev 293718)
@@ -91,13 +91,6 @@
 return;
 }
 
-if (descriptor.requiredFeaturesCount) {
-instance().scheduleWork([strongThis = Ref { *this }, callback = WTFMove(callback)]() mutable {
-callback(WGPURequestDeviceStatus_Error, Device::createInvalid(strongThis), "Device does not support requested features"_s);
-});
-return;
-}
-
 WGPULimits limits { };
 
 if (descriptor.requiredLimits) {


Modified: trunk/Source/WebGPU/WebGPU/Instance.mm (293717 => 293718)

--- trunk/Source/WebGPU/WebGPU/Instance.mm	2022-05-03 06:11:41 UTC (rev 293717)
+++ trunk/Source/WebGPU/WebGPU/Instance.mm	2022-05-03 07:47:42 UTC (rev 293718)
@@ -186,9 +186,9 @@
 
 auto device = sortedDevices[0];
 
-auto deviceCapabilties = hardwareCapabilities(device);
+auto deviceCapabilities = hardwareCapabilities(device);
 
-if (!deviceCapabilties) {
+if (!deviceCapabilities) {
 scheduleWork([strongThis = Ref { *this }, callback = WTFMove(callback)]() mutable {
 callback(WGPURequestAdapterStatus_Error, Adapter::createInvalid(strongThis), "Device does not support WebGPU"_s);
 });
@@ -195,8 +195,8 @@
 return;
 }
 
-scheduleWork([strongThis = Ref { *this }, device = sortedDevices[0], deviceCapabilties = WTFMove(*deviceCapabilties), callback = WTFMove(callback)]() mutable {
-callback(WGPURequestAdapterStatus_Success, Adapter::create(device, strongThis, WTFMove(deviceCapabilties)), { });
+scheduleWork([strongThis = Ref { *this }, device = sortedDevices[0], deviceCapabilities = WTFMove(*deviceCapabilities), callback = WTFMove(callback)]() mutable {
+callback(WGPURequestAdapterStatus_Success, Adapter::create(device, strongThis, WTFMove(deviceCapabilities)), { });
 });
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [293674] trunk/Source/WebGPU

2022-05-02 Thread mmaxfield
Title: [293674] trunk/Source/WebGPU








Revision 293674
Author mmaxfi...@apple.com
Date 2022-05-02 12:15:48 -0700 (Mon, 02 May 2022)


Log Message
[WebGPU] [tvOS] Neither MTLGPUFamilyApple6 nor MTLGPUFamilyApple7 exist on tvOS
https://bugs.webkit.org/show_bug.cgi?id=239973


Unreviewed build fix.


* WebGPU/HardwareCapabilities.mm:
(WebGPU::rawHardwareCapabilities):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/HardwareCapabilities.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (293673 => 293674)

--- trunk/Source/WebGPU/ChangeLog	2022-05-02 19:12:06 UTC (rev 293673)
+++ trunk/Source/WebGPU/ChangeLog	2022-05-02 19:15:48 UTC (rev 293674)
@@ -1,3 +1,14 @@
+2022-05-02  Myles C. Maxfield  
+
+[WebGPU] [tvOS] Neither MTLGPUFamilyApple6 nor MTLGPUFamilyApple7 exist on tvOS
+https://bugs.webkit.org/show_bug.cgi?id=239973
+
+
+Unreviewed build fix.
+
+* WebGPU/HardwareCapabilities.mm:
+(WebGPU::rawHardwareCapabilities):
+
 2022-04-27  Michael Saboff  
 
 WebGPU doesn't create a symlink to the system content path in installhdrs


Modified: trunk/Source/WebGPU/WebGPU/HardwareCapabilities.mm (293673 => 293674)

--- trunk/Source/WebGPU/WebGPU/HardwareCapabilities.mm	2022-05-02 19:12:06 UTC (rev 293673)
+++ trunk/Source/WebGPU/WebGPU/HardwareCapabilities.mm	2022-05-02 19:15:48 UTC (rev 293674)
@@ -493,7 +493,7 @@
 merge(apple4(device));
 if ([device supportsFamily:MTLGPUFamilyApple5])
 merge(apple5(device));
-#if !PLATFORM(WATCHOS)
+#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
 if ([device supportsFamily:MTLGPUFamilyApple6])
 merge(apple6(device));
 if ([device supportsFamily:MTLGPUFamilyApple7])






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [293140] trunk/LayoutTests

2022-04-20 Thread mmaxfield
Title: [293140] trunk/LayoutTests








Revision 293140
Author mmaxfi...@apple.com
Date 2022-04-20 19:48:24 -0700 (Wed, 20 Apr 2022)


Log Message
[ iOS ] platform/ios/ios/fast/text/opticalFont.html is a constant failure
https://bugs.webkit.org/show_bug.cgi?id=239570


Unreviewed test gardening.

Rebase.


* platform/ios/platform/ios/ios/fast/text/opticalFont-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/ios/platform/ios/ios/fast/text/opticalFont-expected.txt




Diff

Modified: trunk/LayoutTests/ChangeLog (293139 => 293140)

--- trunk/LayoutTests/ChangeLog	2022-04-21 02:43:49 UTC (rev 293139)
+++ trunk/LayoutTests/ChangeLog	2022-04-21 02:48:24 UTC (rev 293140)
@@ -1,3 +1,15 @@
+2022-04-20  Myles C. Maxfield  
+
+[ iOS ] platform/ios/ios/fast/text/opticalFont.html is a constant failure
+https://bugs.webkit.org/show_bug.cgi?id=239570
+
+
+Unreviewed test gardening.
+
+Rebase.
+
+* platform/ios/platform/ios/ios/fast/text/opticalFont-expected.txt:
+
 2022-04-20  Karl Rackler  
 
 [ macOS wk2 ] imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_anchor_download_block_downloads.tentative.html is a flaky failure


Modified: trunk/LayoutTests/platform/ios/platform/ios/ios/fast/text/opticalFont-expected.txt (293139 => 293140)

--- trunk/LayoutTests/platform/ios/platform/ios/ios/fast/text/opticalFont-expected.txt	2022-04-21 02:43:49 UTC (rev 293139)
+++ trunk/LayoutTests/platform/ios/platform/ios/ios/fast/text/opticalFont-expected.txt	2022-04-21 02:48:24 UTC (rev 293140)
@@ -12,13 +12,13 @@
   RenderBlock {DIV} at (0,58) size 784x74
 RenderText {#text} at (0,0) size 679x74
   text run at (0,0) width 679: "This is a test for -webkit-system-font, using the 'font'"
-  text run at (0,37) width 109: "property"
+  text run at (0,37) width 110: "property"
   RenderBlock {DIV} at (0,132) size 784x37
-RenderText {#text} at (0,0) size 717x37
-  text run at (0,0) width 717: "This is a test for -apple-system, using the 'font' property"
+RenderText {#text} at (0,0) size 718x37
+  text run at (0,0) width 718: "This is a test for -apple-system, using the 'font' property"
   RenderBlock {DIV} at (0,169) size 784x37
-RenderText {#text} at (0,0) size 655x37
-  text run at (0,0) width 655: "This is a test for system-ui, using the 'font' property"
+RenderText {#text} at (0,0) size 656x37
+  text run at (0,0) width 656: "This is a test for system-ui, using the 'font' property"
   RenderBlock {DIV} at (0,206) size 784x29
 RenderInline {B} at (0,0) size 552x29
   RenderText {#text} at (0,0) size 552x29






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [293106] trunk/Source

2022-04-20 Thread mmaxfield
Title: [293106] trunk/Source








Revision 293106
Author mmaxfi...@apple.com
Date 2022-04-20 10:43:39 -0700 (Wed, 20 Apr 2022)


Log Message
[WebGPU] WebKit and WebKitLegacy shouldn't need to know about WebGPU.framework
https://bugs.webkit.org/show_bug.cgi?id=239528


Unreviewed build fix.

Source/WebCore/PAL:

WebKit and WebKitLegacy create a WebGPU implementation from pal/graphics/WebGPU/Impl. This implementation
knows about WebGPU.framework. However, the create() function doesn't need to know about WebGPU.framework,
and its header doesn't need to include . Only the .cpp files need to know about
, and those .cpp files are invisible from WebKit and WebKitLegacy's points of view. So,
this patch splits the PAL header into:
1. A header which includes a creation function, but doesn't know about WebGPU.framework, and
2. A header which knows about WebGPU.framework, but doesn't hold the creation function used by WebKit or
   WebKitLegacy.

This fixes one of Apple's internal builds.

* PAL.xcodeproj/project.pbxproj:
* pal/graphics/WebGPU/Impl/WebGPUCreateImpl.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUImpl.cpp.
(PAL::WebGPU::create):
* pal/graphics/WebGPU/Impl/WebGPUCreateImpl.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUImpl.h.
* pal/graphics/WebGPU/Impl/WebGPUImpl.cpp:
(PAL::WebGPU::GPUImpl::create): Deleted.
* pal/graphics/WebGPU/Impl/WebGPUImpl.h:

Source/WebKit:

* GPUProcess/graphics/WebGPU/RemoteGPU.cpp:
(WebKit::RemoteGPU::workQueueInitialize):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createGPUForWebGPU const):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::createGPUForWebGPU const):

Modified Paths

trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUImpl.cpp
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUImpl.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteGPU.cpp
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm


Added Paths

trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUCreateImpl.cpp
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUCreateImpl.h




Diff

Modified: trunk/Source/WebCore/PAL/ChangeLog (293105 => 293106)

--- trunk/Source/WebCore/PAL/ChangeLog	2022-04-20 17:33:43 UTC (rev 293105)
+++ trunk/Source/WebCore/PAL/ChangeLog	2022-04-20 17:43:39 UTC (rev 293106)
@@ -1,5 +1,32 @@
 2022-04-20  Myles C. Maxfield  
 
+[WebGPU] WebKit and WebKitLegacy shouldn't need to know about WebGPU.framework
+https://bugs.webkit.org/show_bug.cgi?id=239528
+
+
+Unreviewed build fix.
+
+WebKit and WebKitLegacy create a WebGPU implementation from pal/graphics/WebGPU/Impl. This implementation
+knows about WebGPU.framework. However, the create() function doesn't need to know about WebGPU.framework,
+and its header doesn't need to include . Only the .cpp files need to know about
+, and those .cpp files are invisible from WebKit and WebKitLegacy's points of view. So,
+this patch splits the PAL header into:
+1. A header which includes a creation function, but doesn't know about WebGPU.framework, and
+2. A header which knows about WebGPU.framework, but doesn't hold the creation function used by WebKit or
+   WebKitLegacy.
+
+This fixes one of Apple's internal builds.
+
+* PAL.xcodeproj/project.pbxproj:
+* pal/graphics/WebGPU/Impl/WebGPUCreateImpl.cpp: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUImpl.cpp.
+(PAL::WebGPU::create):
+* pal/graphics/WebGPU/Impl/WebGPUCreateImpl.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUImpl.h.
+* pal/graphics/WebGPU/Impl/WebGPUImpl.cpp:
+(PAL::WebGPU::GPUImpl::create): Deleted.
+* pal/graphics/WebGPU/Impl/WebGPUImpl.h:
+
+2022-04-20  Myles C. Maxfield  
+
 [WebGPU] Fix texture conversion format typo
 https://bugs.webkit.org/show_bug.cgi?id=239446
 


Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (293105 => 293106)

--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2022-04-20 17:33:43 UTC (rev 293105)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2022-04-20 17:43:39 UTC (rev 293106)
@@ -62,6 +62,8 @@
 		1C77C8CE25D7A4A300635E0C /* OTSVGTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C77C8CD25D7A4A300635E0C /* OTSVGTable.cpp */; };
 		1CB709FC28034EDF00A3A637 /* WebGPUDeviceHolderImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CB709FA28034EDF00A3A637 /* WebGPUDeviceHolderImpl.cpp */; };
 		1CB709FD28034EDF00A3A637 /* WebGPUDeviceHolderImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CB709FB28034EDF00A3A637 /* WebGPUDeviceHo

[webkit-changes] [293098] trunk/Source/WebGPU

2022-04-20 Thread mmaxfield
Title: [293098] trunk/Source/WebGPU








Revision 293098
Author mmaxfi...@apple.com
Date 2022-04-20 09:10:11 -0700 (Wed, 20 Apr 2022)


Log Message
[WebGPU] Expand hardware capabilities to include features (beyond just limits)
https://bugs.webkit.org/show_bug.cgi?id=239443

Reviewed by Kimmo Kinnunen.

Only MTLGPUFamilyApple devices support depth/stencil textures in the managed/shared address space.
So, we have to expand the hardware capabilities infrastructure to be able to hold this kind
of information (so the texture creation function can consult with this state to know what storage
mode to use for the created texture). This patch replaces the stored WGPULimits struct with a new
struct, HardwareCapabilities, which holds a WGPULimits iniside it.

While I was here, I also included a Vector inside the HardwareCapabilities struct,
and hooked it up to the various places which need to be guarded by the presence of features.
This is needed for compressed textures to work (among other things). Because there are only
a handful of possible features, I elected to use a sorted Vector instead of using the big HashSet
hammer.

* WebGPU.xcodeproj/project.pbxproj:
* WebGPU/Adapter.h:
(WebGPU::Adapter::create):
* WebGPU/Adapter.mm:
(WebGPU::Adapter::Adapter):
(WebGPU::Adapter::enumerateFeatures):
(WebGPU::Adapter::getLimits):
(WebGPU::Adapter::hasFeature):
(WebGPU::Adapter::requestDevice):
* WebGPU/Device.h:
(WebGPU::Device::limits const):
(WebGPU::Device::features const):
(WebGPU::Device::baseCapabilities const):
* WebGPU/Device.mm:
(WebGPU::Device::create):
(WebGPU::Device::Device):
(WebGPU::Device::enumerateFeatures):
(WebGPU::Device::getLimits):
(WebGPU::Device::hasFeature):
* WebGPU/HardwareCapabilities.h: Renamed from Source/WebGPU/WebGPU/HardwareLimits.h.
* WebGPU/HardwareCapabilities.mm: Added.
(WebGPU::baseCapabilities):
(WebGPU::baseFeatures):
(WebGPU::apple3):
(WebGPU::apple4):
(WebGPU::apple5):
(WebGPU::apple6):
(WebGPU::apple7):
(WebGPU::mac2):
(WebGPU::mergeMaximum):
(WebGPU::mergeAlignment):
(WebGPU::mergeLimits):
(WebGPU::mergeFeatures):
(WebGPU::mergeBaseCapabilities):
(WebGPU::rawHardwareCapabilities):
(WebGPU::anyLimitIsBetterThan):
(WebGPU::includesUnsupportedFeatures):
(WebGPU::checkLimits):
(WebGPU::hardwareCapabilities):
(WebGPU::isValid):
* WebGPU/HardwareLimits.mm: Removed.
* WebGPU/Instance.mm:
(WebGPU::Instance::requestAdapter):
* WebGPU/Texture.mm:
(WebGPU::featureRequirementForFormat):
(WebGPU::Device::validateCreateTexture):
(WebGPU::storageMode):
(WebGPU::Device::createTexture):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Adapter.h
trunk/Source/WebGPU/WebGPU/Adapter.mm
trunk/Source/WebGPU/WebGPU/Device.h
trunk/Source/WebGPU/WebGPU/Device.mm
trunk/Source/WebGPU/WebGPU/Instance.mm
trunk/Source/WebGPU/WebGPU/Texture.mm
trunk/Source/WebGPU/WebGPU.xcodeproj/project.pbxproj


Added Paths

trunk/Source/WebGPU/WebGPU/HardwareCapabilities.h
trunk/Source/WebGPU/WebGPU/HardwareCapabilities.mm


Removed Paths

trunk/Source/WebGPU/WebGPU/HardwareLimits.h
trunk/Source/WebGPU/WebGPU/HardwareLimits.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (293097 => 293098)

--- trunk/Source/WebGPU/ChangeLog	2022-04-20 16:03:21 UTC (rev 293097)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-20 16:10:11 UTC (rev 293098)
@@ -1,5 +1,73 @@
 2022-04-20  Myles C. Maxfield  
 
+[WebGPU] Expand hardware capabilities to include features (beyond just limits)
+https://bugs.webkit.org/show_bug.cgi?id=239443
+
+Reviewed by Kimmo Kinnunen.
+
+Only MTLGPUFamilyApple devices support depth/stencil textures in the managed/shared address space.
+So, we have to expand the hardware capabilities infrastructure to be able to hold this kind
+of information (so the texture creation function can consult with this state to know what storage
+mode to use for the created texture). This patch replaces the stored WGPULimits struct with a new
+struct, HardwareCapabilities, which holds a WGPULimits iniside it.
+
+While I was here, I also included a Vector inside the HardwareCapabilities struct,
+and hooked it up to the various places which need to be guarded by the presence of features.
+This is needed for compressed textures to work (among other things). Because there are only
+a handful of possible features, I elected to use a sorted Vector instead of using the big HashSet
+hammer.
+
+* WebGPU.xcodeproj/project.pbxproj:
+* WebGPU/Adapter.h:
+(WebGPU::Adapter::create):
+* WebGPU/Adapter.mm:
+(WebGPU::Adapter::Adapter):
+(WebGPU::Adapter::enumerateFeatures):
+(WebGPU::Adapter::getLimits):
+(WebGPU::Adapter::hasFeature):
+(WebGPU::Adapter::requestDevice):
+* WebGPU/Device.h:
+(WebGPU::Device::limits const):
+(WebGPU::Device::features const):
+(WebGPU::Device::baseCapabilities const):
+* WebGPU/Device.mm:

[webkit-changes] [293096] trunk/Source/WebCore/PAL

2022-04-20 Thread mmaxfield
Title: [293096] trunk/Source/WebCore/PAL








Revision 293096
Author mmaxfi...@apple.com
Date 2022-04-20 08:56:59 -0700 (Wed, 20 Apr 2022)


Log Message
[WebGPU] Fix texture conversion format typo
https://bugs.webkit.org/show_bug.cgi?id=239446

Reviewed by Kimmo Kinnunen.

I mixed up "plus" and "unorm".

* pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp:
(PAL::WebGPU::ConvertToBackingContext::convertToBacking):

Modified Paths

trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp




Diff

Modified: trunk/Source/WebCore/PAL/ChangeLog (293095 => 293096)

--- trunk/Source/WebCore/PAL/ChangeLog	2022-04-20 15:32:08 UTC (rev 293095)
+++ trunk/Source/WebCore/PAL/ChangeLog	2022-04-20 15:56:59 UTC (rev 293096)
@@ -1,3 +1,15 @@
+2022-04-20  Myles C. Maxfield  
+
+[WebGPU] Fix texture conversion format typo
+https://bugs.webkit.org/show_bug.cgi?id=239446
+
+Reviewed by Kimmo Kinnunen.
+
+I mixed up "plus" and "unorm".
+
+* pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp:
+(PAL::WebGPU::ConvertToBackingContext::convertToBacking):
+
 2022-04-19  Antoine Quint  
 
 [model] set canonicalWebPageURL and urlFragment on ASVInlinePreview on iOS


Modified: trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp (293095 => 293096)

--- trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp	2022-04-20 15:32:08 UTC (rev 293095)
+++ trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp	2022-04-20 15:56:59 UTC (rev 293096)
@@ -573,7 +573,7 @@
 case TextureFormat::Astc12x12UnormSRGB:
 return static_cast(WGPUTextureFormat_ASTC12x12UnormSrgb);
 case TextureFormat::Depth24unormStencil8:
-return WGPUTextureFormat_Depth24PlusStencil8;
+return WGPUTextureFormat_Depth24UnormStencil8;
 case TextureFormat::Depth32floatStencil8:
 return static_cast(WGPUTextureFormat_Depth32FloatStencil8);
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [293095] trunk/Source/WebGPU

2022-04-20 Thread mmaxfield
Title: [293095] trunk/Source/WebGPU








Revision 293095
Author mmaxfi...@apple.com
Date 2022-04-20 08:32:08 -0700 (Wed, 20 Apr 2022)


Log Message
[WebGPU] RGB9E5Ufloat textures are not renderable
https://bugs.webkit.org/show_bug.cgi?id=239445

Reviewed by Kimmo Kinnunen.

I misread the table in the spec. This format isn't listed in
https://gpuweb.github.io/gpuweb/#plain-color-formats but is instead
listed in https://gpuweb.github.io/gpuweb/#packed-formats.

* WebGPU/Texture.mm:
(WebGPU::isRenderableFormat):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Texture.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (293094 => 293095)

--- trunk/Source/WebGPU/ChangeLog	2022-04-20 15:04:25 UTC (rev 293094)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-20 15:32:08 UTC (rev 293095)
@@ -1,3 +1,17 @@
+2022-04-20  Myles C. Maxfield  
+
+[WebGPU] RGB9E5Ufloat textures are not renderable
+https://bugs.webkit.org/show_bug.cgi?id=239445
+
+Reviewed by Kimmo Kinnunen.
+
+I misread the table in the spec. This format isn't listed in
+https://gpuweb.github.io/gpuweb/#plain-color-formats but is instead
+listed in https://gpuweb.github.io/gpuweb/#packed-formats.
+
+* WebGPU/Texture.mm:
+(WebGPU::isRenderableFormat):
+
 2022-04-18  Elliott Williams  
 
 [XCBuild] Use XCBuild for all command-line and project builds


Modified: trunk/Source/WebGPU/WebGPU/Texture.mm (293094 => 293095)

--- trunk/Source/WebGPU/WebGPU/Texture.mm	2022-04-20 15:04:25 UTC (rev 293094)
+++ trunk/Source/WebGPU/WebGPU/Texture.mm	2022-04-20 15:32:08 UTC (rev 293095)
@@ -759,7 +759,6 @@
 case WGPUTextureFormat_BGRA8Unorm:
 case WGPUTextureFormat_BGRA8UnormSrgb:
 case WGPUTextureFormat_RGB10A2Unorm:
-case WGPUTextureFormat_RGB9E5Ufloat:
 case WGPUTextureFormat_RG32Float:
 case WGPUTextureFormat_RG32Uint:
 case WGPUTextureFormat_RG32Sint:
@@ -781,6 +780,7 @@
 case WGPUTextureFormat_RG8Snorm:
 case WGPUTextureFormat_RGBA8Snorm:
 case WGPUTextureFormat_RG11B10Ufloat:
+case WGPUTextureFormat_RGB9E5Ufloat:
 case WGPUTextureFormat_BC1RGBAUnorm:
 case WGPUTextureFormat_BC1RGBAUnormSrgb:
 case WGPUTextureFormat_BC2RGBAUnorm:






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [293032] trunk/Source/WebCore

2022-04-19 Thread mmaxfield
Title: [293032] trunk/Source/WebCore








Revision 293032
Author mmaxfi...@apple.com
Date 2022-04-19 13:08:37 -0700 (Tue, 19 Apr 2022)


Log Message
[Cocoa] Add explanatory comments in fillVectorWithVerticalGlyphPositions() and simplify it somewhat
https://bugs.webkit.org/show_bug.cgi?id=239480

Reviewed by Alan Bujtas.

This adds a lot of explanatory text in fillVectorWithVerticalGlyphPositions(). It also rewrites some of it to
call shared functions (computeOverallTextMatrixInternal() and computeVerticalTextMatrixInternal()) instead of
reimplementing the contents of those functions.

The last thing this patch does is it stops adding in CTFontGetMatrix() to the text matrix, because:
1. It's always the identity, because we never create a font with one of these things
2. Even if it wasn't the identity, Core Text already applies it itself, so if we apply it, it would be double
   applied.

No new tests because there is no behavior change.

* platform/graphics/FontCascade.h:
* platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::computeBaseOverallTextMatrix):
(WebCore::computeOverallTextMatrix):
(WebCore::computeBaseVerticalTextMatrix):
(WebCore::computeVerticalTextMatrix):
(WebCore::fillVectorWithVerticalGlyphPositions):
(WebCore::showGlyphsWithAdvances):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCascade.h
trunk/Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (293031 => 293032)

--- trunk/Source/WebCore/ChangeLog	2022-04-19 19:24:15 UTC (rev 293031)
+++ trunk/Source/WebCore/ChangeLog	2022-04-19 20:08:37 UTC (rev 293032)
@@ -1,3 +1,30 @@
+2022-04-19  Myles C. Maxfield  
+
+[Cocoa] Add explanatory comments in fillVectorWithVerticalGlyphPositions() and simplify it somewhat
+https://bugs.webkit.org/show_bug.cgi?id=239480
+
+Reviewed by Alan Bujtas.
+
+This adds a lot of explanatory text in fillVectorWithVerticalGlyphPositions(). It also rewrites some of it to
+call shared functions (computeOverallTextMatrixInternal() and computeVerticalTextMatrixInternal()) instead of
+reimplementing the contents of those functions.
+
+The last thing this patch does is it stops adding in CTFontGetMatrix() to the text matrix, because:
+1. It's always the identity, because we never create a font with one of these things
+2. Even if it wasn't the identity, Core Text already applies it itself, so if we apply it, it would be double
+   applied.
+
+No new tests because there is no behavior change.
+
+* platform/graphics/FontCascade.h:
+* platform/graphics/coretext/FontCascadeCoreText.cpp:
+(WebCore::computeBaseOverallTextMatrix):
+(WebCore::computeOverallTextMatrix):
+(WebCore::computeBaseVerticalTextMatrix):
+(WebCore::computeVerticalTextMatrix):
+(WebCore::fillVectorWithVerticalGlyphPositions):
+(WebCore::showGlyphsWithAdvances):
+
 2022-04-19  Wenson Hsieh  
 
 [iOS] Text selection flickers when inserting text using dictation


Modified: trunk/Source/WebCore/platform/graphics/FontCascade.h (293031 => 293032)

--- trunk/Source/WebCore/platform/graphics/FontCascade.h	2022-04-19 19:24:15 UTC (rev 293031)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.h	2022-04-19 20:08:37 UTC (rev 293032)
@@ -29,6 +29,7 @@
 #include "FontCascadeDescription.h"
 #include "FontCascadeFonts.h"
 #include "Path.h"
+#include 
 #include 
 #include 
 #include 
@@ -91,7 +92,9 @@
 };
 
 #if USE(CORE_TEXT)
+AffineTransform computeBaseOverallTextMatrix(const std::optional& syntheticOblique);
 AffineTransform computeOverallTextMatrix(const Font&);
+AffineTransform computeBaseVerticalTextMatrix(const AffineTransform& previousTextMatrix);
 AffineTransform computeVerticalTextMatrix(const Font&, const AffineTransform& previousTextMatrix);
 #endif
 


Modified: trunk/Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp (293031 => 293032)

--- trunk/Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp	2022-04-19 19:24:15 UTC (rev 293031)
+++ trunk/Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp	2022-04-19 20:08:37 UTC (rev 293032)
@@ -60,44 +60,57 @@
 return result;
 }
 
-AffineTransform computeOverallTextMatrix(const Font& font)
+AffineTransform computeBaseOverallTextMatrix(const std::optional& syntheticOblique)
 {
-auto& platformData = font.platformData();
 AffineTransform result;
-if (!platformData.isColorBitmapFont())
-result = CTFontGetMatrix(platformData.ctFont());
+
+// This is a Y-flip, because text's coordinate system is increasing-Y-goes-up,
+// but WebKit's coordinate system is increasing-Y-goes-down.
 result.setB(-result.b());
 result.setD(-result.d());
+
+if (syntheticOblique)
+result = *syntheticOblique * result;
+
+return result;
+}
+
+AffineTransform compute

[webkit-changes] [293007] trunk/LayoutTests

2022-04-18 Thread mmaxfield
Title: [293007] trunk/LayoutTests








Revision 293007
Author mmaxfi...@apple.com
Date 2022-04-18 22:26:53 -0700 (Mon, 18 Apr 2022)


Log Message
[WebGPU] Unskip api/validation/createSampler.html 🎉
https://bugs.webkit.org/show_bug.cgi?id=239448

Reviewed by Darin Adler.

Turns out we were already passing it.

* http/tests/webgpu/webgpu/api/validation/createSampler-expected.txt:
* platform/ios-device-wk1/TestExpectations:
* platform/ios-simulator-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/http/tests/webgpu/webgpu/api/validation/createSampler-expected.txt
trunk/LayoutTests/platform/ios-device-wk1/TestExpectations
trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations
trunk/LayoutTests/platform/mac-wk1/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (293006 => 293007)

--- trunk/LayoutTests/ChangeLog	2022-04-19 03:25:12 UTC (rev 293006)
+++ trunk/LayoutTests/ChangeLog	2022-04-19 05:26:53 UTC (rev 293007)
@@ -1,3 +1,17 @@
+2022-04-18  Myles C. Maxfield  
+
+[WebGPU] Unskip api/validation/createSampler.html 🎉
+https://bugs.webkit.org/show_bug.cgi?id=239448
+
+Reviewed by Darin Adler.
+
+Turns out we were already passing it.
+
+* http/tests/webgpu/webgpu/api/validation/createSampler-expected.txt:
+* platform/ios-device-wk1/TestExpectations:
+* platform/ios-simulator-wk1/TestExpectations:
+* platform/mac-wk1/TestExpectations:
+
 2022-04-18  Tyler Wilcock  
 
 AX: Update the isolated tree in response to AXElementBusyChanged and AXTextChanged notifications


Modified: trunk/LayoutTests/http/tests/webgpu/webgpu/api/validation/createSampler-expected.txt (293006 => 293007)

--- trunk/LayoutTests/http/tests/webgpu/webgpu/api/validation/createSampler-expected.txt	2022-04-19 03:25:12 UTC (rev 293006)
+++ trunk/LayoutTests/http/tests/webgpu/webgpu/api/validation/createSampler-expected.txt	2022-04-19 05:26:53 UTC (rev 293007)
@@ -1,217 +1,4 @@
 
-FAIL :lodMinAndMaxClamp: assert_unreached:
-  - INFO: subcase: lodMinClamp=-4e-30;lodMaxClamp=-4e-30
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-assert@http://127.0.0.1:8000/webgpu/common/util/util.js:34:20
-@http://127.0.0.1:8000/webgpu/webgpu/util/device_pool.js:28:11
-asyncFunctionResume@[native code]
-@[native code]
-promiseReactionJobWithoutPromise@[native code]
-  - INFO: subcase: lodMinClamp=-4e-30;lodMaxClamp=-1
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-assert@http://127.0.0.1:8000/webgpu/common/util/util.js:34:20
-@http://127.0.0.1:8000/webgpu/webgpu/util/device_pool.js:28:11
-asyncFunctionResume@[native code]
-@http://127.0.0.1:8000/webgpu/webgpu/gpu_test.js:108:45
-asyncFunctionResume@[native code]
-@[native code]
-promiseReactionJobWithoutPromise@[native code]
-  - INFO: subcase: lodMinClamp=-4e-30;lodMaxClamp=0
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-4e-30;lodMaxClamp=0.5
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-4e-30;lodMaxClamp=1
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-4e-30;lodMaxClamp=10
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-4e-30;lodMaxClamp=4e+30
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-1;lodMaxClamp=-4e-30
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-1;lodMaxClamp=-1
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-1;lodMaxClamp=0
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-1;lodMaxClamp=0.5
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-1;lodMaxClamp=1
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-1;lodMaxClamp=10
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=-1;lodMaxClamp=4e+30
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=0;lodMaxClamp=-4e-30
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (elided: only 2 shown)
-  - INFO: subcase: lodMinClamp=0;lodMaxClamp=-1
-  - EXCEPTION: WebGPU device failed to initialize; not retrying
-  at (el

[webkit-changes] [292941] trunk/Source/WebGPU

2022-04-16 Thread mmaxfield
Title: [292941] trunk/Source/WebGPU








Revision 292941
Author mmaxfi...@apple.com
Date 2022-04-16 12:28:05 -0700 (Sat, 16 Apr 2022)


Log Message
[WebGPU] Fix the Big Sur build
https://bugs.webkit.org/show_bug.cgi?id=239422

Unreviewed.

HardwareLimits.mm:338:23: error: constexpr function never produces a constant _expression_ [-Winvalid-constexpr]

* WebGPU/HardwareLimits.mm:
(WebGPU::checkLimits):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/HardwareLimits.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292940 => 292941)

--- trunk/Source/WebGPU/ChangeLog	2022-04-16 04:47:58 UTC (rev 292940)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-16 19:28:05 UTC (rev 292941)
@@ -1,3 +1,15 @@
+2022-04-16  Myles C. Maxfield  
+
+[WebGPU] Fix the Big Sur build
+https://bugs.webkit.org/show_bug.cgi?id=239422
+
+Unreviewed.
+
+HardwareLimits.mm:338:23: error: constexpr function never produces a constant _expression_ [-Winvalid-constexpr]
+
+* WebGPU/HardwareLimits.mm:
+(WebGPU::checkLimits):
+
 2022-04-15  Myles C. Maxfield  
 
 [WebGPU] Implement hardware limits


Modified: trunk/Source/WebGPU/WebGPU/HardwareLimits.mm (292940 => 292941)

--- trunk/Source/WebGPU/WebGPU/HardwareLimits.mm	2022-04-16 04:47:58 UTC (rev 292940)
+++ trunk/Source/WebGPU/WebGPU/HardwareLimits.mm	2022-04-16 19:28:05 UTC (rev 292941)
@@ -335,7 +335,7 @@
 return result;
 }
 
-constexpr static bool checkLimits(const WGPULimits& limits)
+static bool checkLimits(const WGPULimits& limits)
 {
 // https://gpuweb.github.io/gpuweb/#limit-default
 auto defaultLimits = WGPULimits {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292940] trunk/Source

2022-04-15 Thread mmaxfield
Title: [292940] trunk/Source








Revision 292940
Author mmaxfi...@apple.com
Date 2022-04-15 21:47:58 -0700 (Fri, 15 Apr 2022)


Log Message
[WebGPU] Implement hardware limits
https://bugs.webkit.org/show_bug.cgi?id=239377

Reviewed by Darin Adler.

Source/WebCore/PAL:

This patch adds support for "limits" as described in https://gpuweb.github.io/gpuweb/#limits.
Various operations query the limits of the device to know whether the requested operation is
within range. E.g. if content tries to make a texture too big, this is how we catch it ahead of
time.

* pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.cpp:
(PAL::WebGPU::AdapterImpl::requestDevice):

Source/WebGPU:

We gather the values of the limits from the Metal Feature Set Tables
at https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf.

There are no limit tables for the Common families, so we use Apple
and Mac families instead.

Test: webgpu/api/validation/createTexture

* WebGPU.xcodeproj/project.pbxproj:
* WebGPU/Adapter.h:
(WebGPU::Adapter::create):
* WebGPU/Adapter.mm:
(WebGPU::Adapter::Adapter):
(WebGPU::Adapter::requestDevice):
(WebGPU::Adapter::requestInvalidDevice):
(wgpuAdapterRequestInvalidDeviceWithBlock):
(WebGPU::deviceMeetsRequiredLimits): Deleted.
* WebGPU/Device.h:
* WebGPU/Device.mm:
(WebGPU::Device::create):
(WebGPU::Device::Device):
* WebGPU/HardwareLimits.h: Copied from Source/WebGPU/WebGPU/Adapter.h.
* WebGPU/HardwareLimits.mm: Added.
(WebGPU::apple3):
(WebGPU::apple4):
(WebGPU::apple5):
(WebGPU::apple6):
(WebGPU::apple7):
(WebGPU::mac2):
(WebGPU::rawLimits):
(WebGPU::checkLimits):
(WebGPU::limits):
(WebGPU::isValid):
(WebGPU::anyLimitIsBetterThan):
* WebGPU/Instance.mm:
(WebGPU::Instance::requestAdapter):
* WebGPU/Texture.mm:
(WebGPU::Device::validateCreateTexture):
(WebGPU::Texture::createView):
* WebGPU/WebGPUExt.h:

Source/WTF:

Add missing #include.

* wtf/PageBlock.h:

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/PageBlock.h
trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.cpp
trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Adapter.h
trunk/Source/WebGPU/WebGPU/Adapter.mm
trunk/Source/WebGPU/WebGPU/Device.h
trunk/Source/WebGPU/WebGPU/Device.mm
trunk/Source/WebGPU/WebGPU/Instance.mm
trunk/Source/WebGPU/WebGPU/Texture.mm
trunk/Source/WebGPU/WebGPU/WebGPUExt.h
trunk/Source/WebGPU/WebGPU.xcodeproj/project.pbxproj


Added Paths

trunk/Source/WebGPU/WebGPU/HardwareLimits.h
trunk/Source/WebGPU/WebGPU/HardwareLimits.mm




Diff

Modified: trunk/Source/WTF/ChangeLog (292939 => 292940)

--- trunk/Source/WTF/ChangeLog	2022-04-16 04:44:41 UTC (rev 292939)
+++ trunk/Source/WTF/ChangeLog	2022-04-16 04:47:58 UTC (rev 292940)
@@ -1,3 +1,14 @@
+2022-04-15  Myles C. Maxfield  
+
+[WebGPU] Implement hardware limits
+https://bugs.webkit.org/show_bug.cgi?id=239377
+
+Reviewed by Darin Adler.
+
+Add missing #include.
+
+* wtf/PageBlock.h:
+
 2022-04-15  Michael Catanzaro  
 
 IGNORE_WARNINGS_BEGIN should not warn about unrecognized warnings


Modified: trunk/Source/WTF/wtf/PageBlock.h (292939 => 292940)

--- trunk/Source/WTF/wtf/PageBlock.h	2022-04-16 04:44:41 UTC (rev 292939)
+++ trunk/Source/WTF/wtf/PageBlock.h	2022-04-16 04:47:58 UTC (rev 292940)
@@ -25,6 +25,7 @@
 
 #pragma once
 
+#include 
 #include 
 
 namespace WTF {


Modified: trunk/Source/WebCore/PAL/ChangeLog (292939 => 292940)

--- trunk/Source/WebCore/PAL/ChangeLog	2022-04-16 04:44:41 UTC (rev 292939)
+++ trunk/Source/WebCore/PAL/ChangeLog	2022-04-16 04:47:58 UTC (rev 292940)
@@ -1,3 +1,18 @@
+2022-04-15  Myles C. Maxfield  
+
+[WebGPU] Implement hardware limits
+https://bugs.webkit.org/show_bug.cgi?id=239377
+
+Reviewed by Darin Adler.
+
+This patch adds support for "limits" as described in https://gpuweb.github.io/gpuweb/#limits.
+Various operations query the limits of the device to know whether the requested operation is
+within range. E.g. if content tries to make a texture too big, this is how we catch it ahead of
+time.
+
+* pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.cpp:
+(PAL::WebGPU::AdapterImpl::requestDevice):
+
 2022-04-14  Wenson Hsieh  
 
 [iOS] [WK2] Managed pasteboard should function for all managed domains


Modified: trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.cpp (292939 => 292940)

--- trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.cpp	2022-04-16 04:44:41 UTC (rev 292939)
+++ trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.cpp	2022-04-16 04:47:58 UTC (rev 292940)
@@ -149,43 +149,95 @@
 return m_convertToBackingContext->convertToBacking(featureName);
 });
 
-WGPURequiredLimits limits {
-nullptr, {
-0, // maxTextureDimension1D
-0, // maxTextureDimension2D
-0, // maxTextureDimension3D
-0, // maxTextureArrayLayers
-

[webkit-changes] [292859] trunk

2022-04-13 Thread mmaxfield
Title: [292859] trunk








Revision 292859
Author mmaxfi...@apple.com
Date 2022-04-13 23:19:01 -0700 (Wed, 13 Apr 2022)


Log Message
Revert r291846 because it caused a 3% performance regression
https://bugs.webkit.org/show_bug.cgi?id=239323


Rubber-stamped by Stephanie Lewis.

Source/WebCore:

I'm having trouble figuring out why this caused a regression, so I'm reverting the patch
wholesale while I can do more investigation.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::normalizeWeight):
(WebCore::denormalizeWeight):
(WebCore::preparePlatformFont):
(WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
(WebCore::FontCache::platformInit):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::normalizeGXWeight): Deleted.
(WebCore::normalizeCTWeight): Deleted.
(WebCore::denormalizeGXWeight): Deleted.
(WebCore::denormalizeCTWeight): Deleted.
(WebCore::overrideEnhanceTextLegibility): Deleted.
(WebCore::setOverrideEnhanceTextLegibility): Deleted.
(WebCore::shouldEnhanceTextLegibility): Deleted.
* platform/graphics/cocoa/FontCacheCoreText.h:
* testing/Internals.cpp:
(WebCore::Internals::setOverrideEnhanceTextLegibility): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebCore/PAL:

* pal/spi/cf/CoreTextSPI.h:
* pal/spi/cocoa/AccessibilitySupportSPI.h:

LayoutTests:

* TestExpectations:
* fast/text/accessibility-bold-expected-mismatch.html: Removed.
* fast/text/accessibility-bold.html: Removed.
* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/TestExpectations
trunk/LayoutTests/platform/ios/TestExpectations
trunk/LayoutTests/platform/ios-wk2/TestExpectations
trunk/LayoutTests/platform/mac/TestExpectations
trunk/LayoutTests/platform/mac-wk2/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/pal/spi/cf/CoreTextSPI.h
trunk/Source/WebCore/PAL/pal/spi/cocoa/AccessibilitySupportSPI.h
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h
trunk/Source/WebCore/testing/Internals.cpp
trunk/Source/WebCore/testing/Internals.h
trunk/Source/WebCore/testing/Internals.idl


Removed Paths

trunk/LayoutTests/fast/text/accessibility-bold-expected-mismatch.html
trunk/LayoutTests/fast/text/accessibility-bold.html




Diff

Modified: trunk/LayoutTests/ChangeLog (292858 => 292859)

--- trunk/LayoutTests/ChangeLog	2022-04-14 06:11:25 UTC (rev 292858)
+++ trunk/LayoutTests/ChangeLog	2022-04-14 06:19:01 UTC (rev 292859)
@@ -1,3 +1,19 @@
+2022-04-13  Myles C. Maxfield  
+
+Revert r291846 because it caused a 3% performance regression
+https://bugs.webkit.org/show_bug.cgi?id=239323
+
+
+Rubber-stamped by Stephanie Lewis.
+
+* TestExpectations:
+* fast/text/accessibility-bold-expected-mismatch.html: Removed.
+* fast/text/accessibility-bold.html: Removed.
+* platform/ios-wk2/TestExpectations:
+* platform/ios/TestExpectations:
+* platform/mac-wk2/TestExpectations:
+* platform/mac/TestExpectations:
+
 2022-04-13  Antoine Quint  
 
 [web-animations] REGRESSION(r291527): assertion hit during teardown of document with CSS Animations


Modified: trunk/LayoutTests/TestExpectations (292858 => 292859)

--- trunk/LayoutTests/TestExpectations	2022-04-14 06:11:25 UTC (rev 292858)
+++ trunk/LayoutTests/TestExpectations	2022-04-14 06:19:01 UTC (rev 292859)
@@ -5207,9 +5207,6 @@
 webkit.org/b/237108 http/tests/websocket/tests/hybi/deflate-frame-parameter.html [ Failure ] # 
 webkit.org/b/237108 http/tests/websocket/tests/hybi/handshake-ok-with-legacy-sec-websocket-response-headers.html [ Pass Failure ]
 
-# This test is only relevant on Apple platforms.
-fast/text/accessibility-bold.html [ Pass ImageOnlyFailure ]
-
 # Only certain ports have WebGPU implementations.
 http/tests/webgpu [ Failure ImageOnlyFailure Pass Timeout ]
 


Deleted: trunk/LayoutTests/fast/text/accessibility-bold-expected-mismatch.html (292858 => 292859)

--- trunk/LayoutTests/fast/text/accessibility-bold-expected-mismatch.html	2022-04-14 06:11:25 UTC (rev 292858)
+++ trunk/LayoutTests/fast/text/accessibility-bold-expected-mismatch.html	2022-04-14 06:19:01 UTC (rev 292859)
@@ -1,15 +0,0 @@
-
-
-
-
-if (window.internals) {
-window.internals.invalidateFontCache();
-window.internals.setOverrideEnhanceTextLegibility(false);
-}
-
-
-
-This test makes sure that accessibility bold is applied to font-family: system-ui. The test passes if the text below is bold.
-Hello this is text
-
-


Deleted: trunk/LayoutTests/fast/text/accessibility-bold.html (292858 => 292859)

--- trunk/LayoutTests/fast/text/accessibility-bold.html	2022-04-14 06:11:25 UTC (rev 292858)
+++ trunk/LayoutTests/fast/text/accessibility-bold.html	2022-04-14 06:19:01 UTC (rev 292859)
@@ -1,15 +0,0

[webkit-changes] [292788] trunk

2022-04-12 Thread mmaxfield
Title: [292788] trunk








Revision 292788
Author mmaxfi...@apple.com
Date 2022-04-12 15:30:37 -0700 (Tue, 12 Apr 2022)


Log Message
[WKTR] [DRT] Only enable WebGPU for the LayoutTests/http/tests/webgpu directory
https://bugs.webkit.org/show_bug.cgi?id=238779

Reviewed by Darin Adler.

Tools:

We have a set of hardcoded directories already; this adds to that.
WebGPU is only ready for LayoutTests to use; it isn't ready for any other WKTR/DRT usage.

* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):
* TestRunnerShared/TestFeatures.cpp:
(WTR::shouldEnableWebGPU):
(WTR::hardcodedFeaturesBasedOnPathForTest):
* WebKitTestRunner/TestOptions.cpp:
(WTR::TestOptions::defaults):

LayoutTests:

* platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt
trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt
trunk/Tools/ChangeLog
trunk/Tools/DumpRenderTree/TestOptions.cpp
trunk/Tools/TestRunnerShared/TestFeatures.cpp
trunk/Tools/WebKitTestRunner/TestOptions.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (292787 => 292788)

--- trunk/LayoutTests/ChangeLog	2022-04-12 22:13:47 UTC (rev 292787)
+++ trunk/LayoutTests/ChangeLog	2022-04-12 22:30:37 UTC (rev 292788)
@@ -1,3 +1,13 @@
+2022-04-12  Myles C. Maxfield  
+
+[WKTR] [DRT] Only enable WebGPU for the LayoutTests/http/tests/webgpu directory
+https://bugs.webkit.org/show_bug.cgi?id=238779
+
+Reviewed by Darin Adler.
+
+* platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt:
+* platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt:
+
 2022-04-12  Karl Rackler  
 
 [ BigSur+ wk2 Release ] css3/masking/reference-clip-path-animate-transform-repaint.html is a flaky failure


Modified: trunk/LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt (292787 => 292788)

--- trunk/LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt	2022-04-12 22:13:47 UTC (rev 292787)
+++ trunk/LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt	2022-04-12 22:30:37 UTC (rev 292788)
@@ -5,7 +5,6 @@
 navigator.appVersion is OK
 navigator.cookieEnabled is OK
 navigator.getStorageUpdates() is OK
-navigator.gpu is OK
 navigator.hardwareConcurrency is OK
 navigator.javaEnabled() is OK
 navigator.language is OK
@@ -33,7 +32,6 @@
 navigator.appVersion is OK
 navigator.cookieEnabled is OK
 navigator.getStorageUpdates() is OK
-navigator.gpu is OK
 navigator.hardwareConcurrency is OK
 navigator.javaEnabled() is OK
 navigator.language is OK


Modified: trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt (292787 => 292788)

--- trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt	2022-04-12 22:13:47 UTC (rev 292787)
+++ trunk/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt	2022-04-12 22:30:37 UTC (rev 292788)
@@ -9,7 +9,6 @@
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
-navigator.gpu is OK
 navigator.hardwareConcurrency is OK
 navigator.isLoggedIn() is OK
 navigator.javaEnabled() is OK
@@ -47,7 +46,6 @@
 navigator.cookieEnabled is OK
 navigator.credentials is OK
 navigator.getStorageUpdates() is OK
-navigator.gpu is OK
 navigator.hardwareConcurrency is OK
 navigator.isLoggedIn() is OK
 navigator.javaEnabled() is OK


Modified: trunk/Tools/ChangeLog (292787 => 292788)

--- trunk/Tools/ChangeLog	2022-04-12 22:13:47 UTC (rev 292787)
+++ trunk/Tools/ChangeLog	2022-04-12 22:30:37 UTC (rev 292788)
@@ -1,3 +1,21 @@
+2022-04-12  Myles C. Maxfield  
+
+[WKTR] [DRT] Only enable WebGPU for the LayoutTests/http/tests/webgpu directory
+https://bugs.webkit.org/show_bug.cgi?id=238779
+
+Reviewed by Darin Adler.
+
+We have a set of hardcoded directories already; this adds to that.
+WebGPU is only ready for LayoutTests to use; it isn't ready for any other WKTR/DRT usage.
+
+* DumpRenderTree/TestOptions.cpp:
+(WTR::TestOptions::defaults):
+* TestRunnerShared/TestFeatures.cpp:
+(WTR::shouldEnableWebGPU):
+(WTR::hardcodedFeaturesBasedOnPathForTest):
+* WebKitTestRunner/TestOptions.cpp:
+(WTR::TestOptions::defaults):
+
 2022-04-12  Jonathan Bedard  
 
 [Merge-Queue] Prioritize oldest builds first


Modified: trunk/Tools/DumpRenderTree/TestOptions.cpp (292787 => 292788)

--- trunk/Tools/DumpRenderTree/TestOptions.cpp	2022-04-12 22:13:47 UTC (rev 292787)
+++ trunk/Tools/DumpRenderTree/TestOptions.cpp	2022-04-12 22:30:37 UTC (rev 292788)
@@ -101,7 +101,6 @@
 { "TextAutosizingEnabled", false },
 { "UsesBackForwardCache", false },
 { "WebAudioEnabl

[webkit-changes] [292787] trunk/Source/WebGPU

2022-04-12 Thread mmaxfield
Title: [292787] trunk/Source/WebGPU








Revision 292787
Author mmaxfi...@apple.com
Date 2022-04-12 15:13:47 -0700 (Tue, 12 Apr 2022)


Log Message
[WebGPU] Fix the watchOS build
https://bugs.webkit.org/show_bug.cgi?id=239256

Unreviewed.

* WebGPU/Buffer.mm:
(WebGPU::computeRangeSize):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Buffer.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292786 => 292787)

--- trunk/Source/WebGPU/ChangeLog	2022-04-12 21:40:00 UTC (rev 292786)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-12 22:13:47 UTC (rev 292787)
@@ -1,3 +1,13 @@
+2022-04-12  Myles C. Maxfield  
+
+[WebGPU] Fix the watchOS build
+https://bugs.webkit.org/show_bug.cgi?id=239256
+
+Unreviewed.
+
+* WebGPU/Buffer.mm:
+(WebGPU::computeRangeSize):
+
 2022-04-11  Myles C. Maxfield  
 
 [WebGPU] Fix the tvOS build (again)


Modified: trunk/Source/WebGPU/WebGPU/Buffer.mm (292786 => 292787)

--- trunk/Source/WebGPU/WebGPU/Buffer.mm	2022-04-12 21:40:00 UTC (rev 292786)
+++ trunk/Source/WebGPU/WebGPU/Buffer.mm	2022-04-12 22:13:47 UTC (rev 292787)
@@ -187,9 +187,9 @@
 return true;
 }
 
-static uint64_t computeRangeSize(uint64_t size, size_t offset)
+static size_t computeRangeSize(uint64_t size, size_t offset)
 {
-auto result = checkedDifference(size, offset);
+auto result = checkedDifference(size, offset);
 if (result.hasOverflowed())
 return 0;
 return result.value();






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292766] trunk/LayoutTests

2022-04-11 Thread mmaxfield
Title: [292766] trunk/LayoutTests








Revision 292766
Author mmaxfi...@apple.com
Date 2022-04-11 23:49:21 -0700 (Mon, 11 Apr 2022)


Log Message
Make fast/text/otsvg-canvas.html more robust
https://bugs.webkit.org/show_bug.cgi?id=239109


Unreviewed test gardening.

Turns out loading fonts is asynchronous.

* fast/text/otsvg-canvas.html:
* platform/mac-wk1/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/fast/text/otsvg-canvas.html
trunk/LayoutTests/platform/mac-wk1/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (292765 => 292766)

--- trunk/LayoutTests/ChangeLog	2022-04-12 06:34:44 UTC (rev 292765)
+++ trunk/LayoutTests/ChangeLog	2022-04-12 06:49:21 UTC (rev 292766)
@@ -1,3 +1,16 @@
+2022-04-11  Myles C. Maxfield  
+
+Make fast/text/otsvg-canvas.html more robust
+https://bugs.webkit.org/show_bug.cgi?id=239109
+
+
+Unreviewed test gardening.
+
+Turns out loading fonts is asynchronous.
+
+* fast/text/otsvg-canvas.html:
+* platform/mac-wk1/TestExpectations:
+
 2022-04-11  Tyler Wilcock  
 
 AX: Update isolated tree in response to AXReadOnlyStatusChanged, AXRequiredStatusChanged, and AXPressedStateChanged notifications


Modified: trunk/LayoutTests/fast/text/otsvg-canvas.html (292765 => 292766)

--- trunk/LayoutTests/fast/text/otsvg-canvas.html	2022-04-12 06:34:44 UTC (rev 292765)
+++ trunk/LayoutTests/fast/text/otsvg-canvas.html	2022-04-12 06:49:21 UTC (rev 292766)
@@ -20,10 +20,14 @@
 
 
 
+if (self.testRunner)
+testRunner.waitUntilDone();
 var context = document.getElementById("canvas").getContext("2d");
 [...document.fonts][0].load().then(function() {
 context.font = "50px 'WebFont'";
 context.fillText("bAbA", 10, 100);
+if (self.testRunner)
+testRunner.notifyDone();
 });
 
 


Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (292765 => 292766)

--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2022-04-12 06:34:44 UTC (rev 292765)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2022-04-12 06:49:21 UTC (rev 292766)
@@ -1662,8 +1662,6 @@
 [ BigSur+ arm64 ] editing/execCommand/insert-newline-in-quoted-content-crash.html [ Skip ]
 [ BigSur+ arm64 ] editing/execCommand/paste-as-quotation-disconnected-paragraph-ancestor-crash.html [ Skip ]
 
-webkit.org/b/236530 fast/text/otsvg-canvas.html [ ImageOnlyFailure ]
-
 # Push subscription tests don't work without service worker support.
 http/tests/push-api/subscribe-default-permissions-iframe-cross-origin.html [ Skip ]
 http/tests/push-api/subscribe-default-permissions-iframe-same-origin.html [ Skip ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292760] trunk/Source/WebGPU

2022-04-11 Thread mmaxfield
Title: [292760] trunk/Source/WebGPU








Revision 292760
Author mmaxfi...@apple.com
Date 2022-04-11 21:57:41 -0700 (Mon, 11 Apr 2022)


Log Message
[WebGPU] Fix the tvOS build (again)
https://bugs.webkit.org/show_bug.cgi?id=239106


Unreviewed.

Turns out PLATFORM(APPLETV) and PLATFORM(TVOS) are different things.

* WebGPU/Texture.mm:
(WebGPU::Device::createTexture):
(WebGPU::Texture::createView):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Texture.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292759 => 292760)

--- trunk/Source/WebGPU/ChangeLog	2022-04-12 03:43:50 UTC (rev 292759)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-12 04:57:41 UTC (rev 292760)
@@ -1,5 +1,19 @@
 2022-04-11  Myles C. Maxfield  
 
+[WebGPU] Fix the tvOS build (again)
+https://bugs.webkit.org/show_bug.cgi?id=239106
+
+
+Unreviewed.
+
+Turns out PLATFORM(APPLETV) and PLATFORM(TVOS) are different things.
+
+* WebGPU/Texture.mm:
+(WebGPU::Device::createTexture):
+(WebGPU::Texture::createView):
+
+2022-04-11  Myles C. Maxfield  
+
 [WebGPU] Use checked arithmetic
 https://bugs.webkit.org/show_bug.cgi?id=239058
 


Modified: trunk/Source/WebGPU/WebGPU/Texture.mm (292759 => 292760)

--- trunk/Source/WebGPU/WebGPU/Texture.mm	2022-04-12 03:43:50 UTC (rev 292759)
+++ trunk/Source/WebGPU/WebGPU/Texture.mm	2022-04-12 04:57:41 UTC (rev 292760)
@@ -2009,7 +2009,7 @@
 if (descriptor.size.depthOrArrayLayers > 1) {
 textureDescriptor.arrayLength = descriptor.size.depthOrArrayLayers;
 if (descriptor.sampleCount > 1) {
-#if PLATFORM(WATCHOS) || PLATFORM(TVOS)
+#if PLATFORM(WATCHOS) || PLATFORM(APPLETV)
 return Texture::createInvalid(*this);
 #else
 textureDescriptor.textureType = MTLTextureType2DMultisampleArray;
@@ -2313,7 +2313,7 @@
 break;
 case WGPUTextureViewDimension_2DArray:
 if (m_descriptor.sampleCount > 1) {
-#if PLATFORM(WATCHOS) || PLATFORM(TVOS)
+#if PLATFORM(WATCHOS) || PLATFORM(APPLETV)
 return TextureView::createInvalid(m_device);
 #else
 textureType = MTLTextureType2DMultisampleArray;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292757] trunk/Source

2022-04-11 Thread mmaxfield
Title: [292757] trunk/Source








Revision 292757
Author mmaxfi...@apple.com
Date 2022-04-11 20:00:18 -0700 (Mon, 11 Apr 2022)


Log Message
[WebGPU] Use checked arithmetic
https://bugs.webkit.org/show_bug.cgi?id=239058

Reviewed by Kimmo Kinnunen.

We have a bunch of places where overflow can occur.

Luckily, we can just detect overflow inside the validation functions, and not have
to do any inside the code that creates platform types (NSUInteger, etc.). This is
because if the validation code succeeds, then we are guaranteed that the cast to
NSUIntegers will succeed. This is because ranges in a resource are checked against
the size of the resource, and the size of the resource has been checked against
platform maximums, which are guaranteed to be smaller than the largest NSUInteger.

* WebGPU/BindGroup.mm:
(WebGPU::Device::createBindGroup):
* WebGPU/Buffer.mm:
(WebGPU::Buffer::validateGetMappedRange const):
(WebGPU::Buffer::getMappedRange):
(WebGPU::Buffer::validateMapAsync const):
(WebGPU::Buffer::mapAsync):
* WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::validateCopyBufferToBuffer):
(WebGPU::CommandEncoder::copyBufferToTexture):
(WebGPU::CommandEncoder::copyTextureToBuffer):
(WebGPU::CommandEncoder::copyTextureToTexture):
(WebGPU::CommandEncoder::validateClearBuffer):
(WebGPU::CommandEncoder::clearBuffer):
* WebGPU/Queue.mm:
(WebGPU::Queue::validateWriteBuffer const):
(WebGPU::Queue::writeTexture):
* WebGPU/Texture.h:
* WebGPU/Texture.mm:
(WebGPU::Texture::resolveTextureViewDescriptorDefaults const):
(WebGPU::Texture::validateCreateView const):
(WebGPU::Texture::createView):
(WebGPU::Texture::validateTextureCopyRange):
(WebGPU::Texture::validateLinearTextureData):

Modified Paths

trunk/Source/WTF/wtf/CheckedArithmetic.h
trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/BindGroup.mm
trunk/Source/WebGPU/WebGPU/Buffer.mm
trunk/Source/WebGPU/WebGPU/CommandEncoder.mm
trunk/Source/WebGPU/WebGPU/Queue.mm
trunk/Source/WebGPU/WebGPU/Texture.h
trunk/Source/WebGPU/WebGPU/Texture.mm




Diff

Modified: trunk/Source/WTF/wtf/CheckedArithmetic.h (292756 => 292757)

--- trunk/Source/WTF/wtf/CheckedArithmetic.h	2022-04-12 01:58:28 UTC (rev 292756)
+++ trunk/Source/WTF/wtf/CheckedArithmetic.h	2022-04-12 03:00:18 UTC (rev 292757)
@@ -1000,6 +1000,12 @@
 return Checked(value) + checkedSum(args...);
 }
 
+template
+Checked checkedDifference(U left, V right)
+{
+return Checked(left) - Checked(right);
+}
+
 // Sometimes, you just want to check if some math would overflow - the code to do the math is
 // already in place, and you want to guard it.
 
@@ -1010,7 +1016,7 @@
 
 template bool differenceOverflows(U left, U right)
 {
-return (Checked(left) - Checked(right)).hasOverflowed();
+return checkedDifference(left, right).hasOverflowed();
 }
 
 template
@@ -1056,6 +1062,8 @@
 using WTF::CrashOnOverflow;
 using WTF::RecordOverflow;
 using WTF::checkedSum;
+using WTF::checkedDifference;
+using WTF::checkedProduct;
 using WTF::differenceOverflows;
 using WTF::isInBounds;
 using WTF::productOverflows;


Modified: trunk/Source/WebGPU/ChangeLog (292756 => 292757)

--- trunk/Source/WebGPU/ChangeLog	2022-04-12 01:58:28 UTC (rev 292756)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-12 03:00:18 UTC (rev 292757)
@@ -1,5 +1,46 @@
 2022-04-11  Myles C. Maxfield  
 
+[WebGPU] Use checked arithmetic
+https://bugs.webkit.org/show_bug.cgi?id=239058
+
+Reviewed by Kimmo Kinnunen.
+
+We have a bunch of places where overflow can occur.
+
+Luckily, we can just detect overflow inside the validation functions, and not have
+to do any inside the code that creates platform types (NSUInteger, etc.). This is
+because if the validation code succeeds, then we are guaranteed that the cast to
+NSUIntegers will succeed. This is because ranges in a resource are checked against
+the size of the resource, and the size of the resource has been checked against
+platform maximums, which are guaranteed to be smaller than the largest NSUInteger.
+
+* WebGPU/BindGroup.mm:
+(WebGPU::Device::createBindGroup):
+* WebGPU/Buffer.mm:
+(WebGPU::Buffer::validateGetMappedRange const):
+(WebGPU::Buffer::getMappedRange):
+(WebGPU::Buffer::validateMapAsync const):
+(WebGPU::Buffer::mapAsync):
+* WebGPU/CommandEncoder.mm:
+(WebGPU::CommandEncoder::validateCopyBufferToBuffer):
+(WebGPU::CommandEncoder::copyBufferToTexture):
+(WebGPU::CommandEncoder::copyTextureToBuffer):
+(WebGPU::CommandEncoder::copyTextureToTexture):
+(WebGPU::CommandEncoder::validateClearBuffer):
+(WebGPU::CommandEncoder::clearBuffer):
+* WebGPU/Queue.mm:
+(WebGPU::Queue::validateWriteBuffer const):
+(WebGPU::Queue::writeTexture):
+* WebGPU/Texture.h:
+* WebGPU/Texture.mm:
+(WebGPU::Texture::resolveTextureViewDescriptorDefaults const):
+(We

[webkit-changes] [292748] trunk/Source/WebGPU

2022-04-11 Thread mmaxfield
Title: [292748] trunk/Source/WebGPU








Revision 292748
Author mmaxfi...@apple.com
Date 2022-04-11 17:40:29 -0700 (Mon, 11 Apr 2022)


Log Message
[WebGPU] WebGPU strings are UTF-8, not Latin-1
https://bugs.webkit.org/show_bug.cgi?id=239057

Reviewed by Kimmo Kinnunen.

Replace String::fromLatin1() with String::fromUTF8().

* WebGPU/APIConversions.h:
(WebGPU::fromAPI):
* WebGPU/Adapter.mm:
(WebGPU::Adapter::requestDevice):
* WebGPU/ComputePipeline.mm:
(WebGPU::createConstantValues):
(WebGPU::Device::createComputePipeline):
* WebGPU/ShaderModule.mm:
(WebGPU::earlyCompileShaderModule):
(WebGPU::Device::createShaderModule):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/APIConversions.h
trunk/Source/WebGPU/WebGPU/Adapter.mm
trunk/Source/WebGPU/WebGPU/ComputePipeline.mm
trunk/Source/WebGPU/WebGPU/ShaderModule.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292747 => 292748)

--- trunk/Source/WebGPU/ChangeLog	2022-04-12 00:30:21 UTC (rev 292747)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-12 00:40:29 UTC (rev 292748)
@@ -1,5 +1,25 @@
 2022-04-11  Myles C. Maxfield  
 
+[WebGPU] WebGPU strings are UTF-8, not Latin-1
+https://bugs.webkit.org/show_bug.cgi?id=239057
+
+Reviewed by Kimmo Kinnunen.
+
+Replace String::fromLatin1() with String::fromUTF8().
+
+* WebGPU/APIConversions.h:
+(WebGPU::fromAPI):
+* WebGPU/Adapter.mm:
+(WebGPU::Adapter::requestDevice):
+* WebGPU/ComputePipeline.mm:
+(WebGPU::createConstantValues):
+(WebGPU::Device::createComputePipeline):
+* WebGPU/ShaderModule.mm:
+(WebGPU::earlyCompileShaderModule):
+(WebGPU::Device::createShaderModule):
+
+2022-04-11  Myles C. Maxfield  
+
 [WebGPU] Make sure asynchronous things are asynchronous
 https://bugs.webkit.org/show_bug.cgi?id=239056
 


Modified: trunk/Source/WebGPU/WebGPU/APIConversions.h (292747 => 292748)

--- trunk/Source/WebGPU/WebGPU/APIConversions.h	2022-04-12 00:30:21 UTC (rev 292747)
+++ trunk/Source/WebGPU/WebGPU/APIConversions.h	2022-04-12 00:40:29 UTC (rev 292748)
@@ -171,7 +171,7 @@
 
 inline String fromAPI(const char* string)
 {
-return String::fromLatin1(string);
+return String::fromUTF8(string);
 }
 
 template 


Modified: trunk/Source/WebGPU/WebGPU/Adapter.mm (292747 => 292748)

--- trunk/Source/WebGPU/WebGPU/Adapter.mm	2022-04-12 00:30:21 UTC (rev 292747)
+++ trunk/Source/WebGPU/WebGPU/Adapter.mm	2022-04-12 00:40:29 UTC (rev 292748)
@@ -134,7 +134,7 @@
 return;
 }
 
-auto label = String::fromLatin1(descriptor.label);
+auto label = fromAPI(descriptor.label);
 instance().scheduleWork([strongThis = Ref { *this }, label = WTFMove(label), callback = WTFMove(callback)]() mutable {
 callback(WGPURequestDeviceStatus_Success, Device::create(strongThis->m_device, WTFMove(label), strongThis), { });
 });


Modified: trunk/Source/WebGPU/WebGPU/ComputePipeline.mm (292747 => 292748)

--- trunk/Source/WebGPU/WebGPU/ComputePipeline.mm	2022-04-12 00:30:21 UTC (rev 292747)
+++ trunk/Source/WebGPU/WebGPU/ComputePipeline.mm	2022-04-12 00:40:29 UTC (rev 292748)
@@ -71,7 +71,7 @@
 auto constantValues = [MTLFunctionConstantValues new];
 for (uint32_t i = 0; i < constantCount; ++i) {
 const auto& entry = constants[i];
-auto nameIterator = entryPointInformation.specializationConstantIndices.find(String::fromLatin1(entry.key));
+auto nameIterator = entryPointInformation.specializationConstantIndices.find(fromAPI(entry.key));
 if (nameIterator == entryPointInformation.specializationConstantIndices.end())
 return nullptr;
 auto specializationConstantIndex = nameIterator->value;
@@ -150,7 +150,7 @@
 const PipelineLayout& pipelineLayout = WebGPU::fromAPI(descriptor.layout);
 auto label = fromAPI(descriptor.label);
 
-auto libraryCreationResult = createLibrary(m_device, shaderModule, pipelineLayout, String::fromLatin1(descriptor.compute.entryPoint), label);
+auto libraryCreationResult = createLibrary(m_device, shaderModule, pipelineLayout, fromAPI(descriptor.compute.entryPoint), label);
 if (!libraryCreationResult)
 return ComputePipeline::createInvalid(*this);
 


Modified: trunk/Source/WebGPU/WebGPU/ShaderModule.mm (292747 => 292748)

--- trunk/Source/WebGPU/WebGPU/ShaderModule.mm	2022-04-12 00:30:21 UTC (rev 292747)
+++ trunk/Source/WebGPU/WebGPU/ShaderModule.mm	2022-04-12 00:40:29 UTC (rev 292748)
@@ -88,7 +88,7 @@
 const auto& hint = suppliedHints.hints[i];
 if (hint.nextInChain)
 return nullptr;
-auto hintKey = String::fromLatin1(hint.key);
+auto hintKey = fromAPI(hint.key);
 hints.add(hintKey, WebGPU::fromAPI(hint.hint.layout));
 auto convertedPipelineLayout = ShaderModule::convertPipelineLayout(WebGPU::fromAPI(hint.hint.layout));
 wgslHints.add(hintKey, WTFMove(convertedPipelineLayout));
@@ -109,7

[webkit-changes] [292747] trunk/Source/WebGPU

2022-04-11 Thread mmaxfield
Title: [292747] trunk/Source/WebGPU








Revision 292747
Author mmaxfi...@apple.com
Date 2022-04-11 17:30:21 -0700 (Mon, 11 Apr 2022)


Log Message
[WebGPU] Make sure asynchronous things are asynchronous
https://bugs.webkit.org/show_bug.cgi?id=239056

Reviewed by Kimmo Kinnunen.

This isn't strictly necessary, because these asynchronous callbacks get hooked up
to promises in the browser which only call their callbacks at microtask boundaries.
However, for native code that uses WebGPU.framework, it's probably better to make
sure the asynchronous callbacks are actually asynchronous.

* WebGPU/Adapter.mm:
(WebGPU::Adapter::requestDevice):
* WebGPU/Buffer.mm:
(WebGPU::Buffer::mapAsync):
* WebGPU/ComputePipeline.mm:
(WebGPU::Device::createComputePipelineAsync):
* WebGPU/Device.mm:
(WebGPU::Device::loseTheDevice):
(WebGPU::Device::popErrorScope):
* WebGPU/Instance.mm:
(WebGPU::Instance::requestAdapter):
* WebGPU/RenderPipeline.mm:
(WebGPU::Device::createRenderPipelineAsync):
* WebGPU/ShaderModule.mm:
(WebGPU::ShaderModule::getCompilationInfo):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Adapter.mm
trunk/Source/WebGPU/WebGPU/Buffer.mm
trunk/Source/WebGPU/WebGPU/ComputePipeline.mm
trunk/Source/WebGPU/WebGPU/Device.mm
trunk/Source/WebGPU/WebGPU/Instance.mm
trunk/Source/WebGPU/WebGPU/RenderPipeline.mm
trunk/Source/WebGPU/WebGPU/ShaderModule.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292746 => 292747)

--- trunk/Source/WebGPU/ChangeLog	2022-04-12 00:23:05 UTC (rev 292746)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-12 00:30:21 UTC (rev 292747)
@@ -1,5 +1,33 @@
 2022-04-11  Myles C. Maxfield  
 
+[WebGPU] Make sure asynchronous things are asynchronous
+https://bugs.webkit.org/show_bug.cgi?id=239056
+
+Reviewed by Kimmo Kinnunen.
+
+This isn't strictly necessary, because these asynchronous callbacks get hooked up
+to promises in the browser which only call their callbacks at microtask boundaries.
+However, for native code that uses WebGPU.framework, it's probably better to make
+sure the asynchronous callbacks are actually asynchronous.
+
+* WebGPU/Adapter.mm:
+(WebGPU::Adapter::requestDevice):
+* WebGPU/Buffer.mm:
+(WebGPU::Buffer::mapAsync):
+* WebGPU/ComputePipeline.mm:
+(WebGPU::Device::createComputePipelineAsync):
+* WebGPU/Device.mm:
+(WebGPU::Device::loseTheDevice):
+(WebGPU::Device::popErrorScope):
+* WebGPU/Instance.mm:
+(WebGPU::Instance::requestAdapter):
+* WebGPU/RenderPipeline.mm:
+(WebGPU::Device::createRenderPipelineAsync):
+* WebGPU/ShaderModule.mm:
+(WebGPU::ShaderModule::getCompilationInfo):
+
+2022-04-11  Myles C. Maxfield  
+
 [WebGPU] Implement missing validity checks
 https://bugs.webkit.org/show_bug.cgi?id=238722
 


Modified: trunk/Source/WebGPU/WebGPU/Adapter.mm (292746 => 292747)

--- trunk/Source/WebGPU/WebGPU/Adapter.mm	2022-04-12 00:23:05 UTC (rev 292746)
+++ trunk/Source/WebGPU/WebGPU/Adapter.mm	2022-04-12 00:30:21 UTC (rev 292747)
@@ -114,21 +114,30 @@
 void Adapter::requestDevice(const WGPUDeviceDescriptor& descriptor, CompletionHandler&&, String&&)>&& callback)
 {
 if (descriptor.nextInChain) {
-callback(WGPURequestDeviceStatus_Error, Device::createInvalid(*this), "Unknown descriptor type"_s);
+instance().scheduleWork([strongThis = Ref { *this }, callback = WTFMove(callback)]() mutable {
+callback(WGPURequestDeviceStatus_Error, Device::createInvalid(strongThis), "Unknown descriptor type"_s);
+});
 return;
 }
 
 if (descriptor.requiredFeaturesCount) {
-callback(WGPURequestDeviceStatus_Error, Device::createInvalid(*this), "Device does not support requested features"_s);
+instance().scheduleWork([strongThis = Ref { *this }, callback = WTFMove(callback)]() mutable {
+callback(WGPURequestDeviceStatus_Error, Device::createInvalid(strongThis), "Device does not support requested features"_s);
+});
 return;
 }
 
 if (descriptor.requiredLimits && !deviceMeetsRequiredLimits(m_device, *descriptor.requiredLimits)) {
-callback(WGPURequestDeviceStatus_Error, Device::createInvalid(*this), "Device does not support requested limits"_s);
+instance().scheduleWork([strongThis = Ref { *this }, callback = WTFMove(callback)]() mutable {
+callback(WGPURequestDeviceStatus_Error, Device::createInvalid(strongThis), "Device does not support requested limits"_s);
+});
 return;
 }
 
-callback(WGPURequestDeviceStatus_Success, Device::create(m_device, String::fromLatin1(descriptor.label), *this), { });
+auto label = String::fromLatin1(descriptor.label);
+instance().scheduleWork([strongThis = Ref { *this }, label = WTFMove(label), callback = WTFMove(callback)]() mutable {
+callback(WGPURequestDeviceStatus_Success, Dev

[webkit-changes] [292745] trunk/Source/WebCore/PAL

2022-04-11 Thread mmaxfield
Title: [292745] trunk/Source/WebCore/PAL








Revision 292745
Author mmaxfi...@apple.com
Date 2022-04-11 17:19:08 -0700 (Mon, 11 Apr 2022)


Log Message
[WebGPU] Unspecified texture size values should be set to 1, not 0
https://bugs.webkit.org/show_bug.cgi?id=239052

Reviewed by Kimmo Kinnunen.

If content says "Please create a texture of size [32, 32]" then we need to pad that
to [32, 32, 1] rather than [32, 32, 0].

Test: http/tests/webgpu/webgpu/api/validation/createTexture.html

* pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp:
(PAL::WebGPU::ConvertToBackingContext::convertToBacking):

Modified Paths

trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp




Diff

Modified: trunk/Source/WebCore/PAL/ChangeLog (292744 => 292745)

--- trunk/Source/WebCore/PAL/ChangeLog	2022-04-12 00:14:49 UTC (rev 292744)
+++ trunk/Source/WebCore/PAL/ChangeLog	2022-04-12 00:19:08 UTC (rev 292745)
@@ -1,5 +1,20 @@
 2022-04-11  Myles C. Maxfield  
 
+[WebGPU] Unspecified texture size values should be set to 1, not 0
+https://bugs.webkit.org/show_bug.cgi?id=239052
+
+Reviewed by Kimmo Kinnunen.
+
+If content says "Please create a texture of size [32, 32]" then we need to pad that
+to [32, 32, 1] rather than [32, 32, 0].
+
+Test: http/tests/webgpu/webgpu/api/validation/createTexture.html
+
+* pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp:
+(PAL::WebGPU::ConvertToBackingContext::convertToBacking):
+
+2022-04-11  Myles C. Maxfield  
+
 [WebGPU] Implement correct ownership for WGPUQueues
 https://bugs.webkit.org/show_bug.cgi?id=239050
 


Modified: trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp (292744 => 292745)

--- trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp	2022-04-12 00:14:49 UTC (rev 292744)
+++ trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUConvertToBackingContext.cpp	2022-04-12 00:19:08 UTC (rev 292745)
@@ -790,9 +790,9 @@
 {
 return WTF::switchOn(extent3D, [] (const Vector& vector) {
 return WGPUExtent3D {
-vector.size() > 0 ? vector[0] : 0,
-vector.size() > 1 ? vector[1] : 0,
-vector.size() > 2 ? vector[2] : 0,
+vector.size() > 0 ? vector[0] : 1,
+vector.size() > 1 ? vector[1] : 1,
+vector.size() > 2 ? vector[2] : 1,
 };
 }, [] (const Extent3DDict& extent) {
 return WGPUExtent3D {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292744] trunk/Source/WebGPU

2022-04-11 Thread mmaxfield
Title: [292744] trunk/Source/WebGPU








Revision 292744
Author mmaxfi...@apple.com
Date 2022-04-11 17:14:49 -0700 (Mon, 11 Apr 2022)


Log Message
[WebGPU] Implement missing validity checks
https://bugs.webkit.org/show_bug.cgi?id=238722

Reviewed by Kimmo Kinnunen.

Now that WebGPU objects have a notion of validity, we can implement all the
FIXMEs for validity checks.

* WebGPU/Buffer.mm:
(WebGPU::validateCreateBuffer):
(WebGPU::Buffer::validateMapAsync const):
* WebGPU/CommandEncoder.h:
(WebGPU::CommandEncoder::makeInvalid):
* WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::validateCopyBufferToBuffer):
(WebGPU::validateImageCopyBuffer):
(WebGPU::CommandEncoder::validateClearBuffer):
(WebGPU::CommandEncoder::validateFinish const):
(WebGPU::CommandEncoder::finish):
(WebGPU::CommandEncoder::popDebugGroup):
(WebGPU::validateCopyBufferToBuffer): Deleted.
(WebGPU::validateClearBuffer): Deleted.
* WebGPU/ComputePassEncoder.h:
(WebGPU::ComputePassEncoder::makeInvalid):
* WebGPU/ComputePassEncoder.mm:
(WebGPU::ComputePassEncoder::popDebugGroup):
* WebGPU/ObjectBase.h:
(WebGPU::ObjectBase::isValidToUseWith const):
(WebGPU::ObjectBase::device const):
* WebGPU/Queue.h:
(WebGPU::Queue::device const):
* WebGPU/Queue.mm:
(WebGPU::Queue::validateSubmit const):
(WebGPU::Queue::submit):
(WebGPU::Queue::validateWriteBuffer const):
* WebGPU/RenderBundleEncoder.h:
(WebGPU::RenderBundleEncoder::makeInvalid):
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::RenderBundleEncoder::popDebugGroup):
* WebGPU/RenderPassEncoder.h:
(WebGPU::RenderPassEncoder::makeInvalid):
* WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::popDebugGroup):
* WebGPU/Sampler.mm:
(WebGPU::validateCreateSampler):
* WebGPU/Texture.mm:
(WebGPU::Device::validateCreateTexture):
(WebGPU::Device::createTexture):
(WebGPU::Texture::validateCreateView const):
(WebGPU::Texture::createView):
(WebGPU::Texture::validateImageCopyTexture):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Texture.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292743 => 292744)

--- trunk/Source/WebGPU/ChangeLog	2022-04-12 00:10:17 UTC (rev 292743)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-12 00:14:49 UTC (rev 292744)
@@ -52,6 +52,18 @@
 (WebGPU::Texture::createView):
 (WebGPU::Texture::validateImageCopyTexture):
 
+2022-04-11  Myles C. Maxfield  
+
+[WebGPU] RGB9E5Ufloat textures should not be multisamplable
+https://bugs.webkit.org/show_bug.cgi?id=239053
+
+Reviewed by Kimmo Kinnunen.
+
+It's classified as a "packed format" rather than a "mixed component width format."
+
+* WebGPU/Texture.mm:
+(WebGPU::supportsMultisampling):
+
 2022-04-08  Myles C. Maxfield  
 
 [WebGPU] Fix the release build


Modified: trunk/Source/WebGPU/WebGPU/Texture.mm (292743 => 292744)

--- trunk/Source/WebGPU/WebGPU/Texture.mm	2022-04-12 00:10:17 UTC (rev 292743)
+++ trunk/Source/WebGPU/WebGPU/Texture.mm	2022-04-12 00:14:49 UTC (rev 292744)
@@ -868,7 +868,6 @@
 case WGPUTextureFormat_BGRA8UnormSrgb:
 case WGPUTextureFormat_RGB10A2Unorm:
 case WGPUTextureFormat_RG11B10Ufloat:
-case WGPUTextureFormat_RGB9E5Ufloat:
 case WGPUTextureFormat_RGBA16Uint:
 case WGPUTextureFormat_RGBA16Sint:
 case WGPUTextureFormat_RGBA16Float:
@@ -889,6 +888,7 @@
 case WGPUTextureFormat_RGBA32Float:
 case WGPUTextureFormat_RGBA32Uint:
 case WGPUTextureFormat_RGBA32Sint:
+case WGPUTextureFormat_RGB9E5Ufloat:
 case WGPUTextureFormat_BC1RGBAUnorm:
 case WGPUTextureFormat_BC1RGBAUnormSrgb:
 case WGPUTextureFormat_BC2RGBAUnorm:






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292742] trunk/Source/WebCore/PAL

2022-04-11 Thread mmaxfield
Title: [292742] trunk/Source/WebCore/PAL








Revision 292742
Author mmaxfi...@apple.com
Date 2022-04-11 17:07:17 -0700 (Mon, 11 Apr 2022)


Log Message
[WebGPU] Implement correct ownership for WGPUQueues
https://bugs.webkit.org/show_bug.cgi?id=239050

Reviewed by Kimmo Kinnunen.

WGPUQueues and WGPUDevices have a somewhat interesting relationship: neither is
reference-counted, and the WGPUDevice owns its WGPUQueue. This means that, if client
code wants to extend the lifetime of a WGPUQueue, it has to do this by extending the
lifetime of its owning WGPUDevice. Both objects are _javascript_ objects, so there has to
be some mechanism for a queue to extend the lifetime of its owning device. And yet, a
device owns a queue, so a queue can't have a queue have a Ref<> to its owning device,
because that would be a circular depndency.

Here's the old ownership graph:

  _javascript_
 
  | |
  | |
  V |
PAL::WebGPU::DeviceImpl |
  |\|
  | -   |
  |   \ V
  |-> PAL::WebGPU::QueueImpl
  | |
  | |
  V |
  WGPUDevice|
\   |
 -  |
  \ V
   > WGPUQueue

You can see that there's a problem here: WGPUQueue has 2 owners, but it's not a
reference-counted object.

The solution is to add a new node into the ownership graph, like this:

  _javascript_
 
  | |
  | |
  V |
PAL::WebGPU::DeviceImpl |
   \   \|
\   -   |
 \\ V
  \ -> PAL::WebGPU::QueueImpl
   \  /
\/
 \  /
  VV
  PAL::WebGPU::DeviceHolder
  /
 /
/
   /
  V
  WGPUDevice
\
 -
  \
   > WGPUQueue

This way, both WGPUDevice and WGPUQueue have a single owner, there are no cycles,
and there is a path from PAL::WebGPU::QueueImpl to WGPUDevice.

* PAL.xcodeproj/project.pbxproj:
* pal/graphics/WebGPU/Impl/WebGPUDeviceHolderImpl.cpp: Added.
(PAL::WebGPU::DeviceHolderImpl::DeviceHolderImpl):
(PAL::WebGPU::DeviceHolderImpl::~DeviceHolderImpl):
* pal/graphics/WebGPU/Impl/WebGPUDeviceHolderImpl.h: Copied from Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUQueueImpl.h.
* pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.cpp:
(PAL::WebGPU::DeviceImpl::DeviceImpl):
(PAL::WebGPU::DeviceImpl::destroy):
(PAL::WebGPU::DeviceImpl::createBuffer):
(PAL::WebGPU::DeviceImpl::createTexture):
(PAL::WebGPU::DeviceImpl::createSampler):
(PAL::WebGPU::DeviceImpl::createBindGroupLayout):
(PAL::WebGPU::DeviceImpl::createPipelineLayout):
(PAL::WebGPU::DeviceImpl::createBindGroup):
(PAL::WebGPU::DeviceImpl::createShaderModule):
(PAL::WebGPU::DeviceImpl::createComputePipeline):
(PAL::WebGPU::DeviceImpl::createRenderPipeline):
(PAL::WebGPU::DeviceImpl::createComputePipelineAsync):
(PAL::WebGPU::DeviceImpl::createRenderPipelineAsync):
(PAL::WebGPU::DeviceImpl::createCommandEncoder):
(PAL::WebGPU::DeviceImpl::createRenderBundleEncoder):
(PAL::WebGPU::DeviceImpl::createQuerySet):
(PAL::WebGPU::DeviceImpl::pushErrorScope):
(PAL::WebGPU::DeviceImpl::popErrorScope):
(PAL::WebGPU::DeviceImpl::setLabelInternal):
(PAL::WebGPU::DeviceImpl::~DeviceImpl): Deleted.
* pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.h:
* pal/graphics/WebGPU/Impl/WebGPUQueueImpl.cpp:
(PAL::WebGPU::QueueImpl::QueueImpl):
(PAL::WebGPU::QueueImpl::submit):
(PAL::WebGPU::QueueImpl::onSubmittedWorkDone):
(PAL::WebGPU::QueueImpl::writeBuffer):
(PAL::WebGPU::QueueImpl::writeTexture):
(PAL::WebGPU::QueueImpl::setLabelInternal):
(PAL::WebGPU::QueueImpl::~QueueImpl): Deleted.
* pal/graphics/WebGPU/Impl/WebGPUQueueImpl.h:

Modified Paths

trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.cpp
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/

[webkit-changes] [292741] trunk/Source

2022-04-11 Thread mmaxfield
Title: [292741] trunk/Source








Revision 292741
Author mmaxfi...@apple.com
Date 2022-04-11 17:04:35 -0700 (Mon, 11 Apr 2022)


Log Message
[WebGPU] Hook up device.queue to the IDL
https://bugs.webkit.org/show_bug.cgi?id=239043

Reviewed by Kimmo Kinnunen.

Source/WebCore:

It seems when I imported the WebGPU IDLs, I somehow skipped GPUDevice.queue.
I was probably unsure about the ownership model. Now that the ownership model
is straightened out, this can be implemented.

This is needed to run any of the CTS tests.

* Modules/WebGPU/GPUDevice.cpp:
(WebCore::GPUDevice::queue const):
* Modules/WebGPU/GPUDevice.h:
(WebCore::GPUDevice::m_queue):
(WebCore::GPUDevice::m_backing): Deleted.
* Modules/WebGPU/GPUDevice.idl:

Source/WebCore/PAL:

* pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.cpp:
(PAL::WebGPU::DeviceImpl::DeviceImpl):
(PAL::WebGPU::DeviceImpl::queue):
* pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.h:
* pal/graphics/WebGPU/WebGPUDevice.h:

Source/WebKit:

* GPUProcess/graphics/WebGPU/RemoteAdapter.cpp:
(WebKit::RemoteAdapter::requestDevice):
* GPUProcess/graphics/WebGPU/RemoteAdapter.h:
* GPUProcess/graphics/WebGPU/RemoteAdapter.messages.in:
* GPUProcess/graphics/WebGPU/RemoteDevice.cpp:
(WebKit::RemoteDevice::RemoteDevice):
(WebKit::RemoteDevice::queue):
* GPUProcess/graphics/WebGPU/RemoteDevice.h:
* WebProcess/GPU/graphics/WebGPU/RemoteAdapterProxy.cpp:
(WebKit::WebGPU::RemoteAdapterProxy::requestDevice):
* WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.cpp:
(WebKit::WebGPU::RemoteDeviceProxy::RemoteDeviceProxy):
(WebKit::WebGPU::RemoteDeviceProxy::queue):
* WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/WebGPU/GPUDevice.cpp
trunk/Source/WebCore/Modules/WebGPU/GPUDevice.h
trunk/Source/WebCore/Modules/WebGPU/GPUDevice.idl
trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.cpp
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.h
trunk/Source/WebCore/PAL/pal/graphics/WebGPU/WebGPUDevice.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteAdapter.cpp
trunk/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteAdapter.h
trunk/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteAdapter.messages.in
trunk/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.cpp
trunk/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.h
trunk/Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteAdapterProxy.cpp
trunk/Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.cpp
trunk/Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteDeviceProxy.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (292740 => 292741)

--- trunk/Source/WebCore/ChangeLog	2022-04-11 23:48:05 UTC (rev 292740)
+++ trunk/Source/WebCore/ChangeLog	2022-04-12 00:04:35 UTC (rev 292741)
@@ -1,3 +1,23 @@
+2022-04-11  Myles C. Maxfield  
+
+[WebGPU] Hook up device.queue to the IDL
+https://bugs.webkit.org/show_bug.cgi?id=239043
+
+Reviewed by Kimmo Kinnunen.
+
+It seems when I imported the WebGPU IDLs, I somehow skipped GPUDevice.queue.
+I was probably unsure about the ownership model. Now that the ownership model
+is straightened out, this can be implemented.
+
+This is needed to run any of the CTS tests.
+
+* Modules/WebGPU/GPUDevice.cpp:
+(WebCore::GPUDevice::queue const):
+* Modules/WebGPU/GPUDevice.h:
+(WebCore::GPUDevice::m_queue):
+(WebCore::GPUDevice::m_backing): Deleted.
+* Modules/WebGPU/GPUDevice.idl:
+
 2022-04-11  Philippe Normand  
 
 [GStreamer] Debugs logs from VideoSinkCommon are missing


Modified: trunk/Source/WebCore/Modules/WebGPU/GPUDevice.cpp (292740 => 292741)

--- trunk/Source/WebCore/Modules/WebGPU/GPUDevice.cpp	2022-04-11 23:48:05 UTC (rev 292740)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUDevice.cpp	2022-04-12 00:04:35 UTC (rev 292741)
@@ -86,6 +86,11 @@
 return GPUSupportedLimits::create(m_backing->limits());
 }
 
+GPUQueue& GPUDevice::queue() const
+{
+return m_queue;
+}
+
 void GPUDevice::destroy()
 {
 m_backing->destroy();


Modified: trunk/Source/WebCore/Modules/WebGPU/GPUDevice.h (292740 => 292741)

--- trunk/Source/WebCore/Modules/WebGPU/GPUDevice.h	2022-04-11 23:48:05 UTC (rev 292740)
+++ trunk/Source/WebCore/Modules/WebGPU/GPUDevice.h	2022-04-12 00:04:35 UTC (rev 292741)
@@ -33,6 +33,7 @@
 #include "GPUError.h"
 #include "GPUErrorFilter.h"
 #include "GPURenderPipeline.h"
+#include "GPUQueue.h"
 #include "JSDOMPromiseDeferred.h"
 #include "ScriptExecutionContext.h"
 #include 
@@ -90,6 +91,8 @@
 Ref features() const;
 Ref limits() const;
 
+GPUQueue& queue() const;
+
 void destroy();
 
 Ref createBuffer(const GPUBufferDescriptor&);
@@ -131,6 +134,7 @@
 GPUDevice(ScriptExecutionContext* scriptExecutionContext, Ref&& backing)
 : ActiveDOMObject { scriptExecutionContext }
 , m_backing(WTF

[webkit-changes] [292735] trunk/Source/WebCore/PAL

2022-04-11 Thread mmaxfield
Title: [292735] trunk/Source/WebCore/PAL








Revision 292735
Author mmaxfi...@apple.com
Date 2022-04-11 16:28:14 -0700 (Mon, 11 Apr 2022)


Log Message
Sort PAL.xcodeproj.
https://bugs.webkit.org/show_bug.cgi?id=239050

Reviewed by Kimmo Kinnunen.

* PAL.xcodeproj/project.pbxproj:

Modified Paths

trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj




Diff

Modified: trunk/Source/WebCore/PAL/ChangeLog (292734 => 292735)

--- trunk/Source/WebCore/PAL/ChangeLog	2022-04-11 23:21:34 UTC (rev 292734)
+++ trunk/Source/WebCore/PAL/ChangeLog	2022-04-11 23:28:14 UTC (rev 292735)
@@ -1,3 +1,12 @@
+2022-04-11  Myles C. Maxfield  
+
+Sort PAL.xcodeproj.
+https://bugs.webkit.org/show_bug.cgi?id=239050
+
+Reviewed by Kimmo Kinnunen.
+
+* PAL.xcodeproj/project.pbxproj:
+
 2022-04-10  Chris Dumez  
 
 Unreviewed Windows build fix after r292696.


Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (292734 => 292735)

--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2022-04-11 23:21:34 UTC (rev 292734)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2022-04-11 23:28:14 UTC (rev 292735)
@@ -1627,61 +1627,205 @@
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-DD20DD1227BC90D60093D175 /* MediaTimeAVFoundation.h in Headers */,
-DD20DD1327BC90D60093D175 /* OutputContext.h in Headers */,
-DD20DD1427BC90D60093D175 /* OutputDevice.h in Headers */,
+DD20DDD527BC90D70093D175 /* AccessibilitySupportSoftLink.h in Headers */,
+DD20DDD627BC90D70093D175 /* AccessibilitySupportSPI.h in Headers */,
+DD20DD1A27BC90D60093D175 /* AppSSOSoftLink.h in Headers */,
+DD20DDD727BC90D70093D175 /* AppSSOSPI.h in Headers */,
 DD20DD1527BC90D60093D175 /* AudioToolboxSoftLink.h in Headers */,
+DD20DDD827BC90D70093D175 /* AudioToolboxSPI.h in Headers */,
+DD20DDD927BC90D70093D175 /* AuthKitSPI.h in Headers */,
+DD20DDDA27BC90D70093D175 /* AVAssetWriterSPI.h in Headers */,
+DD20DD1B27BC90D60093D175 /* AVFoundationSoftLink.h in Headers */,
+DD20DDDB27BC90D70093D175 /* AVFoundationSPI.h in Headers */,
+DD20DDDC27BC90D70093D175 /* AVKitSPI.h in Headers */,
+DD2027BC90D70093D175 /* AVStreamDataParserSPI.h in Headers */,
+DD20DDDE27BC90D70093D175 /* AXSpeechManagerSPI.h in Headers */,
+DD20DE0F27BC90D80093D175 /* CelestialSPI.h in Headers */,
+DD20DDC927BC90D70093D175 /* CFLocaleSPI.h in Headers */,
+DD20DDCA27BC90D70093D175 /* CFNetworkConnectionCacheSPI.h in Headers */,
+DD20DDCB27BC90D70093D175 /* CFNetworkSPI.h in Headers */,
+DD20DDCC27BC90D70093D175 /* CFNotificationCenterSPI.h in Headers */,
+DD20DDDF27BC90D70093D175 /* CFNSURLConnectionSPI.h in Headers */,
+DD20DDCD27BC90D70093D175 /* CFUtilitiesSPI.h in Headers */,
+DD20DE4827BC90D80093D175 /* Clock.h in Headers */,
+DD20DE4927BC90D80093D175 /* ClockGeneric.h in Headers */,
+DD20DDE027BC90D70093D175 /* CommonCryptoSPI.h in Headers */,
+DD20DE6527BC90F90093D175 /* config.h in Headers */,
+DD20DDCE27BC90D70093D175 /* CoreAudioSPI.h in Headers */,
+DD20DDD327BC90D70093D175 /* CoreGraphicsSPI.h in Headers */,
 DD20DD1627BC90D60093D175 /* CoreMediaSoftLink.h in Headers */,
+DD20DDCF27BC90D70093D175 /* CoreMediaSPI.h in Headers */,
+DD20DD1C27BC90D60093D175 /* CoreMLSoftLink.h in Headers */,
+DD20DDE127BC90D70093D175 /* CoreMotionSPI.h in Headers */,
+DD20DDE227BC90D70093D175 /* CoreServicesSPI.h in Headers */,
 DD20DD1727BC90D60093D175 /* CoreTextSoftLink.h in Headers */,
-DD20DD1827BC90D60093D175 /* OTSVGTable.h in Headers */,
-DD20DD1927BC90D60093D175 /* VideoToolboxSoftLink.h in Headers */,
-DD20DD1A27BC90D60093D175 /* AppSSOSoftLink.h in Headers */,
-DD20DD1B27BC90D60093D175 /* AVFoundationSoftLink.h in Headers */,
-DD20DD1C27BC90D60093D175 /* CoreMLSoftLink.h in Headers */,
+DD20DDD027BC90D70093D175 /* CoreTextSPI.h in Headers */,
+DD20DE1027BC90D80093D175 /* CoreUISPI.h in Headers */,
+DD20DE1C27BC90D80093D175 /* CoreUISPI.h in Headers */,
+DD20DDD127BC90D70093D175 /* CoreVideoSPI.h in Headers */,
+DD20DD2727BC90D60093D175 /* CryptoDigest.h in Headers */,
 DD20DD1D27BC90D60093D175 /* CryptoKitPrivateSoftLink.h in Headers */,
+DD20DDE327BC90D70093D175 /* CryptoKitPrivateSPI.h in Headers */,
 DD20DD1E27BC90D60093D175 /* DataDetectorsCoreSoftLink.h in Headers */,
+DD20DDE427BC90D70093D175 /* DataDetectorsCoreSPI.h in Headers */,
+DD20DDC527BC90D70093D175 /* DataDetectorsSoftLink.h in Headers */,
+DD20DE1D27BC90D80093D175 /* DataDetectorsSPI.h in Headers */,
+DD20DE1127BC90D80093D175 /* DataDetectorsUISPI.h in Headers */,
+DD20DE4D27BC90D80093D175 /* DecodeEscapeSequences.h in Headers */,
+DD20DE4427BC90D80093D175 /* DefaultSearchProvider.h in Headers */,
+DD20DE4E27BC90D80093D175 /* EncodingTables.h in Headers */,
+DD20DE5E27BC90D80

[webkit-changes] [292728] trunk/Source/WebGPU

2022-04-11 Thread mmaxfield
Title: [292728] trunk/Source/WebGPU








Revision 292728
Author mmaxfi...@apple.com
Date 2022-04-11 15:03:54 -0700 (Mon, 11 Apr 2022)


Log Message
[WebGPU] Implement missing validity checks
https://bugs.webkit.org/show_bug.cgi?id=238722

Reviewed by Kimmo Kinnunen.

Now that WebGPU objects have a notion of validity, we can implement all the
FIXMEs for validity checks.

* WebGPU/Buffer.mm:
(WebGPU::validateCreateBuffer):
(WebGPU::Buffer::validateMapAsync const):
* WebGPU/CommandEncoder.h:
(WebGPU::CommandEncoder::makeInvalid):
* WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::validateCopyBufferToBuffer):
(WebGPU::validateImageCopyBuffer):
(WebGPU::CommandEncoder::validateClearBuffer):
(WebGPU::CommandEncoder::validateFinish const):
(WebGPU::CommandEncoder::finish):
(WebGPU::CommandEncoder::popDebugGroup):
(WebGPU::validateCopyBufferToBuffer): Deleted.
(WebGPU::validateClearBuffer): Deleted.
* WebGPU/ComputePassEncoder.h:
(WebGPU::ComputePassEncoder::makeInvalid):
* WebGPU/ComputePassEncoder.mm:
(WebGPU::ComputePassEncoder::popDebugGroup):
* WebGPU/ObjectBase.h:
(WebGPU::ObjectBase::isValidToUseWith const):
(WebGPU::ObjectBase::device const):
* WebGPU/Queue.h:
(WebGPU::Queue::device const):
* WebGPU/Queue.mm:
(WebGPU::Queue::validateSubmit const):
(WebGPU::Queue::submit):
(WebGPU::Queue::validateWriteBuffer const):
* WebGPU/RenderBundleEncoder.h:
(WebGPU::RenderBundleEncoder::makeInvalid):
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::RenderBundleEncoder::popDebugGroup):
* WebGPU/RenderPassEncoder.h:
(WebGPU::RenderPassEncoder::makeInvalid):
* WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::popDebugGroup):
* WebGPU/Sampler.mm:
(WebGPU::validateCreateSampler):
* WebGPU/Texture.mm:
(WebGPU::Device::validateCreateTexture):
(WebGPU::Device::createTexture):
(WebGPU::Texture::validateCreateView const):
(WebGPU::Texture::createView):
(WebGPU::Texture::validateImageCopyTexture):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Buffer.mm
trunk/Source/WebGPU/WebGPU/CommandEncoder.h
trunk/Source/WebGPU/WebGPU/CommandEncoder.mm
trunk/Source/WebGPU/WebGPU/ComputePassEncoder.h
trunk/Source/WebGPU/WebGPU/ComputePassEncoder.mm
trunk/Source/WebGPU/WebGPU/Queue.h
trunk/Source/WebGPU/WebGPU/Queue.mm
trunk/Source/WebGPU/WebGPU/RenderBundleEncoder.h
trunk/Source/WebGPU/WebGPU/RenderBundleEncoder.mm
trunk/Source/WebGPU/WebGPU/RenderPassEncoder.h
trunk/Source/WebGPU/WebGPU/RenderPassEncoder.mm
trunk/Source/WebGPU/WebGPU/Sampler.mm
trunk/Source/WebGPU/WebGPU/Texture.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292727 => 292728)

--- trunk/Source/WebGPU/ChangeLog	2022-04-11 21:59:00 UTC (rev 292727)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-11 22:03:54 UTC (rev 292728)
@@ -1,3 +1,57 @@
+2022-04-11  Myles C. Maxfield  
+
+[WebGPU] Implement missing validity checks
+https://bugs.webkit.org/show_bug.cgi?id=238722
+
+Reviewed by Kimmo Kinnunen.
+
+Now that WebGPU objects have a notion of validity, we can implement all the
+FIXMEs for validity checks.
+
+* WebGPU/Buffer.mm:
+(WebGPU::validateCreateBuffer):
+(WebGPU::Buffer::validateMapAsync const):
+* WebGPU/CommandEncoder.h:
+(WebGPU::CommandEncoder::makeInvalid):
+* WebGPU/CommandEncoder.mm:
+(WebGPU::CommandEncoder::validateCopyBufferToBuffer):
+(WebGPU::validateImageCopyBuffer):
+(WebGPU::CommandEncoder::validateClearBuffer):
+(WebGPU::CommandEncoder::validateFinish const):
+(WebGPU::CommandEncoder::finish):
+(WebGPU::CommandEncoder::popDebugGroup):
+(WebGPU::validateCopyBufferToBuffer): Deleted.
+(WebGPU::validateClearBuffer): Deleted.
+* WebGPU/ComputePassEncoder.h:
+(WebGPU::ComputePassEncoder::makeInvalid):
+* WebGPU/ComputePassEncoder.mm:
+(WebGPU::ComputePassEncoder::popDebugGroup):
+* WebGPU/ObjectBase.h:
+(WebGPU::ObjectBase::isValidToUseWith const):
+(WebGPU::ObjectBase::device const):
+* WebGPU/Queue.h:
+(WebGPU::Queue::device const):
+* WebGPU/Queue.mm:
+(WebGPU::Queue::validateSubmit const):
+(WebGPU::Queue::submit):
+(WebGPU::Queue::validateWriteBuffer const):
+* WebGPU/RenderBundleEncoder.h:
+(WebGPU::RenderBundleEncoder::makeInvalid):
+* WebGPU/RenderBundleEncoder.mm:
+(WebGPU::RenderBundleEncoder::popDebugGroup):
+* WebGPU/RenderPassEncoder.h:
+(WebGPU::RenderPassEncoder::makeInvalid):
+* WebGPU/RenderPassEncoder.mm:
+(WebGPU::RenderPassEncoder::popDebugGroup):
+* WebGPU/Sampler.mm:
+(WebGPU::validateCreateSampler):
+* WebGPU/Texture.mm:
+(WebGPU::Device::validateCreateTexture):
+(WebGPU::Device::createTexture):
+(WebGPU::Texture::validateCreateView const):
+(WebGPU::Texture::createView):
+(WebGPU::Texture::validateImageCopyTexture):
+
 2022-04-0

[webkit-changes] [292681] trunk

2022-04-09 Thread mmaxfield
Title: [292681] trunk








Revision 292681
Author mmaxfi...@apple.com
Date 2022-04-09 13:26:16 -0700 (Sat, 09 Apr 2022)


Log Message
[WKTR] Reset minimum font size WKPreference between tests
https://bugs.webkit.org/show_bug.cgi?id=239027


Reviewed by Chris Dumez.

Tools:

Some tests use uiController to set the minimum font size WKPreference. We need to reset it between tests.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

Remove unnecessary ephemeral session.

* fast/forms/visual-hebrew-text-field.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/fast/forms/visual-hebrew-text-field.html
trunk/Tools/ChangeLog
trunk/Tools/WebKitTestRunner/TestController.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (292680 => 292681)

--- trunk/LayoutTests/ChangeLog	2022-04-09 19:05:27 UTC (rev 292680)
+++ trunk/LayoutTests/ChangeLog	2022-04-09 20:26:16 UTC (rev 292681)
@@ -1,3 +1,15 @@
+2022-04-09  Myles C. Maxfield  
+
+[WKTR] Reset minimum font size WKPreference between tests
+https://bugs.webkit.org/show_bug.cgi?id=239027
+
+
+Reviewed by Chris Dumez.
+
+Remove unnecessary ephemeral session.
+
+* fast/forms/visual-hebrew-text-field.html:
+
 2022-04-09  Alan Bujtas  
 
 REGRESSION (Safari 15.4): Focused element doesn't render outline when it has an underline


Modified: trunk/LayoutTests/fast/forms/visual-hebrew-text-field.html (292680 => 292681)

--- trunk/LayoutTests/fast/forms/visual-hebrew-text-field.html	2022-04-09 19:05:27 UTC (rev 292680)
+++ trunk/LayoutTests/fast/forms/visual-hebrew-text-field.html	2022-04-09 20:26:16 UTC (rev 292681)
@@ -1,5 +1,4 @@
-
-
+
 
 
 -khtml-rtl-ordering


Modified: trunk/Tools/ChangeLog (292680 => 292681)

--- trunk/Tools/ChangeLog	2022-04-09 19:05:27 UTC (rev 292680)
+++ trunk/Tools/ChangeLog	2022-04-09 20:26:16 UTC (rev 292681)
@@ -1,3 +1,16 @@
+2022-04-09  Myles C. Maxfield  
+
+[WKTR] Reset minimum font size WKPreference between tests
+https://bugs.webkit.org/show_bug.cgi?id=239027
+
+
+Reviewed by Chris Dumez.
+
+Some tests use uiController to set the minimum font size WKPreference. We need to reset it between tests.
+
+* WebKitTestRunner/TestController.cpp:
+(WTR::TestController::resetPreferencesToConsistentValues):
+
 2022-04-09  Chris Dumez  
 
 The Youtube plugin replacement should only work for actual Youtube URLs


Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (292680 => 292681)

--- trunk/Tools/WebKitTestRunner/TestController.cpp	2022-04-09 19:05:27 UTC (rev 292680)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2022-04-09 20:26:16 UTC (rev 292681)
@@ -977,6 +977,7 @@
 
 WKPreferencesSetProcessSwapOnNavigationEnabled(preferences, options.shouldEnableProcessSwapOnNavigation());
 WKPreferencesSetStorageBlockingPolicy(preferences, kWKAllowAllStorage); // FIXME: We should be testing the default.
+WKPreferencesSetMinimumFontSize(preferences, 0);
 
 for (const auto& [key, value] : options.boolWebPreferenceFeatures())
 WKPreferencesSetBoolValueForKeyForTesting(preferences, value, toWK(key).get());






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292674] trunk/Source/WebGPU

2022-04-08 Thread mmaxfield
Title: [292674] trunk/Source/WebGPU








Revision 292674
Author mmaxfi...@apple.com
Date 2022-04-08 20:12:19 -0700 (Fri, 08 Apr 2022)


Log Message
[WebGPU] Fix the release build
https://bugs.webkit.org/show_bug.cgi?id=239023

Unreviewed build fix.

* WebGPU/Device.mm:
(WebGPU::Device::Device):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Device.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292673 => 292674)

--- trunk/Source/WebGPU/ChangeLog	2022-04-09 02:56:18 UTC (rev 292673)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-09 03:12:19 UTC (rev 292674)
@@ -1,5 +1,15 @@
 2022-04-08  Myles C. Maxfield  
 
+[WebGPU] Fix the release build
+https://bugs.webkit.org/show_bug.cgi?id=239023
+
+Unreviewed build fix.
+
+* WebGPU/Device.mm:
+(WebGPU::Device::Device):
+
+2022-04-08  Myles C. Maxfield  
+
 [WebGPU] Make callbacks in unimplemented functions execute
 https://bugs.webkit.org/show_bug.cgi?id=238727
 


Modified: trunk/Source/WebGPU/WebGPU/Device.mm (292673 => 292674)

--- trunk/Source/WebGPU/WebGPU/Device.mm	2022-04-09 02:56:18 UTC (rev 292673)
+++ trunk/Source/WebGPU/WebGPU/Device.mm	2022-04-09 03:12:19 UTC (rev 292674)
@@ -88,6 +88,8 @@
 }
 }
 ASSERT(found);
+#else
+UNUSED_VARIABLE(devices);
 #endif
 #endif
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292673] trunk/Source/WebGPU

2022-04-08 Thread mmaxfield
Title: [292673] trunk/Source/WebGPU








Revision 292673
Author mmaxfi...@apple.com
Date 2022-04-08 19:56:18 -0700 (Fri, 08 Apr 2022)


Log Message
[WebGPU] Make callbacks in unimplemented functions execute
https://bugs.webkit.org/show_bug.cgi?id=238727

Reviewed by Dean Jackson.

CompletionHandler ASSERT()s that it has been executed in its destructor. We have some
functions which we haven't implemented yet which take CompletionHandlers, so let's
temporarily just call the completion handlers just to make tests stop ASSERT()ing.

* WebGPU/ComputePipeline.mm:
(WebGPU::Device::createComputePipelineAsync):
* WebGPU/RenderPipeline.mm:
(WebGPU::Device::createRenderPipelineAsync):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/ComputePipeline.mm
trunk/Source/WebGPU/WebGPU/RenderPipeline.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292672 => 292673)

--- trunk/Source/WebGPU/ChangeLog	2022-04-09 02:28:13 UTC (rev 292672)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-09 02:56:18 UTC (rev 292673)
@@ -1,5 +1,21 @@
 2022-04-08  Myles C. Maxfield  
 
+[WebGPU] Make callbacks in unimplemented functions execute
+https://bugs.webkit.org/show_bug.cgi?id=238727
+
+Reviewed by Dean Jackson.
+
+CompletionHandler ASSERT()s that it has been executed in its destructor. We have some
+functions which we haven't implemented yet which take CompletionHandlers, so let's
+temporarily just call the completion handlers just to make tests stop ASSERT()ing.
+
+* WebGPU/ComputePipeline.mm:
+(WebGPU::Device::createComputePipelineAsync):
+* WebGPU/RenderPipeline.mm:
+(WebGPU::Device::createRenderPipelineAsync):
+
+2022-04-08  Myles C. Maxfield  
+
 [WebGPU] Implement the concept of device lost
 https://bugs.webkit.org/show_bug.cgi?id=238725
 


Modified: trunk/Source/WebGPU/WebGPU/ComputePipeline.mm (292672 => 292673)

--- trunk/Source/WebGPU/WebGPU/ComputePipeline.mm	2022-04-09 02:28:13 UTC (rev 292672)
+++ trunk/Source/WebGPU/WebGPU/ComputePipeline.mm	2022-04-09 02:56:18 UTC (rev 292673)
@@ -172,7 +172,7 @@
 {
 // FIXME: Implement this
 UNUSED_PARAM(descriptor);
-UNUSED_PARAM(callback);
+callback(WGPUCreatePipelineAsyncStatus_Error, ComputePipeline::createInvalid(*this), { });
 }
 
 ComputePipeline::ComputePipeline(id computePipelineState, Device& device)


Modified: trunk/Source/WebGPU/WebGPU/RenderPipeline.mm (292672 => 292673)

--- trunk/Source/WebGPU/WebGPU/RenderPipeline.mm	2022-04-09 02:28:13 UTC (rev 292672)
+++ trunk/Source/WebGPU/WebGPU/RenderPipeline.mm	2022-04-09 02:56:18 UTC (rev 292673)
@@ -40,8 +40,9 @@
 
 void Device::createRenderPipelineAsync(const WGPURenderPipelineDescriptor& descriptor, CompletionHandler&&, String&& message)>&& callback)
 {
+// FIXME: Implement this.
 UNUSED_PARAM(descriptor);
-UNUSED_PARAM(callback);
+callback(WGPUCreatePipelineAsyncStatus_Error, RenderPipeline::createInvalid(*this), { });
 }
 
 RenderPipeline::RenderPipeline(id renderPipelineState, Device& device)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292671] trunk/Source/WebGPU

2022-04-08 Thread mmaxfield
Title: [292671] trunk/Source/WebGPU








Revision 292671
Author mmaxfi...@apple.com
Date 2022-04-08 19:14:23 -0700 (Fri, 08 Apr 2022)


Log Message
[WebGPU] Implement the concept of device lost
https://bugs.webkit.org/show_bug.cgi?id=238725

Reviewed by Dean Jackson.

This patch builds on https://bugs.webkit.org/show_bug.cgi?id=238723 to finish
the implementation of the concept of device lost. The device can only be lost
on macOS, where you can register a block callback to be run when it happens.
Also, the registration function returns a token that you can pass to the
unregistration function, which happens in Device's destructor.

* WebGPU/Buffer.mm:
(WebGPU::validateDescriptor):
* WebGPU/Device.h:
(WebGPU::Device::isLost const):
* WebGPU/Device.mm:
(WebGPU::Device::Device):
(WebGPU::Device::~Device):
(WebGPU::Device::loseTheDevice):
(WebGPU::Device::destroy):
(WebGPU::Device::validatePopErrorScope const):
(WebGPU::Device::setDeviceLostCallback):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Buffer.mm
trunk/Source/WebGPU/WebGPU/Device.h
trunk/Source/WebGPU/WebGPU/Device.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292670 => 292671)

--- trunk/Source/WebGPU/ChangeLog	2022-04-09 01:45:07 UTC (rev 292670)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-09 02:14:23 UTC (rev 292671)
@@ -1,5 +1,30 @@
 2022-04-08  Myles C. Maxfield  
 
+[WebGPU] Implement the concept of device lost
+https://bugs.webkit.org/show_bug.cgi?id=238725
+
+Reviewed by Dean Jackson.
+
+This patch builds on https://bugs.webkit.org/show_bug.cgi?id=238723 to finish
+the implementation of the concept of device lost. The device can only be lost
+on macOS, where you can register a block callback to be run when it happens.
+Also, the registration function returns a token that you can pass to the
+unregistration function, which happens in Device's destructor.
+
+* WebGPU/Buffer.mm:
+(WebGPU::validateDescriptor):
+* WebGPU/Device.h:
+(WebGPU::Device::isLost const):
+* WebGPU/Device.mm:
+(WebGPU::Device::Device):
+(WebGPU::Device::~Device):
+(WebGPU::Device::loseTheDevice):
+(WebGPU::Device::destroy):
+(WebGPU::Device::validatePopErrorScope const):
+(WebGPU::Device::setDeviceLostCallback):
+
+2022-04-08  Myles C. Maxfield  
+
 [WebGPU] Represent failure by invalidity rather than nullptr
 https://bugs.webkit.org/show_bug.cgi?id=238724
 


Modified: trunk/Source/WebGPU/WebGPU/Buffer.mm (292670 => 292671)

--- trunk/Source/WebGPU/WebGPU/Buffer.mm	2022-04-09 01:45:07 UTC (rev 292670)
+++ trunk/Source/WebGPU/WebGPU/Buffer.mm	2022-04-09 02:14:23 UTC (rev 292671)
@@ -38,7 +38,8 @@
 
 // https://gpuweb.github.io/gpuweb/#abstract-opdef-validating-gpubufferdescriptor
 
-// FIXME: "If device is lost return false."
+if (device.isLost())
+return false;
 
 // FIXME: "If any of the bits of descriptor’s usage aren’t present in this device’s [[allowed buffer usages]] return false."
 


Modified: trunk/Source/WebGPU/WebGPU/Device.h (292670 => 292671)

--- trunk/Source/WebGPU/WebGPU/Device.h	2022-04-09 01:45:07 UTC (rev 292670)
+++ trunk/Source/WebGPU/WebGPU/Device.h	2022-04-09 02:14:23 UTC (rev 292671)
@@ -33,6 +33,7 @@
 #import 
 #import 
 #import 
+#import 
 #import 
 
 struct WGPUDeviceImpl {
@@ -57,7 +58,7 @@
 class Texture;
 
 // https://gpuweb.github.io/gpuweb/#gpudevice
-class Device : public WGPUDeviceImpl, public ThreadSafeRefCounted {
+class Device : public WGPUDeviceImpl, public ThreadSafeRefCounted, public CanMakeWeakPtr {
 WTF_MAKE_FAST_ALLOCATED;
 public:
 static Ref create(id, String&& deviceLabel, Adapter&);
@@ -95,6 +96,7 @@
 void setLabel(String&&);
 
 bool isValid() const { return m_device; }
+bool isLost() const { return m_isLost; }
 
 id device() const { return m_device; }
 
@@ -115,7 +117,7 @@
 
 void makeInvalid() { m_device = nil; }
 
-void loseTheDevice();
+void loseTheDevice(WGPUDeviceLostReason);
 
 struct Error {
 WGPUErrorType type;
@@ -128,10 +130,15 @@
 
 id m_device { nil };
 const Ref m_defaultQueue;
-const Ref m_adapter;
 
 Function m_uncapturedErrorCallback;
 Vector m_errorScopeStack;
+
+Function m_deviceLostCallback;
+bool m_isLost { false };
+id m_deviceObserver { nil };
+
+const Ref m_adapter;
 };
 
 } // namespace WebGPU


Modified: trunk/Source/WebGPU/WebGPU/Device.mm (292670 => 292671)

--- trunk/Source/WebGPU/WebGPU/Device.mm	2022-04-09 01:45:07 UTC (rev 292670)
+++ trunk/Source/WebGPU/WebGPU/Device.mm	2022-04-09 02:14:23 UTC (rev 292671)
@@ -43,6 +43,7 @@
 #import "SwapChain.h"
 #import "Texture.h"
 #import 
+#import 
 
 namespace WebGPU {
 
@@ -66,6 +67,29 @@
 , m_defaultQueue(Queue::create(defaultQueue, *this))
 , m_adapter(adapter)
 {
+#if PLATFORM(MAC)
+auto devices = MTLCopyAllDevicesWithObserver(&m_dev

[webkit-changes] [292670] trunk/Source/WebGPU

2022-04-08 Thread mmaxfield
Title: [292670] trunk/Source/WebGPU








Revision 292670
Author mmaxfi...@apple.com
Date 2022-04-08 18:45:07 -0700 (Fri, 08 Apr 2022)


Log Message
[WebGPU] Represent failure by invalidity rather than nullptr
https://bugs.webkit.org/show_bug.cgi?id=238724

Reviewed by Dean Jackson.

This is the biggest blocker for running the WebGPU conformance test suite. WebGPU is designed
such that creation routines don't return undefined if the object couldn't be created; instead,
in "invalid" object is returned. Now that objects have the notion of invalidity, this patch
migrates from creation functions returning RefPtr to creation functions returning Ref. All
the places where we previously returned nullptr now return invalid objects.

* WebGPU/APIConversions.h:
(WebGPU::releaseToAPI):
* WebGPU/Adapter.h:
* WebGPU/Adapter.mm:
(WebGPU::Adapter::requestDevice):
(wgpuAdapterRequestDevice):
(wgpuAdapterRequestDeviceWithBlock):
* WebGPU/BindGroup.mm:
(WebGPU::Device::createBindGroup):
* WebGPU/BindGroupLayout.mm:
(WebGPU::Device::createBindGroupLayout):
* WebGPU/Buffer.mm:
(WebGPU::Device::createBuffer):
* WebGPU/CommandEncoder.h:
* WebGPU/CommandEncoder.mm:
(WebGPU::Device::createCommandEncoder):
(WebGPU::CommandEncoder::beginComputePass):
(WebGPU::CommandEncoder::beginRenderPass):
(WebGPU::CommandEncoder::finish):
* WebGPU/ComputePipeline.mm:
(WebGPU::Device::createComputePipeline):
(WebGPU::Device::createComputePipelineAsync):
* WebGPU/Device.h:
* WebGPU/Device.mm:
(WebGPU::Device::create):
(wgpuDeviceCreateComputePipelineAsync):
(wgpuDeviceCreateComputePipelineAsyncWithBlock):
(wgpuDeviceCreateRenderPipelineAsync):
(wgpuDeviceCreateRenderPipelineAsyncWithBlock):
* WebGPU/Instance.h:
* WebGPU/Instance.mm:
(WebGPU::Instance::create):
(WebGPU::Instance::createSurface):
(WebGPU::Instance::requestAdapter):
(wgpuInstanceRequestAdapter):
(wgpuInstanceRequestAdapterWithBlock):
* WebGPU/PipelineLayout.mm:
(WebGPU::Device::createPipelineLayout):
* WebGPU/QuerySet.mm:
(WebGPU::Device::createQuerySet):
* WebGPU/RenderBundleEncoder.h:
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::Device::createRenderBundleEncoder):
(WebGPU::RenderBundleEncoder::finish):
* WebGPU/RenderPipeline.mm:
(WebGPU::Device::createRenderPipeline):
(WebGPU::Device::createRenderPipelineAsync):
* WebGPU/Sampler.mm:
(WebGPU::Device::createSampler):
* WebGPU/ShaderModule.mm:
(WebGPU::Device::createShaderModule):
* WebGPU/SwapChain.mm:
(WebGPU::Device::createSwapChain):
* WebGPU/Texture.h:
* WebGPU/Texture.mm:
(WebGPU::Device::createTexture):
(WebGPU::Texture::createView):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/APIConversions.h
trunk/Source/WebGPU/WebGPU/Adapter.h
trunk/Source/WebGPU/WebGPU/Adapter.mm
trunk/Source/WebGPU/WebGPU/BindGroup.mm
trunk/Source/WebGPU/WebGPU/BindGroupLayout.mm
trunk/Source/WebGPU/WebGPU/Buffer.mm
trunk/Source/WebGPU/WebGPU/CommandEncoder.h
trunk/Source/WebGPU/WebGPU/CommandEncoder.mm
trunk/Source/WebGPU/WebGPU/ComputePipeline.mm
trunk/Source/WebGPU/WebGPU/Device.h
trunk/Source/WebGPU/WebGPU/Device.mm
trunk/Source/WebGPU/WebGPU/Instance.h
trunk/Source/WebGPU/WebGPU/Instance.mm
trunk/Source/WebGPU/WebGPU/PipelineLayout.mm
trunk/Source/WebGPU/WebGPU/QuerySet.mm
trunk/Source/WebGPU/WebGPU/RenderBundleEncoder.h
trunk/Source/WebGPU/WebGPU/RenderBundleEncoder.mm
trunk/Source/WebGPU/WebGPU/RenderPipeline.mm
trunk/Source/WebGPU/WebGPU/Sampler.mm
trunk/Source/WebGPU/WebGPU/ShaderModule.mm
trunk/Source/WebGPU/WebGPU/SwapChain.mm
trunk/Source/WebGPU/WebGPU/Texture.h
trunk/Source/WebGPU/WebGPU/Texture.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292669 => 292670)

--- trunk/Source/WebGPU/ChangeLog	2022-04-09 00:31:14 UTC (rev 292669)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-09 01:45:07 UTC (rev 292670)
@@ -1,3 +1,74 @@
+2022-04-08  Myles C. Maxfield  
+
+[WebGPU] Represent failure by invalidity rather than nullptr
+https://bugs.webkit.org/show_bug.cgi?id=238724
+
+Reviewed by Dean Jackson.
+
+This is the biggest blocker for running the WebGPU conformance test suite. WebGPU is designed
+such that creation routines don't return undefined if the object couldn't be created; instead,
+in "invalid" object is returned. Now that objects have the notion of invalidity, this patch
+migrates from creation functions returning RefPtr to creation functions returning Ref. All
+the places where we previously returned nullptr now return invalid objects.
+
+* WebGPU/APIConversions.h:
+(WebGPU::releaseToAPI):
+* WebGPU/Adapter.h:
+* WebGPU/Adapter.mm:
+(WebGPU::Adapter::requestDevice):
+(wgpuAdapterRequestDevice):
+(wgpuAdapterRequestDeviceWithBlock):
+* WebGPU/BindGroup.mm:
+(WebGPU::Device::createBindGroup):
+* WebGPU/BindGroupLayout.mm:
+(WebGPU::Device::createBindGroupLayout):
+* WebGPU/Buffer.mm:
+(WebGPU::Device::createBuffer):
+* WebGPU/CommandEncode

[webkit-changes] [292637] trunk/Source/WebGPU

2022-04-08 Thread mmaxfield
Title: [292637] trunk/Source/WebGPU








Revision 292637
Author mmaxfi...@apple.com
Date 2022-04-08 15:00:22 -0700 (Fri, 08 Apr 2022)


Log Message
[WebGPU] Implement destroy() methods
https://bugs.webkit.org/show_bug.cgi?id=238723

Reviewed by Dean Jackson.

The destroy() methods cause objects to become invalid. This is important because
the test suite creates and destroys lots of objects, and we want to make sure we
free up resources before GC runs.

This patch also makes Device own a Ref instead of Ref because
part of the implementation of Device::destroy() involves interacting with its
adapter.

* WebGPU/Adapter.h:
(WebGPU::Adapter::makeInvalid):
(WebGPU::Adapter::instance const):
* WebGPU/Adapter.mm:
(WebGPU::Adapter::requestDevice):
* WebGPU/Buffer.h:
* WebGPU/Device.h:
(WebGPU::Device::createInvalid):
(WebGPU::Device::instance const):
(WebGPU::Device::makeInvalid):
* WebGPU/Device.mm:
(WebGPU::Device::create):
(WebGPU::Device::Device):
(WebGPU::Device::loseTheDevice):
(WebGPU::Device::destroy):
(WebGPU::Device::generateAValidationError):
(WebGPU::Device::popErrorScope):
* WebGPU/QuerySet.h:
* WebGPU/QuerySet.mm:
(WebGPU::QuerySet::destroy):
* WebGPU/Queue.h:
(WebGPU::Queue::makeInvalid):
* WebGPU/Texture.h:
* WebGPU/Texture.mm:
(WebGPU::Texture::destroy):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Adapter.h
trunk/Source/WebGPU/WebGPU/Adapter.mm
trunk/Source/WebGPU/WebGPU/Buffer.h
trunk/Source/WebGPU/WebGPU/Device.h
trunk/Source/WebGPU/WebGPU/Device.mm
trunk/Source/WebGPU/WebGPU/QuerySet.h
trunk/Source/WebGPU/WebGPU/QuerySet.mm
trunk/Source/WebGPU/WebGPU/Queue.h
trunk/Source/WebGPU/WebGPU/Texture.h
trunk/Source/WebGPU/WebGPU/Texture.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292636 => 292637)

--- trunk/Source/WebGPU/ChangeLog	2022-04-08 21:39:57 UTC (rev 292636)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-08 22:00:22 UTC (rev 292637)
@@ -1,3 +1,44 @@
+2022-04-08  Myles C. Maxfield  
+
+[WebGPU] Implement destroy() methods
+https://bugs.webkit.org/show_bug.cgi?id=238723
+
+Reviewed by Dean Jackson.
+
+The destroy() methods cause objects to become invalid. This is important because
+the test suite creates and destroys lots of objects, and we want to make sure we
+free up resources before GC runs.
+
+This patch also makes Device own a Ref instead of Ref because
+part of the implementation of Device::destroy() involves interacting with its
+adapter.
+
+* WebGPU/Adapter.h:
+(WebGPU::Adapter::makeInvalid):
+(WebGPU::Adapter::instance const):
+* WebGPU/Adapter.mm:
+(WebGPU::Adapter::requestDevice):
+* WebGPU/Buffer.h:
+* WebGPU/Device.h:
+(WebGPU::Device::createInvalid):
+(WebGPU::Device::instance const):
+(WebGPU::Device::makeInvalid):
+* WebGPU/Device.mm:
+(WebGPU::Device::create):
+(WebGPU::Device::Device):
+(WebGPU::Device::loseTheDevice):
+(WebGPU::Device::destroy):
+(WebGPU::Device::generateAValidationError):
+(WebGPU::Device::popErrorScope):
+* WebGPU/QuerySet.h:
+* WebGPU/QuerySet.mm:
+(WebGPU::QuerySet::destroy):
+* WebGPU/Queue.h:
+(WebGPU::Queue::makeInvalid):
+* WebGPU/Texture.h:
+* WebGPU/Texture.mm:
+(WebGPU::Texture::destroy):
+
 2022-04-08  Elliott Williams  
 
 Unreviewed, reverting r292591.


Modified: trunk/Source/WebGPU/WebGPU/Adapter.h (292636 => 292637)

--- trunk/Source/WebGPU/WebGPU/Adapter.h	2022-04-08 21:39:57 UTC (rev 292636)
+++ trunk/Source/WebGPU/WebGPU/Adapter.h	2022-04-08 22:00:22 UTC (rev 292637)
@@ -61,12 +61,16 @@
 void requestDevice(const WGPUDeviceDescriptor&, CompletionHandler&&, String&&)>&& callback);
 
 bool isValid() const { return m_device; }
+void makeInvalid() { m_device = nil; }
 
+Instance& instance() const { return m_instance; }
+
+
 private:
 Adapter(id, Instance&);
 Adapter(Instance&);
 
-const id m_device { nil };
+id m_device { nil };
 const Ref m_instance;
 };
 


Modified: trunk/Source/WebGPU/WebGPU/Adapter.mm (292636 => 292637)

--- trunk/Source/WebGPU/WebGPU/Adapter.mm	2022-04-08 21:39:57 UTC (rev 292636)
+++ trunk/Source/WebGPU/WebGPU/Adapter.mm	2022-04-08 22:00:22 UTC (rev 292637)
@@ -128,7 +128,7 @@
 return;
 }
 
-callback(WGPURequestDeviceStatus_Success, Device::create(m_device, String::fromLatin1(descriptor.label), m_instance), { });
+callback(WGPURequestDeviceStatus_Success, Device::create(m_device, String::fromLatin1(descriptor.label), *this), { });
 }
 
 } // namespace WebGPU


Modified: trunk/Source/WebGPU/WebGPU/Buffer.h (292636 => 292637)

--- trunk/Source/WebGPU/WebGPU/Buffer.h	2022-04-08 21:39:57 UTC (rev 292636)
+++ trunk/Source/WebGPU/WebGPU/Buffer.h	2022-04-08 22:00:22 UTC (rev 292637)
@@ -71,7 +71,6 @@
 bool isValid() const { return m_buffer; }
 
 // http

[webkit-changes] [292574] trunk/Source/WebGPU

2022-04-07 Thread mmaxfield
Title: [292574] trunk/Source/WebGPU








Revision 292574
Author mmaxfi...@apple.com
Date 2022-04-07 15:50:19 -0700 (Thu, 07 Apr 2022)


Log Message
[WebGPU] Add support for the "is valid to use with" operation to WebGPU objects
https://bugs.webkit.org/show_bug.cgi?id=238719

Addressing post-review comment.

Unreviewed.

* WebGPU/IsValidToUseWith.h:
(WebGPU::isValidToUseWith):
(WebGPU::isValidToUseWith const): Deleted.

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/IsValidToUseWith.h




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292573 => 292574)

--- trunk/Source/WebGPU/ChangeLog	2022-04-07 22:44:09 UTC (rev 292573)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-07 22:50:19 UTC (rev 292574)
@@ -1,5 +1,18 @@
 2022-04-07  Myles C. Maxfield  
 
+[WebGPU] Add support for the "is valid to use with" operation to WebGPU objects
+https://bugs.webkit.org/show_bug.cgi?id=238719
+
+Addressing post-review comment.
+
+Unreviewed.
+
+* WebGPU/IsValidToUseWith.h:
+(WebGPU::isValidToUseWith):
+(WebGPU::isValidToUseWith const): Deleted.
+
+2022-04-07  Myles C. Maxfield  
+
 [WebGPU] Give objects a notion of invalidity
 https://bugs.webkit.org/show_bug.cgi?id=238720
 


Modified: trunk/Source/WebGPU/WebGPU/IsValidToUseWith.h (292573 => 292574)

--- trunk/Source/WebGPU/WebGPU/IsValidToUseWith.h	2022-04-07 22:44:09 UTC (rev 292573)
+++ trunk/Source/WebGPU/WebGPU/IsValidToUseWith.h	2022-04-07 22:50:19 UTC (rev 292574)
@@ -28,7 +28,7 @@
 namespace WebGPU {
 
 template 
-bool isValidToUseWith(const T& object, const U& targetObject) const
+bool isValidToUseWith(const T& object, const U& targetObject)
 {
 // https://gpuweb.github.io/gpuweb/#abstract-opdef-valid-to-use-with
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292567] trunk/Source/WebGPU

2022-04-07 Thread mmaxfield
Title: [292567] trunk/Source/WebGPU








Revision 292567
Author mmaxfi...@apple.com
Date 2022-04-07 14:44:00 -0700 (Thu, 07 Apr 2022)


Log Message
[WebGPU] Give objects a notion of invalidity
https://bugs.webkit.org/show_bug.cgi?id=238720

Reviewed by Kimmo Kinnunen.

This is the biggest blocker for running the WebGPU conformance test suite. WebGPU is designed
such that creation routines don't return undefined if the object couldn't be created; instead,
in "invalid" object is returned. This patch is a step on the path to making creation routines
never return nullptr.

Some objects have destroy() methods which makes the object invalid. Those will be implemented
in a forthcoming patch.

* WebGPU/Adapter.h:
(WebGPU::Adapter::createInvalid):
(WebGPU::Adapter::isValid const):
* WebGPU/Adapter.mm:
(WebGPU::Adapter::Adapter):
* WebGPU/BindGroup.h:
(WebGPU::BindGroup::createInvalid):
(WebGPU::BindGroup::isValid const):
* WebGPU/BindGroup.mm:
(WebGPU::BindGroup::BindGroup):
* WebGPU/BindGroupLayout.h:
(WebGPU::BindGroupLayout::createInvalid):
(WebGPU::BindGroupLayout::isValid const):
* WebGPU/BindGroupLayout.mm:
(WebGPU::BindGroupLayout::BindGroupLayout):
* WebGPU/Buffer.h:
(WebGPU::Buffer::createInvalid):
(WebGPU::Buffer::isValid const):
* WebGPU/Buffer.mm:
(WebGPU::Buffer::Buffer):
* WebGPU/CommandBuffer.h:
(WebGPU::CommandBuffer::createInvalid):
(WebGPU::CommandBuffer::isValid const):
* WebGPU/CommandBuffer.mm:
(WebGPU::CommandBuffer::CommandBuffer):
* WebGPU/CommandEncoder.h:
(WebGPU::CommandEncoder::createInvalid):
(WebGPU::CommandEncoder::isValid const):
* WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::CommandEncoder):
* WebGPU/ComputePassEncoder.h:
(WebGPU::ComputePassEncoder::createInvalid):
(WebGPU::ComputePassEncoder::isValid const):
* WebGPU/ComputePassEncoder.mm:
(WebGPU::ComputePassEncoder::ComputePassEncoder):
* WebGPU/ComputePipeline.h:
(WebGPU::ComputePipeline::createInvalid):
(WebGPU::ComputePipeline::isValid const):
* WebGPU/ComputePipeline.mm:
(WebGPU::ComputePipeline::ComputePipeline):
* WebGPU/Device.h:
(WebGPU::Device::createInvalid):
(WebGPU::Device::isValid const):
* WebGPU/Device.mm:
(WebGPU::Device::Device):
* WebGPU/Instance.h:
(WebGPU::Instance::createInvalid):
(WebGPU::Instance::isValid const):
* WebGPU/Instance.mm:
(WebGPU::Instance::Instance):
(WebGPU::m_isValid):
* WebGPU/PipelineLayout.h:
(WebGPU::PipelineLayout::createInvalid):
(WebGPU::PipelineLayout::isValid const):
* WebGPU/PipelineLayout.mm:
(WebGPU::PipelineLayout::PipelineLayout):
* WebGPU/QuerySet.h:
(WebGPU::QuerySet::createInvalid):
(WebGPU::QuerySet::isValid const):
* WebGPU/QuerySet.mm:
(WebGPU::QuerySet::QuerySet):
* WebGPU/Queue.h:
(WebGPU::Queue::createInvalid):
(WebGPU::Queue::isValid const):
* WebGPU/Queue.mm:
(WebGPU::Queue::Queue):
* WebGPU/RenderBundle.h:
(WebGPU::RenderBundle::createInvalid):
(WebGPU::RenderBundle::isValid const):
* WebGPU/RenderBundle.mm:
(WebGPU::RenderBundle::RenderBundle):
* WebGPU/RenderBundleEncoder.h:
(WebGPU::RenderBundleEncoder::createInvalid):
(WebGPU::RenderBundleEncoder::isValid const):
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::RenderBundleEncoder::RenderBundleEncoder):
* WebGPU/RenderPassEncoder.h:
(WebGPU::RenderPassEncoder::createInvalid):
(WebGPU::RenderPassEncoder::isValid const):
* WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::RenderPassEncoder):
* WebGPU/RenderPipeline.h:
(WebGPU::RenderPipeline::createInvalid):
(WebGPU::RenderPipeline::isValid const):
* WebGPU/RenderPipeline.mm:
(WebGPU::RenderPipeline::RenderPipeline):
* WebGPU/Sampler.h:
(WebGPU::Sampler::createInvalid):
(WebGPU::Sampler::isValid const):
* WebGPU/Sampler.mm:
(WebGPU::Sampler::Sampler):
* WebGPU/ShaderModule.h:
(WebGPU::ShaderModule::createInvalid):
(WebGPU::ShaderModule::isValid const):
* WebGPU/ShaderModule.mm:
(WebGPU::ShaderModule::convertCheckResult):
(WebGPU::ShaderModule::ShaderModule):
(WebGPU::ShaderModule::getCompilationInfo):
(WebGPU::ShaderModule::ast const):
* WebGPU/Texture.h:
(WebGPU::Texture::createInvalid):
(WebGPU::Texture::isValid const):
* WebGPU/Texture.mm:
(WebGPU::Texture::Texture):
* WebGPU/TextureView.h:
(WebGPU::TextureView::createInvalid):
(WebGPU::TextureView::isValid const):
* WebGPU/TextureView.mm:
(WebGPU::TextureView::TextureView):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Adapter.h
trunk/Source/WebGPU/WebGPU/Adapter.mm
trunk/Source/WebGPU/WebGPU/BindGroup.h
trunk/Source/WebGPU/WebGPU/BindGroup.mm
trunk/Source/WebGPU/WebGPU/BindGroupLayout.h
trunk/Source/WebGPU/WebGPU/BindGroupLayout.mm
trunk/Source/WebGPU/WebGPU/Buffer.h
trunk/Source/WebGPU/WebGPU/Buffer.mm
trunk/Source/WebGPU/WebGPU/CommandBuffer.h
trunk/Source/WebGPU/WebGPU/CommandBuffer.mm
trunk/Source/WebGPU/WebGPU/CommandEncoder.h
trunk/Source/WebGPU/WebGPU/CommandEncoder.mm
trunk/Source/WebGPU/WebGPU/ComputePassEncoder.h
trunk/Source/WebGPU/WebGPU/ComputePassEncoder.mm
trunk/Source/WebGPU/WebGPU/ComputePipeline.h
trunk/Source/WebGPU/WebGPU/ComputePipeline.mm
trunk/Sourc

[webkit-changes] [292558] trunk/Source/WebGPU

2022-04-07 Thread mmaxfield
Title: [292558] trunk/Source/WebGPU








Revision 292558
Author mmaxfi...@apple.com
Date 2022-04-07 13:22:58 -0700 (Thu, 07 Apr 2022)


Log Message
[WebGPU] Add support for the "is valid to use with" operation to WebGPU objects
https://bugs.webkit.org/show_bug.cgi?id=238719

Reviewed by Kimmo Kinnunen.

The spec also has the representation of this base class, named GPUObjectBase, which supports
the setting of labels. However, in our WebGPU implementation, all objects implement labels
differently, so that handling isn't present.

* WebGPU.xcodeproj/project.pbxproj:
* WebGPU/Adapter.h:
* WebGPU/BindGroup.h:
(WebGPU::BindGroup::create):
* WebGPU/BindGroup.mm:
(WebGPU::Device::createBindGroup):
(WebGPU::BindGroup::BindGroup):
* WebGPU/BindGroupLayout.h:
(WebGPU::BindGroupLayout::create):
* WebGPU/BindGroupLayout.mm:
(WebGPU::Device::createBindGroupLayout):
(WebGPU::BindGroupLayout::BindGroupLayout):
* WebGPU/Buffer.h:
* WebGPU/Buffer.mm:
(WebGPU::Buffer::Buffer):
* WebGPU/CommandBuffer.h:
(WebGPU::CommandBuffer::create):
* WebGPU/CommandBuffer.mm:
(WebGPU::CommandBuffer::CommandBuffer):
* WebGPU/CommandEncoder.h:
* WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::CommandEncoder):
(WebGPU::CommandEncoder::beginComputePass):
(WebGPU::CommandEncoder::beginRenderPass):
(WebGPU::CommandEncoder::finish):
* WebGPU/CommandsMixin.h:
* WebGPU/ComputePassEncoder.h:
(WebGPU::ComputePassEncoder::create):
* WebGPU/ComputePassEncoder.mm:
(WebGPU::ComputePassEncoder::ComputePassEncoder):
* WebGPU/ComputePipeline.h:
(WebGPU::ComputePipeline::create):
* WebGPU/ComputePipeline.mm:
(WebGPU::Device::createComputePipeline):
(WebGPU::ComputePipeline::ComputePipeline):
* WebGPU/Device.h:
* WebGPU/Instance.h:
* WebGPU/IsValidToUseWith.h: Copied from Source/WebGPU/WebGPU/CommandsMixin.h.
(WebGPU::ObjectBase::ObjectBase):
* WebGPU/PipelineLayout.h:
(WebGPU::PipelineLayout::create):
* WebGPU/PipelineLayout.mm:
(WebGPU::Device::createPipelineLayout):
(WebGPU::PipelineLayout::PipelineLayout):
* WebGPU/QuerySet.h:
(WebGPU::QuerySet::create):
* WebGPU/QuerySet.mm:
(WebGPU::Device::createQuerySet):
(WebGPU::QuerySet::QuerySet):
* WebGPU/Queue.h:
* WebGPU/RenderBundle.h:
(WebGPU::RenderBundle::create):
* WebGPU/RenderBundle.mm:
(WebGPU::RenderBundle::RenderBundle):
* WebGPU/RenderBundleEncoder.h:
(WebGPU::RenderBundleEncoder::create):
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::Device::createRenderBundleEncoder):
(WebGPU::RenderBundleEncoder::RenderBundleEncoder):
(WebGPU::RenderBundleEncoder::finish):
* WebGPU/RenderPassEncoder.h:
(WebGPU::RenderPassEncoder::create):
* WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::RenderPassEncoder):
* WebGPU/RenderPipeline.h:
(WebGPU::RenderPipeline::create):
* WebGPU/RenderPipeline.mm:
(WebGPU::Device::createRenderPipeline):
(WebGPU::RenderPipeline::RenderPipeline):
* WebGPU/Sampler.h:
* WebGPU/Sampler.mm:
(WebGPU::Sampler::Sampler):
* WebGPU/ShaderModule.h:
(WebGPU::ShaderModule::create):
* WebGPU/ShaderModule.mm:
(WebGPU::earlyCompileShaderModule):
(WebGPU::Device::createShaderModule):
(WebGPU::ShaderModule::ShaderModule):
* WebGPU/Texture.h:
* WebGPU/Texture.mm:
(WebGPU::Texture::Texture):
(WebGPU::Texture::createView):
* WebGPU/TextureView.h:
(WebGPU::TextureView::create):
* WebGPU/TextureView.mm:
(WebGPU::TextureView::TextureView):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Adapter.h
trunk/Source/WebGPU/WebGPU/BindGroup.h
trunk/Source/WebGPU/WebGPU/BindGroup.mm
trunk/Source/WebGPU/WebGPU/BindGroupLayout.h
trunk/Source/WebGPU/WebGPU/BindGroupLayout.mm
trunk/Source/WebGPU/WebGPU/Buffer.h
trunk/Source/WebGPU/WebGPU/CommandBuffer.h
trunk/Source/WebGPU/WebGPU/CommandBuffer.mm
trunk/Source/WebGPU/WebGPU/CommandEncoder.h
trunk/Source/WebGPU/WebGPU/CommandEncoder.mm
trunk/Source/WebGPU/WebGPU/CommandsMixin.h
trunk/Source/WebGPU/WebGPU/ComputePassEncoder.h
trunk/Source/WebGPU/WebGPU/ComputePassEncoder.mm
trunk/Source/WebGPU/WebGPU/ComputePipeline.h
trunk/Source/WebGPU/WebGPU/ComputePipeline.mm
trunk/Source/WebGPU/WebGPU/Device.h
trunk/Source/WebGPU/WebGPU/Instance.h
trunk/Source/WebGPU/WebGPU/PipelineLayout.h
trunk/Source/WebGPU/WebGPU/PipelineLayout.mm
trunk/Source/WebGPU/WebGPU/QuerySet.h
trunk/Source/WebGPU/WebGPU/QuerySet.mm
trunk/Source/WebGPU/WebGPU/Queue.h
trunk/Source/WebGPU/WebGPU/RenderBundle.h
trunk/Source/WebGPU/WebGPU/RenderBundle.mm
trunk/Source/WebGPU/WebGPU/RenderBundleEncoder.h
trunk/Source/WebGPU/WebGPU/RenderBundleEncoder.mm
trunk/Source/WebGPU/WebGPU/RenderPassEncoder.h
trunk/Source/WebGPU/WebGPU/RenderPassEncoder.mm
trunk/Source/WebGPU/WebGPU/RenderPipeline.h
trunk/Source/WebGPU/WebGPU/RenderPipeline.mm
trunk/Source/WebGPU/WebGPU/Sampler.h
trunk/Source/WebGPU/WebGPU/ShaderModule.h
trunk/Source/WebGPU/WebGPU/ShaderModule.mm
trunk/Source/WebGPU/WebGPU/Texture.h
trunk/Source/WebGPU/WebGPU/Texture.mm
trunk/Source/WebGPU/WebGPU/TextureView.h
trunk/Source/WebGPU/WebGPU/TextureView.mm
trunk/Source/WebGPU/WebGPU.xcodeproj/project.pbxproj


Added Paths

t

[webkit-changes] [292554] trunk/Source/WebGPU

2022-04-07 Thread mmaxfield
Title: [292554] trunk/Source/WebGPU








Revision 292554
Author mmaxfi...@apple.com
Date 2022-04-07 12:42:41 -0700 (Thu, 07 Apr 2022)


Log Message
[WebGPU] Delete redundant spec quotes
https://bugs.webkit.org/show_bug.cgi?id=238711

Reviewed by Kimmo Kinnunen.

I actually prefer to have lots and lots of spec quotes throughout the implementation,
but enough people have commented about it that it's become clear that we probably
shouldn't have them. This deletes almost all of them (and leaves just the ones that
are particularly insightful).

* WebGPU/Buffer.h:
* WebGPU/Buffer.mm:
(WebGPU::validateDescriptor):
(WebGPU::validateCreateBuffer):
(WebGPU::Device::createBuffer):
(WebGPU::Buffer::destroy):
(WebGPU::Buffer::validateGetMappedRange const):
(WebGPU::Buffer::getMappedRange):
(WebGPU::Buffer::validateMapAsync const):
(WebGPU::Buffer::mapAsync):
(WebGPU::Buffer::validateUnmap const):
(WebGPU::Buffer::unmap):
* WebGPU/CommandEncoder.mm:
(WebGPU::validateCopyBufferToBuffer):
(WebGPU::CommandEncoder::copyBufferToBuffer):
(WebGPU::validateImageCopyBuffer):
(WebGPU::validateCopyBufferToTexture):
(WebGPU::CommandEncoder::copyBufferToTexture):
(WebGPU::validateCopyTextureToBuffer):
(WebGPU::CommandEncoder::copyTextureToBuffer):
(WebGPU::areCopyCompatible):
(WebGPU::validateCopyTextureToTexture):
(WebGPU::CommandEncoder::copyTextureToTexture):
(WebGPU::validateClearBuffer):
(WebGPU::CommandEncoder::clearBuffer):
(WebGPU::CommandEncoder::validateFinish const):
(WebGPU::CommandEncoder::finish):
(WebGPU::CommandEncoder::insertDebugMarker):
(WebGPU::CommandEncoder::validatePopDebugGroup const):
(WebGPU::CommandEncoder::popDebugGroup):
(WebGPU::CommandEncoder::pushDebugGroup):
* WebGPU/ComputePassEncoder.mm:
(WebGPU::ComputePassEncoder::insertDebugMarker):
(WebGPU::ComputePassEncoder::validatePopDebugGroup const):
(WebGPU::ComputePassEncoder::popDebugGroup):
(WebGPU::ComputePassEncoder::pushDebugGroup):
* WebGPU/Device.h:
* WebGPU/Device.mm:
(WebGPU::Device::currentErrorScope):
(WebGPU::Device::generateAValidationError):
(WebGPU::Device::validatePopErrorScope const):
(WebGPU::Device::popErrorScope):
(WebGPU::Device::pushErrorScope):
* WebGPU/Queue.mm:
(WebGPU::Queue::submit):
(WebGPU::validateWriteBufferInitial):
(WebGPU::Queue::validateWriteBuffer const):
(WebGPU::Queue::writeBuffer):
(WebGPU::validateWriteTexture):
(WebGPU::Queue::writeTexture):
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::RenderBundleEncoder::insertDebugMarker):
(WebGPU::RenderBundleEncoder::validatePopDebugGroup const):
(WebGPU::RenderBundleEncoder::popDebugGroup):
(WebGPU::RenderBundleEncoder::pushDebugGroup):
* WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::insertDebugMarker):
(WebGPU::RenderPassEncoder::validatePopDebugGroup const):
(WebGPU::RenderPassEncoder::popDebugGroup):
(WebGPU::RenderPassEncoder::pushDebugGroup):
* WebGPU/Sampler.h:
(WebGPU::Sampler::descriptor const):
(WebGPU::Sampler::isComparison const):
* WebGPU/Sampler.mm:
(WebGPU::validateCreateSampler):
(WebGPU::Device::createSampler):
* WebGPU/Texture.h:
* WebGPU/Texture.mm:
(WebGPU::isCompressedFormat):
(WebGPU::Texture::isDepthOrStencilFormat):
(WebGPU::Texture::texelBlockWidth):
(WebGPU::Texture::texelBlockHeight):
(WebGPU::isRenderableFormat):
(WebGPU::supportsMultisampling):
(WebGPU::maximumMiplevelCount):
(WebGPU::Device::validateCreateTexture):
(WebGPU::Device::createTexture):
(WebGPU::Texture::resolveTextureViewDescriptorDefaults const):
(WebGPU::Texture::arrayLayerCount const):
(WebGPU::Texture::validateCreateView const):
(WebGPU::computeRenderExtent):
(WebGPU::Texture::createView):
(WebGPU::Texture::logicalMiplevelSpecificTextureExtent):
(WebGPU::Texture::physicalMiplevelSpecificTextureExtent):
(WebGPU::imageCopyTextureSubresourceSize):
(WebGPU::Texture::validateImageCopyTexture):
(WebGPU::Texture::validateTextureCopyRange):
(WebGPU::Texture::validateLinearTextureData):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Buffer.h
trunk/Source/WebGPU/WebGPU/Buffer.mm
trunk/Source/WebGPU/WebGPU/CommandEncoder.mm
trunk/Source/WebGPU/WebGPU/ComputePassEncoder.mm
trunk/Source/WebGPU/WebGPU/Device.h
trunk/Source/WebGPU/WebGPU/Device.mm
trunk/Source/WebGPU/WebGPU/Queue.mm
trunk/Source/WebGPU/WebGPU/RenderBundleEncoder.mm
trunk/Source/WebGPU/WebGPU/RenderPassEncoder.mm
trunk/Source/WebGPU/WebGPU/Sampler.h
trunk/Source/WebGPU/WebGPU/Sampler.mm
trunk/Source/WebGPU/WebGPU/Texture.h
trunk/Source/WebGPU/WebGPU/Texture.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292553 => 292554)

--- trunk/Source/WebGPU/ChangeLog	2022-04-07 19:40:12 UTC (rev 292553)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-07 19:42:41 UTC (rev 292554)
@@ -1,5 +1,106 @@
 2022-04-07  Myles C. Maxfield  
 
+[WebGPU] Delete redundant spec quotes
+https://bugs.webkit.org/show_bug.cgi?id=238711
+
+Reviewed by Kimmo Kinnunen.
+
+I actually prefer to have lots and lots of spec quotes throughout the implementation,
+but enough people have comme

[webkit-changes] [292552] trunk/Source/WebGPU

2022-04-07 Thread mmaxfield
Title: [292552] trunk/Source/WebGPU








Revision 292552
Author mmaxfi...@apple.com
Date 2022-04-07 12:19:54 -0700 (Thu, 07 Apr 2022)


Log Message
[WebGPU] Implement Texture view format compatibility
https://bugs.webkit.org/show_bug.cgi?id=238710

Reviewed by Kimmo Kinnunen.

Right now, the definition of texture view format compatibility is narrow enough that we'll
never need to add MTLTextureUsagePixelFormatView to the usage of any textures. So, all we
have to do is validate.

Test: http/tests/webgpu/webgpu/api/validation/createTexture.html

* WebGPU/CommandEncoder.mm:
(WebGPU::areCopyCompatible):
(WebGPU::isSRGBCompatible): Deleted.
* WebGPU/Device.h:
* WebGPU/Texture.h:
(WebGPU::Texture::create):
* WebGPU/Texture.mm:
(WebGPU::Texture::removeSRGBSuffix):
(WebGPU::textureViewFormatCompatible):
(WebGPU::Device::validateCreateTexture):
(WebGPU::usage):
(WebGPU::Device::createTexture):
(WebGPU::Texture::Texture):
(WebGPU::Texture::validateCreateView const):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/CommandEncoder.mm
trunk/Source/WebGPU/WebGPU/Device.h
trunk/Source/WebGPU/WebGPU/Texture.h
trunk/Source/WebGPU/WebGPU/Texture.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292551 => 292552)

--- trunk/Source/WebGPU/ChangeLog	2022-04-07 19:18:13 UTC (rev 292551)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-07 19:19:54 UTC (rev 292552)
@@ -1,3 +1,31 @@
+2022-04-07  Myles C. Maxfield  
+
+[WebGPU] Implement Texture view format compatibility
+https://bugs.webkit.org/show_bug.cgi?id=238710
+
+Reviewed by Kimmo Kinnunen.
+
+Right now, the definition of texture view format compatibility is narrow enough that we'll
+never need to add MTLTextureUsagePixelFormatView to the usage of any textures. So, all we
+have to do is validate.
+
+Test: http/tests/webgpu/webgpu/api/validation/createTexture.html
+
+* WebGPU/CommandEncoder.mm:
+(WebGPU::areCopyCompatible):
+(WebGPU::isSRGBCompatible): Deleted.
+* WebGPU/Device.h:
+* WebGPU/Texture.h:
+(WebGPU::Texture::create):
+* WebGPU/Texture.mm:
+(WebGPU::Texture::removeSRGBSuffix):
+(WebGPU::textureViewFormatCompatible):
+(WebGPU::Device::validateCreateTexture):
+(WebGPU::usage):
+(WebGPU::Device::createTexture):
+(WebGPU::Texture::Texture):
+(WebGPU::Texture::validateCreateView const):
+
 2022-04-06  Chris Dumez  
 
 Start replacing String(const char*) constructor with a String::fromLatin1(const char*) function


Modified: trunk/Source/WebGPU/WebGPU/CommandEncoder.mm (292551 => 292552)

--- trunk/Source/WebGPU/WebGPU/CommandEncoder.mm	2022-04-07 19:18:13 UTC (rev 292551)
+++ trunk/Source/WebGPU/WebGPU/CommandEncoder.mm	2022-04-07 19:19:54 UTC (rev 292552)
@@ -33,6 +33,7 @@
 #import "Device.h"
 #import "QuerySet.h"
 #import "RenderPassEncoder.h"
+#import "Texture.h"
 
 namespace WebGPU {
 
@@ -556,139 +557,6 @@
 }
 }
 
-static std::optional isSRGBCompatible(WGPUTextureFormat format)
-{
-switch (format) {
-case WGPUTextureFormat_R8Unorm:
-case WGPUTextureFormat_R8Snorm:
-case WGPUTextureFormat_R8Uint:
-case WGPUTextureFormat_R8Sint:
-case WGPUTextureFormat_R16Uint:
-case WGPUTextureFormat_R16Sint:
-case WGPUTextureFormat_R16Float:
-case WGPUTextureFormat_RG8Unorm:
-case WGPUTextureFormat_RG8Snorm:
-case WGPUTextureFormat_RG8Uint:
-case WGPUTextureFormat_RG8Sint:
-case WGPUTextureFormat_R32Float:
-case WGPUTextureFormat_R32Uint:
-case WGPUTextureFormat_R32Sint:
-case WGPUTextureFormat_RG16Uint:
-case WGPUTextureFormat_RG16Sint:
-case WGPUTextureFormat_RG16Float:
-return std::nullopt;
-case WGPUTextureFormat_RGBA8Unorm:
-case WGPUTextureFormat_RGBA8UnormSrgb:
-return WGPUTextureFormat_RGBA8Unorm;
-case WGPUTextureFormat_RGBA8Snorm:
-case WGPUTextureFormat_RGBA8Uint:
-case WGPUTextureFormat_RGBA8Sint:
-return std::nullopt;
-case WGPUTextureFormat_BGRA8Unorm:
-case WGPUTextureFormat_BGRA8UnormSrgb:
-return WGPUTextureFormat_BGRA8Unorm;
-case WGPUTextureFormat_RGB10A2Unorm:
-case WGPUTextureFormat_RG11B10Ufloat:
-case WGPUTextureFormat_RGB9E5Ufloat:
-case WGPUTextureFormat_RG32Float:
-case WGPUTextureFormat_RG32Uint:
-case WGPUTextureFormat_RG32Sint:
-case WGPUTextureFormat_RGBA16Uint:
-case WGPUTextureFormat_RGBA16Sint:
-case WGPUTextureFormat_RGBA16Float:
-case WGPUTextureFormat_RGBA32Float:
-case WGPUTextureFormat_RGBA32Uint:
-case WGPUTextureFormat_RGBA32Sint:
-case WGPUTextureFormat_Stencil8:
-case WGPUTextureFormat_Depth16Unorm:
-case WGPUTextureFormat_Depth24Plus:
-case WGPUTextureFormat_Depth24PlusStencil8:
-case WGPUTextureFormat_Depth24UnormStencil8:
-case WGPUTextureFormat_Depth32Float:
-case WGPUTextureFormat_Depth32FloatStencil8:
-return std::nullop

[webkit-changes] [292522] trunk

2022-04-06 Thread mmaxfield
Title: [292522] trunk








Revision 292522
Author mmaxfi...@apple.com
Date 2022-04-06 19:44:11 -0700 (Wed, 06 Apr 2022)


Log Message
NBSP characters drawn in fonts that don't support the space character turn into boxes
https://bugs.webkit.org/show_bug.cgi?id=238836


Reviewed by Alan Bujtas.

Source/WebCore:

We have some historical code in WebKit where we swap out the non-breaking space glyph
for the space glyphs when rendering. This is not what the other browsers do; they will
faithfully render the non-breaking space glyph. This patch aligns with the other
browsers.

This patch also fixes a similar problem with tab characters. Other browsers never
render any visible tab glyphs, even if the font has a visible glyph for the tab
character. This patch implements this.

This patch also only clobbers the glyphs used for carriageReturn and newlineCharacter
if the replacement glyph exists.

Test: fast/text/nbsp-no-space.html

* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::applyCSSVisibilityRules):

LayoutTests:

* fast/text/nbsp-no-space-expected.html: Added.
* fast/text/nbsp-no-space.html: Added.
* fast/text/resources/Ahem-nbsp-no-space.ttf: Added. Supports NBSP but not space.
* fast/text/resources/Ahem-visible-tab-and-space.ttf: Added. Has visible glyphs for tab and space.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/GlyphBuffer.h
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp


Added Paths

trunk/LayoutTests/fast/text/nbsp-no-space-expected.html
trunk/LayoutTests/fast/text/nbsp-no-space.html
trunk/LayoutTests/fast/text/resources/Ahem-nbsp-no-space.ttf
trunk/LayoutTests/fast/text/resources/Ahem-visible-tab-and-space.ttf




Diff

Modified: trunk/LayoutTests/ChangeLog (292521 => 292522)

--- trunk/LayoutTests/ChangeLog	2022-04-07 02:18:01 UTC (rev 292521)
+++ trunk/LayoutTests/ChangeLog	2022-04-07 02:44:11 UTC (rev 292522)
@@ -1,3 +1,16 @@
+2022-04-06  Myles C. Maxfield  
+
+NBSP characters drawn in fonts that don't support the space character turn into boxes
+https://bugs.webkit.org/show_bug.cgi?id=238836
+
+
+Reviewed by Alan Bujtas.
+
+* fast/text/nbsp-no-space-expected.html: Added.
+* fast/text/nbsp-no-space.html: Added.
+* fast/text/resources/Ahem-nbsp-no-space.ttf: Added. Supports NBSP but not space.
+* fast/text/resources/Ahem-visible-tab-and-space.ttf: Added. Has visible glyphs for tab and space.
+
 2022-04-06  Andres Gonzalez  
 
 [ Mac ] accessibility/mac/expanded-notification.html is a flaky text failure


Added: trunk/LayoutTests/fast/text/nbsp-no-space-expected.html (0 => 292522)

--- trunk/LayoutTests/fast/text/nbsp-no-space-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/nbsp-no-space-expected.html	2022-04-07 02:44:11 UTC (rev 292522)
@@ -0,0 +1,14 @@
+
+
+
+
+@font-face {
+font-family: "WebFont";
+src: url("resources/Ahem-nbsp-no-space.ttf") format("truetype");
+}
+
+
+
+This test makes sure that the nbsp glyph is used in a font if the space glyph is unavailable. The test passes if this text you're reading right now is the only text on the page.
+
+


Added: trunk/LayoutTests/fast/text/nbsp-no-space.html (0 => 292522)

--- trunk/LayoutTests/fast/text/nbsp-no-space.html	(rev 0)
+++ trunk/LayoutTests/fast/text/nbsp-no-space.html	2022-04-07 02:44:11 UTC (rev 292522)
@@ -0,0 +1,20 @@
+
+
+
+
+@font-face {
+font-family: "WebFont";
+src: url("resources/Ahem-nbsp-no-space.ttf") format("truetype");
+}
+@font-face {
+font-family: "WebFont2";
+src: url("resources/Ahem-visible-tab-and-space.ttf") format("truetype");
+}
+
+
+
+This test makes sure that the nbsp glyph is used in a font if the space glyph is unavailable. The test passes if this text you're reading right now is the only text on the page.
+ 
+	
+
+


Added: trunk/LayoutTests/fast/text/resources/Ahem-nbsp-no-space.ttf (0 => 292522)

--- trunk/LayoutTests/fast/text/resources/Ahem-nbsp-no-space.ttf	(rev 0)
+++ trunk/LayoutTests/fast/text/resources/Ahem-nbsp-no-space.ttf	2022-04-07 02:44:11 UTC (rev 292522)
@@ -0,0 +1,44 @@
+\x800OS/2sf\xF8\xBC`cmap\x9Fu\xF0:gasp	0glyf0*	\xFD@\xA8head\xDBP͵ \xE86hhea
+7! $hmtx+!DXloca\xBEԸ7%\x9C.maxp	'\xCC nameM\xDAc'\xEC1\xAEpostc\xA1[#Y\x9C\xD6\x90\xBC\x8A\x8F\xBC\x8A\xC52\x80\xAF HW3C @ \xFE\xFF \xFF8 \xC8\xFF\xFC\xFF\xFF   << &~\xA0\xA1\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC5
[webkit-changes] [292479] trunk/Source/WebGPU

2022-04-06 Thread mmaxfield
Title: [292479] trunk/Source/WebGPU








Revision 292479
Author mmaxfi...@apple.com
Date 2022-04-06 11:08:52 -0700 (Wed, 06 Apr 2022)


Log Message
[WebGPU] Fix the tvOS build
https://bugs.webkit.org/show_bug.cgi?id=238881


Unreviewed.

MTLTextureType2DMultisampleArray is not available on tvOS.

* WebGPU/Texture.mm:
(WebGPU::Device::createTexture):
(WebGPU::Texture::createView):

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/WebGPU/Texture.mm




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292478 => 292479)

--- trunk/Source/WebGPU/ChangeLog	2022-04-06 17:57:35 UTC (rev 292478)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-06 18:08:52 UTC (rev 292479)
@@ -1,3 +1,17 @@
+2022-04-06  Myles C. Maxfield  
+
+[WebGPU] Fix the tvOS build
+https://bugs.webkit.org/show_bug.cgi?id=238881
+
+
+Unreviewed.
+
+MTLTextureType2DMultisampleArray is not available on tvOS.
+
+* WebGPU/Texture.mm:
+(WebGPU::Device::createTexture):
+(WebGPU::Texture::createView):
+
 2022-04-04  Myles C. Maxfield  
 
 [WebGPU] Set svn:ignore on WebGPU.xcodeproj


Modified: trunk/Source/WebGPU/WebGPU/Texture.mm (292478 => 292479)

--- trunk/Source/WebGPU/WebGPU/Texture.mm	2022-04-06 17:57:35 UTC (rev 292478)
+++ trunk/Source/WebGPU/WebGPU/Texture.mm	2022-04-06 18:08:52 UTC (rev 292479)
@@ -1896,7 +1896,7 @@
 if (descriptor.size.depthOrArrayLayers > 1) {
 textureDescriptor.arrayLength = descriptor.size.depthOrArrayLayers;
 if (descriptor.sampleCount > 1) {
-#if PLATFORM(WATCHOS)
+#if PLATFORM(WATCHOS) || PLATFORM(TVOS)
 return nullptr;
 #else
 textureDescriptor.textureType = MTLTextureType2DMultisampleArray;
@@ -2244,7 +2244,7 @@
 break;
 case WGPUTextureViewDimension_2DArray:
 if (m_descriptor.sampleCount > 1) {
-#if PLATFORM(WATCHOS)
+#if PLATFORM(WATCHOS) || PLATFORM(TVOS)
 return nullptr;
 #else
 textureType = MTLTextureType2DMultisampleArray;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292414] trunk/Source/WebGPU

2022-04-05 Thread mmaxfield
Title: [292414] trunk/Source/WebGPU








Revision 292414
Author mmaxfi...@apple.com
Date 2022-04-05 13:01:09 -0700 (Tue, 05 Apr 2022)


Log Message
[WebGPU] Set svn:ignore on WebGPU.xcodeproj
https://bugs.webkit.org/show_bug.cgi?id=238828

Reviewed by Alexey Proskuryakov.

For people who use pure SVN, building causes some spurious files to be created.
Other WebKit projects solve this by setting svn:ignore on .xcodeproj directories.
This does the same.

% svn propget svn:ignore WebGPU.xcodeproj
*.mode*
*.pbxuser
*.perspective*
project.xcworkspace
xcuserdata

%

* WebGPU.xcodeproj: Set svn:ignore.

Modified Paths

trunk/Source/WebGPU/ChangeLog


Property Changed

trunk/Source/WebGPU/WebGPU.xcodeproj/




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292413 => 292414)

--- trunk/Source/WebGPU/ChangeLog	2022-04-05 19:54:03 UTC (rev 292413)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-05 20:01:09 UTC (rev 292414)
@@ -1,3 +1,25 @@
+2022-04-04  Myles C. Maxfield  
+
+[WebGPU] Set svn:ignore on WebGPU.xcodeproj
+https://bugs.webkit.org/show_bug.cgi?id=238828
+
+Reviewed by Alexey Proskuryakov.
+
+For people who use pure SVN, building causes some spurious files to be created.
+Other WebKit projects solve this by setting svn:ignore on .xcodeproj directories.
+This does the same.
+
+% svn propget svn:ignore WebGPU.xcodeproj
+*.mode*
+*.pbxuser
+*.perspective*
+project.xcworkspace
+xcuserdata
+
+% 
+
+* WebGPU.xcodeproj: Set svn:ignore.
+
 2022-04-05  Chris Dumez  
 
 Mark String(const char*) constructor as explicit
Index: trunk/Source/WebGPU/WebGPU.xcodeproj
===
--- trunk/Source/WebGPU/WebGPU.xcodeproj	2022-04-05 19:54:03 UTC (rev 292413)
+++ trunk/Source/WebGPU/WebGPU.xcodeproj	2022-04-05 20:01:09 UTC (rev 292414)


Property changes: trunk/Source/WebGPU/WebGPU.xcodeproj



Added: svn:ignore
+*.mode*
+*.pbxuser
+*.perspective*
+project.xcworkspace
+xcuserdata




___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292368] trunk/Source/WebGPU

2022-04-04 Thread mmaxfield
Title: [292368] trunk/Source/WebGPU








Revision 292368
Author mmaxfi...@apple.com
Date 2022-04-04 20:29:17 -0700 (Mon, 04 Apr 2022)


Log Message
[WebGPU] Fix Apple's internal build
https://bugs.webkit.org/show_bug.cgi?id=238786


Unreviewed build fix.

Copy FRAMEWORK_SEARCH_PATHS and SYSTEM_FRAMEWORK_SEARCH_PATHS from WebCore.xcconfig.

* Configurations/WebGPU.xcconfig:

Modified Paths

trunk/Source/WebGPU/ChangeLog
trunk/Source/WebGPU/Configurations/WebGPU.xcconfig




Diff

Modified: trunk/Source/WebGPU/ChangeLog (292367 => 292368)

--- trunk/Source/WebGPU/ChangeLog	2022-04-05 03:01:41 UTC (rev 292367)
+++ trunk/Source/WebGPU/ChangeLog	2022-04-05 03:29:17 UTC (rev 292368)
@@ -1,3 +1,15 @@
+2022-04-04  Myles C. Maxfield  
+
+[WebGPU] Fix Apple's internal build
+https://bugs.webkit.org/show_bug.cgi?id=238786
+
+
+Unreviewed build fix.
+
+Copy FRAMEWORK_SEARCH_PATHS and SYSTEM_FRAMEWORK_SEARCH_PATHS from WebCore.xcconfig.
+
+* Configurations/WebGPU.xcconfig:
+
 2022-04-01  Michael Saboff  
 
 Stop copying StagedFrameworks to the secondary path by default


Modified: trunk/Source/WebGPU/Configurations/WebGPU.xcconfig (292367 => 292368)

--- trunk/Source/WebGPU/Configurations/WebGPU.xcconfig	2022-04-05 03:01:41 UTC (rev 292367)
+++ trunk/Source/WebGPU/Configurations/WebGPU.xcconfig	2022-04-05 03:29:17 UTC (rev 292368)
@@ -25,6 +25,17 @@
 
 HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/usr/local/include" $(inherited);
 
+WK_PRIVATE_FRAMEWORKS_DIR = $(WK_PRIVATE_FRAMEWORKS_DIR_$(USE_INTERNAL_SDK));
+WK_PRIVATE_FRAMEWORKS_DIR_[sdk=macos*] = $(PROJECT_DIR)/../../WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/$(TARGET_MAC_OS_X_VERSION_MAJOR);
+WK_PRIVATE_FRAMEWORKS_DIR_[sdk=iphone*] = $(PROJECT_DIR)/../../WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/$(WK_TARGET_IOS_VERSION_MAJOR);
+WK_PRIVATE_FRAMEWORKS_DIR_[sdk=appletv*] = $(PROJECT_DIR)/../../WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/$(WK_TARGET_TVOS_VERSION_MAJOR);
+WK_PRIVATE_FRAMEWORKS_DIR_[sdk=watch*] = $(PROJECT_DIR)/../../WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/$(WK_TARGET_WATCHOS_VERSION_MAJOR);
+
+FRAMEWORK_SEARCH_PATHS[sdk=embedded*] = $(WK_QUOTED_OVERRIDE_FRAMEWORKS_DIR) $(BUILT_PRODUCTS_DIR) $(WK_PRIVATE_FRAMEWORKS_DIR);
+FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(WK_QUOTED_OVERRIDE_FRAMEWORKS_DIR);
+
+SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks
+
 INFOPLIST_FILE = Info.plist;
 
 INSTALL_PATH = $(INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_$(USE_SYSTEM_CONTENT_PATH));






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292283] trunk/LayoutTests

2022-04-04 Thread mmaxfield
Title: [292283] trunk/LayoutTests








Revision 292283
Author mmaxfi...@apple.com
Date 2022-04-04 01:03:30 -0700 (Mon, 04 Apr 2022)


Log Message
[WebGPU] Unskip the first few passing WebGPU tests
https://bugs.webkit.org/show_bug.cgi?id=238709

Reviewed by Tim Nguyen.

The tests pass, so they shouldn't be marked as skip.

* platform/ios-device-wk1/TestExpectations:
* platform/ios-simulator-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/ios-device-wk1/TestExpectations
trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations
trunk/LayoutTests/platform/mac-wk1/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (292282 => 292283)

--- trunk/LayoutTests/ChangeLog	2022-04-04 07:53:56 UTC (rev 292282)
+++ trunk/LayoutTests/ChangeLog	2022-04-04 08:03:30 UTC (rev 292283)
@@ -1,3 +1,16 @@
+2022-04-04  Myles C. Maxfield  
+
+[WebGPU] Unskip the first few passing WebGPU tests
+https://bugs.webkit.org/show_bug.cgi?id=238709
+
+Reviewed by Tim Nguyen.
+
+The tests pass, so they shouldn't be marked as skip.
+
+* platform/ios-device-wk1/TestExpectations:
+* platform/ios-simulator-wk1/TestExpectations:
+* platform/mac-wk1/TestExpectations:
+
 2022-04-02  Myles C. Maxfield  
 
 [Cocoa] Automatically relayout the page when new fonts are installed


Modified: trunk/LayoutTests/platform/ios-device-wk1/TestExpectations (292282 => 292283)

--- trunk/LayoutTests/platform/ios-device-wk1/TestExpectations	2022-04-04 07:53:56 UTC (rev 292282)
+++ trunk/LayoutTests/platform/ios-device-wk1/TestExpectations	2022-04-04 08:03:30 UTC (rev 292283)
@@ -9,9 +9,6 @@
 http/tests/is-logged-in/ [ Skip ]
 
 # WebGPU is not fully implemented yet.
-http/tests/webgpu/webgpu/idl/constants/flags.html [ Skip ]
-http/tests/webgpu/webgpu/idl/exposed.https.html [ Skip ]
-http/tests/webgpu/webgpu/idl/exposed.http.html [ Skip ]
 http/tests/webgpu/webgpu/web_platform/copyToTexture/video.html [ Skip ]
 http/tests/webgpu/webgpu/web_platform/copyToTexture/ImageBitmap.html [ Skip ]
 http/tests/webgpu/webgpu/web_platform/copyToTexture/canvas.html [ Skip ]


Modified: trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations (292282 => 292283)

--- trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations	2022-04-04 07:53:56 UTC (rev 292282)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations	2022-04-04 08:03:30 UTC (rev 292283)
@@ -19,9 +19,6 @@
 http/tests/is-logged-in/ [ Skip ]
 
 # WebGPU is not fully implemented yet.
-http/tests/webgpu/webgpu/idl/constants/flags.html [ Skip ]
-http/tests/webgpu/webgpu/idl/exposed.https.html [ Skip ]
-http/tests/webgpu/webgpu/idl/exposed.http.html [ Skip ]
 http/tests/webgpu/webgpu/web_platform/copyToTexture/video.html [ Skip ]
 http/tests/webgpu/webgpu/web_platform/copyToTexture/ImageBitmap.html [ Skip ]
 http/tests/webgpu/webgpu/web_platform/copyToTexture/canvas.html [ Skip ]


Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (292282 => 292283)

--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2022-04-04 07:53:56 UTC (rev 292282)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2022-04-04 08:03:30 UTC (rev 292283)
@@ -1818,9 +1818,6 @@
 webkit.org/b/236128 imported/w3c/web-platform-tests/html/user-activation/activation-trigger-mouse-right.html [ Skip ]
 
 # WebGPU is not fully implemented yet.
-http/tests/webgpu/webgpu/idl/constants/flags.html [ Skip ]
-http/tests/webgpu/webgpu/idl/exposed.https.html [ Skip ]
-http/tests/webgpu/webgpu/idl/exposed.http.html [ Skip ]
 http/tests/webgpu/webgpu/web_platform/copyToTexture/video.html [ Skip ]
 http/tests/webgpu/webgpu/web_platform/copyToTexture/ImageBitmap.html [ Skip ]
 http/tests/webgpu/webgpu/web_platform/copyToTexture/canvas.html [ Skip ]
@@ -2001,4 +1998,4 @@
 http/tests/webgpu/webgpu/shader/validation/shader_io/locations.html [ Skip ]
 http/tests/webgpu/webgpu/shader/validation/wgsl/basic.html [ Skip ]
 
-webkit.org/b/238642 imported/w3c/web-platform-tests/css/css-contain/contain-body-overflow-002.html [ Failure ]
\ No newline at end of file
+webkit.org/b/238642 imported/w3c/web-platform-tests/css/css-contain/contain-body-overflow-002.html [ Failure ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292274] trunk

2022-04-02 Thread mmaxfield
Title: [292274] trunk








Revision 292274
Author mmaxfi...@apple.com
Date 2022-04-02 22:39:31 -0700 (Sat, 02 Apr 2022)


Log Message
[Cocoa] Automatically relayout the page when new fonts are installed
https://bugs.webkit.org/show_bug.cgi?id=238483


Reviewed by Chris Dumez.

Source/WebCore:

This patch simply calls setNeedsRecalcStyleInAllFrames on every Page when we receive a
kCTFontManagerRegisteredFontsChangedNotification.

FontCache::invalidateAllFontCaches() can't do this directly because it's in platform/ and
therefore isn't allowed to know what Pages are. Instead, this patch takes a process-global
callback and calls that instead. This callback is set at initialization time.

Test: fast/text/install-font-style-recalc.html

* page/Page.cpp:
(WebCore::m_contentSecurityPolicyModeForExtension):
(WebCore::Page::firstTimeInitialization):
* page/Page.h:
* platform/graphics/FontCache.cpp:
(WebCore::Function

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/TestExpectations
trunk/LayoutTests/platform/ios-wk2/TestExpectations
trunk/LayoutTests/platform/mac-wk2/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/Page.cpp
trunk/Source/WebCore/page/Page.h
trunk/Source/WebCore/platform/graphics/FontCache.cpp
trunk/Source/WebCore/platform/graphics/FontCache.h
trunk/Tools/ChangeLog
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp


Added Paths

trunk/LayoutTests/fast/text/install-font-style-recalc-expected.txt
trunk/LayoutTests/fast/text/install-font-style-recalc.html




Diff

Modified: trunk/LayoutTests/ChangeLog (292273 => 292274)

--- trunk/LayoutTests/ChangeLog	2022-04-03 05:24:35 UTC (rev 292273)
+++ trunk/LayoutTests/ChangeLog	2022-04-03 05:39:31 UTC (rev 292274)
@@ -1,3 +1,17 @@
+2022-04-02  Myles C. Maxfield  
+
+[Cocoa] Automatically relayout the page when new fonts are installed
+https://bugs.webkit.org/show_bug.cgi?id=238483
+
+
+Reviewed by Chris Dumez.
+
+* TestExpectations:
+* fast/text/install-font-style-recalc-expected.txt: Added.
+* fast/text/install-font-style-recalc.html: Added.
+* platform/ios-wk2/TestExpectations:
+* platform/mac-wk2/TestExpectations:
+
 2022-04-02  Alan Bujtas  
 
 [Ruby] Remove incorrect implicit integral floor in RenderRubyText::adjustInlineDirectionLineBounds


Modified: trunk/LayoutTests/TestExpectations (292273 => 292274)

--- trunk/LayoutTests/TestExpectations	2022-04-03 05:24:35 UTC (rev 292273)
+++ trunk/LayoutTests/TestExpectations	2022-04-03 05:39:31 UTC (rev 292274)
@@ -5204,3 +5204,6 @@
 
 # Only certain ports have WebGPU implementations.
 http/tests/webgpu [ Failure ImageOnlyFailure Pass Timeout ]
+
+# Only some ports automatically relayout if a font is installed while the page is open
+fast/text/install-font-style-recalc.html [ Failure ]


Added: trunk/LayoutTests/fast/text/install-font-style-recalc-expected.txt (0 => 292274)

--- trunk/LayoutTests/fast/text/install-font-style-recalc-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/text/install-font-style-recalc-expected.txt	2022-04-03 05:39:31 UTC (rev 292274)
@@ -0,0 +1,11 @@
+This test makes sure that installing a font causes a style recalc. The test only runs in DumpRenderTree/WebKitTestRunner. It passes if the text above is rendered as black boxes (aka in Ahem).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS target.offsetWidth became 200
+PASS The font was used.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Property changes on: trunk/LayoutTests/fast/text/install-font-style-recalc-expected.txt
___


Added: svn:eol-style
+native
\ No newline at end of property

Added: svn:keywords
+Author Date Id Rev URL
\ No newline at end of property

Added: trunk/LayoutTests/fast/text/install-font-style-recalc.html (0 => 292274)

--- trunk/LayoutTests/fast/text/install-font-style-recalc.html	(rev 0)
+++ trunk/LayoutTests/fast/text/install-font-style-recalc.html	2022-04-03 05:39:31 UTC (rev 292274)
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+