[webkit-changes] [WebKit/WebKit] cd2160: Pixel pack and unpack state is cached but also ask...

Kimmo Kinnunen noreply at github.com
Fri May 26 00:50:01 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cd21603ce53071ee1f26c8bf86fe4761316d41cc
      https://github.com/WebKit/WebKit/commit/cd21603ce53071ee1f26c8bf86fe4761316d41cc
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2023-05-26 (Fri, 26 May 2023)

  Changed paths:
    M Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
    M Source/WebCore/html/canvas/WebGL2RenderingContext.h
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.h
    M Source/WebCore/platform/graphics/GraphicsContextGL.cpp
    M Source/WebCore/platform/graphics/GraphicsContextGL.h

  Log Message:
  -----------
  Pixel pack and unpack state is cached but also asked from the underlying context
https://bugs.webkit.org/show_bug.cgi?id=257314
rdar://109821711

Reviewed by Dan Glastonbury.

WebGLRenderingContextBase, WebGL2RenderingContext caches the
PACK_*, UNPACK_* state. When the WebGL client asks for the state,
the context will ask the underlying GraphicsContextGL for the state,
even though it is available as cached.

Return the cached state directly.
Use WebKit style for the functions and types related to this: use
full names and avoid using get prefix for accesors.

This is work towards being able to not send the state to the underlying
context. Remote variant should always readPixels with ignoring the client
packing in order to minimize transfers. This will be implemented in
subsequent patches. This means the underlying pack state and WebGL
pack state are going to be different, and thus asking the pack state
from the underlying context would need redundant mutation of the
state.

* Source/WebCore/html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::initializeNewContext):
(WebCore::WebGL2RenderingContext::getTextureSourceSubRectangle):
(WebCore::WebGL2RenderingContext::pixelStorei):
(WebCore::WebGL2RenderingContext::texImage3D):
(WebCore::WebGL2RenderingContext::texSubImage3D):
(WebCore::WebGL2RenderingContext::getParameter):
(WebCore::WebGL2RenderingContext::resetUnpackParameters): Deleted.
(WebCore::WebGL2RenderingContext::restoreUnpackParameters): Deleted.
(WebCore::WebGL2RenderingContext::getPackPixelStoreParams const): Deleted.
(WebCore::WebGL2RenderingContext::getUnpackPixelStoreParams const): Deleted.
* Source/WebCore/html/canvas/WebGL2RenderingContext.h:
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::ScopedTightUnpackParameters::ScopedTightUnpackParameters):
(WebCore::ScopedTightUnpackParameters::~ScopedTightUnpackParameters):
(WebCore::ScopedTightUnpackParameters::set):
(WebCore::WebGLRenderingContextBase::initializeNewContext):
(WebCore::WebGLRenderingContextBase::getParameter):
(WebCore::WebGLRenderingContextBase::pixelStorei):
(WebCore::WebGLRenderingContextBase::texImageSource):
(WebCore::WebGLRenderingContextBase::texImageArrayBufferViewHelper):
(WebCore::WebGLRenderingContextBase::texImageImpl):
(WebCore::WebGLRenderingContextBase::validateTexFuncData):
(WebCore::WebGLRenderingContextBase::unpackPixelStoreParameters const):
(WebCore::ScopedUnpackParametersResetRestore::ScopedUnpackParametersResetRestore): Deleted.
(WebCore::ScopedUnpackParametersResetRestore::~ScopedUnpackParametersResetRestore): Deleted.
(WebCore::WebGLRenderingContextBase::resetUnpackParameters): Deleted.
(WebCore::WebGLRenderingContextBase::restoreUnpackParameters): Deleted.
(WebCore::WebGLRenderingContextBase::getPackPixelStoreParams const): Deleted.
(WebCore::WebGLRenderingContextBase::getUnpackPixelStoreParams const): Deleted.
* Source/WebCore/html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::pixelStorePackParameters const):
(WebCore::WebGLRenderingContextBase::unpackPixelStoreParameters const):
* Source/WebCore/platform/graphics/GraphicsContextGL.cpp:
(WebCore::GraphicsContextGL::computeImageSizeInBytes):
(WebCore::GraphicsContextGL::packImageData):
(WebCore::GraphicsContextGL::extractPixelBuffer):
(WebCore::GraphicsContextGL::extractTextureData):
* Source/WebCore/platform/graphics/GraphicsContextGL.h:

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




More information about the webkit-changes mailing list