Skip to content

Commit

Permalink
WebGL high performance context status diagnostic is not useful anymore
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=263651
rdar://117470970

Reviewed by Chris Dumez.

WebGL would keep track if the page contains high performance
WebGL contexts and would provide a way for the browser to obtain this
status as diagnostic log value. This is likely not useful anymore.

Removes the diagnostic key and code that populates it.

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker): Deleted.
* Source/WebCore/html/canvas/WebGLRenderingContextBase.h:
* Source/WebCore/html/canvas/WebGLStateTracker.cpp: Removed.
* Source/WebCore/html/canvas/WebGLStateTracker.h: Removed.
* Source/WebCore/page/DiagnosticLoggingKeys.cpp:
(WebCore::WebCore::DiagnosticLoggingKeys::webGLStateKey): Deleted.
* Source/WebCore/page/Page.cpp:
(WebCore::Page::Page):
* Source/WebCore/page/Page.h:
(WebCore::Page::webGLStateTracker const): Deleted.
* Source/WebCore/page/PageConfiguration.cpp:
* Source/WebCore/page/PageConfiguration.h:
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/HighPerformanceGraphicsUsageSampler.cpp: Removed.
* Source/WebKit/UIProcess/HighPerformanceGraphicsUsageSampler.h: Removed.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::m_historyItemClient):

Canonical link: https://commits.webkit.org/270337@main
  • Loading branch information
kkinnunen-apple authored and cdumez committed Nov 7, 2023
1 parent f101205 commit 347e859
Show file tree
Hide file tree
Showing 22 changed files with 0 additions and 326 deletions.
1 change: 0 additions & 1 deletion Source/WebCore/Headers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,6 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
html/canvas/WebGLContextAttributes.h
html/canvas/WebGLExtensionAny.h
html/canvas/WebGLExtensionAnyInlines.h
html/canvas/WebGLStateTracker.h

html/forms/FileIconLoader.h

Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/Sources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,6 @@ html/canvas/WebGLRenderingContextBase.cpp
html/canvas/WebGLSampler.cpp
html/canvas/WebGLShader.cpp
html/canvas/WebGLShaderPrecisionFormat.cpp
html/canvas/WebGLStateTracker.cpp
html/canvas/WebGLStencilTexturing.cpp
html/canvas/WebGLSync.cpp
html/canvas/WebGLTexture.cpp
Expand Down
6 changes: 0 additions & 6 deletions Source/WebCore/WebCore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,6 @@
38F23AB51E8E83D000CE46F5 /* JSWebGPUComputePipelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = 38F23AB21E8E83D000CE46F5 /* JSWebGPUComputePipelineState.h */; };
3A2FE8CF2978CC7800BA1D92 /* GCGLSpan.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A2FE8CE2978CC7800BA1D92 /* GCGLSpan.h */; settings = {ATTRIBUTES = (Private, ); }; };
3A7D62DA29D49EC900D57DAC /* SWRegistrationDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A7D62D829D49EC800D57DAC /* SWRegistrationDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
3AA3F63F2983555700E912C1 /* WebGLStateTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AA3F63E2983555100E912C1 /* WebGLStateTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
3ABD156A297A289300AF9D76 /* GraphicsContextGLEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 3ABD1569297A289200AF9D76 /* GraphicsContextGLEnums.h */; settings = {ATTRIBUTES = (Private, ); }; };
3ABD156C297A340100AF9D76 /* GraphicsContextGLActiveInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 3ABD156B297A340000AF9D76 /* GraphicsContextGLActiveInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
3AC4C04429D345D800402716 /* SWRegistrationStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AC4C04229D345D800402716 /* SWRegistrationStore.h */; settings = {ATTRIBUTES = (Private, ); }; };
Expand Down Expand Up @@ -9585,8 +9584,6 @@
3A2FE8CE2978CC7800BA1D92 /* GCGLSpan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCGLSpan.h; sourceTree = "<group>"; };
3A7D62D729D49EC800D57DAC /* SWRegistrationDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SWRegistrationDatabase.cpp; sourceTree = "<group>"; };
3A7D62D829D49EC800D57DAC /* SWRegistrationDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWRegistrationDatabase.h; sourceTree = "<group>"; };
3AA3F63D2983555100E912C1 /* WebGLStateTracker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLStateTracker.cpp; sourceTree = "<group>"; };
3AA3F63E2983555100E912C1 /* WebGLStateTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebGLStateTracker.h; sourceTree = "<group>"; };
3ABD1569297A289200AF9D76 /* GraphicsContextGLEnums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLEnums.h; sourceTree = "<group>"; };
3ABD156B297A340000AF9D76 /* GraphicsContextGLActiveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContextGLActiveInfo.h; sourceTree = "<group>"; };
3AC4C04229D345D800402716 /* SWRegistrationStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWRegistrationStore.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -24689,8 +24686,6 @@
A08CF153152B77B3009C5775 /* WebGLShaderPrecisionFormat.cpp */,
A07D3357152B632D001B6393 /* WebGLShaderPrecisionFormat.h */,
A07D3359152B633E001B6393 /* WebGLShaderPrecisionFormat.idl */,
3AA3F63D2983555100E912C1 /* WebGLStateTracker.cpp */,
3AA3F63E2983555100E912C1 /* WebGLStateTracker.h */,
8A497DF72A76D62D002F2791 /* WebGLStencilTexturing.cpp */,
8A497DF92A76D62E002F2791 /* WebGLStencilTexturing.h */,
8A497DF82A76D62D002F2791 /* WebGLStencilTexturing.idl */,
Expand Down Expand Up @@ -42332,7 +42327,6 @@
6F995A221A7078B100A735F4 /* WebGLSampler.h in Headers */,
49C7B9E31042D32F0009D447 /* WebGLShader.h in Headers */,
A07D3358152B632D001B6393 /* WebGLShaderPrecisionFormat.h in Headers */,
3AA3F63F2983555700E912C1 /* WebGLStateTracker.h in Headers */,
8A497DFA2A76D641002F2791 /* WebGLStencilTexturing.h in Headers */,
6F995A161A70756200A735F4 /* WebGLSync.h in Headers */,
49C7B9E61042D32F0009D447 /* WebGLTexture.h in Headers */,
Expand Down
18 changes: 0 additions & 18 deletions Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,6 @@ WebGLRenderingContextBase::WebGLRenderingContextBase(CanvasBase& canvas, WebGLCo
, m_isXRCompatible(attributes.xrCompatible)
#endif
{
registerWithWebGLStateTracker();
if (htmlCanvas())
m_checkForContextLossHandlingTimer.startOneShot(checkContextLossHandlingDelay);
}
Expand Down Expand Up @@ -708,23 +707,6 @@ void WebGLRenderingContextBase::checkForContextLossHandling()
page->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::pageHandlesWebGLContextLossKey(), handlesContextLoss ? DiagnosticLoggingKeys::yesKey() : DiagnosticLoggingKeys::noKey(), ShouldSample::No);
}

void WebGLRenderingContextBase::registerWithWebGLStateTracker()
{
auto* canvas = htmlCanvas();
if (!canvas)
return;

auto* page = canvas->document().page();
if (!page)
return;

auto* tracker = page->webGLStateTracker();
if (!tracker)
return;

m_trackerToken = tracker->token(m_attributes.initialPowerPreference);
}

void WebGLRenderingContextBase::initializeNewContext(Ref<GraphicsContextGL> context)
{
bool wasActive = m_context;
Expand Down
3 changes: 0 additions & 3 deletions Source/WebCore/html/canvas/WebGLRenderingContextBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include "WebGLQuery.h"
#include "WebGLRenderbuffer.h"
#include "WebGLSampler.h"
#include "WebGLStateTracker.h"
#include "WebGLTexture.h"
#include "WebGLTimerQueryEXT.h"
#include "WebGLTransformFeedback.h"
Expand Down Expand Up @@ -1012,7 +1011,6 @@ class WebGLRenderingContextBase : public GraphicsContextGL::Client, public GPUBa
void maybeRestoreContextSoon(Seconds timeout = 0_s);
void maybeRestoreContext();

void registerWithWebGLStateTracker();
void checkForContextLossHandling();

void activityStateDidChange(OptionSet<ActivityState> oldActivityState, OptionSet<ActivityState> newActivityState) override;
Expand All @@ -1031,7 +1029,6 @@ class WebGLRenderingContextBase : public GraphicsContextGL::Client, public GPUBa
ExceptionOr<void> texImageSource(TexImageFunctionID, GCGLenum target, GCGLint level, GCGLint internalformat, GCGLint border, GCGLenum format, GCGLenum type, GCGLint xoffset, GCGLint yoffset, GCGLint zoffset, const IntRect& inputSourceImageRect, GCGLsizei depth, GCGLint unpackImageHeight, WebCodecsVideoFrame& source);
#endif

WebGLStateTracker::Token m_trackerToken;
Timer m_checkForContextLossHandlingTimer;
bool m_isSuspended { false };

Expand Down
57 changes: 0 additions & 57 deletions Source/WebCore/html/canvas/WebGLStateTracker.cpp

This file was deleted.

57 changes: 0 additions & 57 deletions Source/WebCore/html/canvas/WebGLStateTracker.h

This file was deleted.

5 changes: 0 additions & 5 deletions Source/WebCore/page/DiagnosticLoggingKeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,11 +780,6 @@ String WebCore::DiagnosticLoggingKeys::notHTTPFamilyKey()
return "notHTTPFamily"_s;
}

String WebCore::DiagnosticLoggingKeys::webGLStateKey()
{
return "webGLState"_s;
}

String DiagnosticLoggingKeys::memoryUsageToDiagnosticLoggingKey(uint64_t memoryUsage)
{
if (memoryUsage < 32 * MB)
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/page/DiagnosticLoggingKeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ class DiagnosticLoggingKeys {
WEBCORE_EXPORT static String visibleAndActiveStateKey();
WEBCORE_EXPORT static String wastedSpeculativeWarmupWithRevalidationKey();
WEBCORE_EXPORT static String wastedSpeculativeWarmupWithoutRevalidationKey();
WEBCORE_EXPORT static String webGLStateKey();
WEBCORE_EXPORT static String webViewKey();
static String yesKey();

Expand Down
7 changes: 0 additions & 7 deletions Source/WebCore/page/Page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@
#include "ServicesOverlayController.h"
#endif

#if ENABLE(WEBGL)
#include "WebGLStateTracker.h"
#endif

#include "DisplayView.h"

#if ENABLE(MEDIA_SESSION_COORDINATOR)
Expand Down Expand Up @@ -308,9 +304,6 @@ Page::Page(PageConfiguration&& pageConfiguration)
, m_validationMessageClient(WTFMove(pageConfiguration.validationMessageClient))
, m_diagnosticLoggingClient(WTFMove(pageConfiguration.diagnosticLoggingClient))
, m_performanceLoggingClient(WTFMove(pageConfiguration.performanceLoggingClient))
#if ENABLE(WEBGL)
, m_webGLStateTracker(WTFMove(pageConfiguration.webGLStateTracker))
#endif
#if ENABLE(SPEECH_SYNTHESIS)
, m_speechSynthesisClient(WTFMove(pageConfiguration.speechSynthesisClient))
#endif
Expand Down
9 changes: 0 additions & 9 deletions Source/WebCore/page/Page.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ class UserStyleSheet;
class ValidationMessageClient;
class VisibleSelection;
class VisitedLinkStore;
class WebGLStateTracker;
class WheelEventDeltaFilter;
class WheelEventTestMonitor;
class WindowEventLoop;
Expand Down Expand Up @@ -947,10 +946,6 @@ class Page : public Supplementable<Page>, public CanMakeWeakPtr<Page>, public Ca
std::optional<CompositingPolicy> compositingPolicyOverride() const { return m_compositingPolicyOverride; }
void setCompositingPolicyOverride(std::optional<CompositingPolicy> policy) { m_compositingPolicyOverride = policy; }

#if ENABLE(WEBGL)
WebGLStateTracker* webGLStateTracker() const { return m_webGLStateTracker.get(); }
#endif

#if ENABLE(SPEECH_SYNTHESIS)
SpeechSynthesisClient* speechSynthesisClient() const { return m_speechSynthesisClient.get(); }
#endif
Expand Down Expand Up @@ -1172,10 +1167,6 @@ class Page : public Supplementable<Page>, public CanMakeWeakPtr<Page>, public Ca
std::unique_ptr<DiagnosticLoggingClient> m_diagnosticLoggingClient;
std::unique_ptr<PerformanceLoggingClient> m_performanceLoggingClient;

#if ENABLE(WEBGL)
std::unique_ptr<WebGLStateTracker> m_webGLStateTracker;
#endif

#if ENABLE(SPEECH_SYNTHESIS)
std::unique_ptr<SpeechSynthesisClient> m_speechSynthesisClient;
#endif
Expand Down
3 changes: 0 additions & 3 deletions Source/WebCore/page/PageConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
#include "ValidationMessageClient.h"
#include "VisitedLinkStore.h"
#include "WebRTCProvider.h"
#if ENABLE(WEBGL)
#include "WebGLStateTracker.h"
#endif
#if ENABLE(WEB_AUTHN)
#include "AuthenticatorCoordinatorClient.h"
#endif
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/page/PageConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class UserContentProvider;
class UserContentURLPattern;
class ValidationMessageClient;
class VisitedLinkStore;
class WebGLStateTracker;
class WebRTCProvider;

class PageConfiguration {
Expand Down Expand Up @@ -156,9 +155,6 @@ class PageConfiguration {
FrameIdentifier mainFrameIdentifier;
std::unique_ptr<DiagnosticLoggingClient> diagnosticLoggingClient;
std::unique_ptr<PerformanceLoggingClient> performanceLoggingClient;
#if ENABLE(WEBGL)
std::unique_ptr<WebGLStateTracker> webGLStateTracker;
#endif
#if ENABLE(SPEECH_SYNTHESIS)
std::unique_ptr<SpeechSynthesisClient> speechSynthesisClient;
#endif
Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/SourcesCocoa.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ WebProcess/GPU/webrtc/SharedVideoFrame.cpp

UIProcess/_WKWebViewPrintFormatter.mm
UIProcess/ApplicationStateTracker.mm
UIProcess/HighPerformanceGraphicsUsageSampler.cpp
UIProcess/PerActivityStateCPUUsageSampler.cpp
UIProcess/ViewGestureController.cpp
UIProcess/ViewSnapshotStore.cpp
Expand Down
Loading

0 comments on commit 347e859

Please sign in to comment.