Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel pack and unpack state is cached but also asked from the underlying context #14337

Commits on May 26, 2023

  1. Pixel pack and unpack state is cached but also asked from the underly…

    …ing 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
    kkinnunen-apple committed May 26, 2023
    Configuration menu
    Copy the full SHA
    cd21603 View commit details
    Browse the repository at this point in the history