WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-237464-20220304112252.patch (text/plain), 2.01 KB, created by
Kimmo Kinnunen
on 2022-03-04 01:22:53 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Kimmo Kinnunen
Created:
2022-03-04 01:22:53 PST
Size:
2.01 KB
patch
obsolete
>Subversion Revision: 290817 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 634f865a35d13519823df4adca2cb148cecc93af..b2c14cc705754a65425f5bc72fb0be23bb2c7df0 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2022-03-04 Kimmo Kinnunen <kkinnunen@apple.com> >+ >+ Iteration to search for least active WebGLRenderingContextBase could use min_element >+ https://bugs.webkit.org/show_bug.cgi?id=237464 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Apply review comments after landing bug 222411 r290816. >+ >+ * html/canvas/WebGLRenderingContextBase.cpp: >+ (WebCore::addActiveContext): >+ > 2022-03-03 Kimmo Kinnunen <kkinnunen@apple.com> > > WebGL context count is not limited for GPU process >diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >index ab81207a0327fc03721a2e0fdfee225ebf424f69..5b18860726f299037be0cac9768cbc584f594dc6 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >@@ -809,12 +809,9 @@ static void addActiveContext(WebGLRenderingContextBase& newContext) > auto& contexts = activeContexts(); > auto maxContextsSize = isMainThread() ? maxActiveContexts : maxActiveWorkerContexts; > if (contexts.size() >= maxContextsSize) { >- auto it = contexts.begin(); >- auto* earliest = *it; >- for (++it; it != contexts.end(); ++it) { >- if (earliest->activeOrdinal() > (*it)->activeOrdinal()) >- earliest = *it; >- } >+ auto* earliest = *std::min_element(contexts.begin(), contexts.end(), [] (auto& a, auto& b) { >+ return a->activeOrdinal() < b->activeOrdinal(); >+ }); > earliest->recycleContext(); > ASSERT(earliest != &newContext); // This assert is here so we can assert isNewEntry below instead of top-level `!contexts.contains(newContext);`. > ASSERT(contexts.size() < maxContextsSize);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 237464
: 453820