[webkit-changes] [WebKit/WebKit] ac769e: [WebGPU] Simplify GPU initialization

Myles C. Maxfield noreply at github.com
Mon Jan 23 02:07:48 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ac769e68f0bc42f7c63b8a2b0df0cb74345d70f8
      https://github.com/WebKit/WebKit/commit/ac769e68f0bc42f7c63b8a2b0df0cb74345d70f8
  Author: Myles C. Maxfield <mmaxfield at apple.com>
  Date:   2023-01-23 (Mon, 23 Jan 2023)

  Changed paths:
    M Source/WebCore/Modules/WebGPU/GPU.cpp
    M Source/WebCore/Modules/WebGPU/GPU.h
    M Source/WebCore/page/Navigator.cpp

  Log Message:
  -----------
  [WebGPU] Simplify GPU initialization
https://bugs.webkit.org/show_bug.cgi?id=250961
rdar://104522195

Reviewed by Tadeu Zagallo.

Previously, there was a 2-step initialization, where you'd create the object and then
set it's backing. But this means there's an intermediate state where the object exists
but has no backing. Better to just use a 1-step initialization where the backing is
passed into the constructor, which eliminates that extra state, thereby simplifying
the class.

* Source/WebCore/Modules/WebGPU/GPU.cpp:
(WebCore::GPU::GPU):
(WebCore::GPU::requestAdapter):
(WebCore::GPU::setBacking): Deleted.
* Source/WebCore/Modules/WebGPU/GPU.h:
(WebCore::GPU::create):
* Source/WebCore/page/Navigator.cpp:
(WebCore::Navigator::gpu):

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




More information about the webkit-changes mailing list