Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c97bb648ce7df7258c98aa137684a14d6e90bec5
      
https://github.com/WebKit/WebKit/commit/c97bb648ce7df7258c98aa137684a14d6e90bec5
  Author: Wenson Hsieh <[email protected]>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

  Changed paths:
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WebCore/html/CanvasBase.cpp
    M Source/WebCore/html/CanvasBase.h
    M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp

  Log Message:
  -----------
  Avoid premature canvas readback when post-processing image buffers
https://bugs.webkit.org/show_bug.cgi?id=254715
rdar://107393842

Reviewed by Simon Fraser and Matthew Finkel.

Bail earlier inside of `CanvasRenderingContext2DBase::postProcessPixelBuffer`, 
before we attempt to
call `getPixelBuffer` on the image buffer; this avoids extraneous work 
underneath
`postProcessPixelBuffer` in the case where noise injection is disabled.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:

Additionally remove a feature flag that is already on by default.

* Source/WebCore/html/CanvasBase.cpp:
(WebCore::CanvasBase::shouldInjectNoiseBeforeReadback const):

Add a helper method to return whether or not noise injection is enabled.

(WebCore::CanvasBase::postProcessPixelBuffer const):
* Source/WebCore/html/CanvasBase.h:
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::postProcessPixelBuffer const):

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to