Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f8c0fe750d94b7db23d193c0b1f31858c2537620
      
https://github.com/WebKit/WebKit/commit/f8c0fe750d94b7db23d193c0b1f31858c2537620
  Author: Georges Basile Stavracas Neto <feane...@igalia.com>
  Date:   2024-04-18 (Thu, 18 Apr 2024)

  Changed paths:
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/platform/Skia.cmake
    M Source/WebCore/platform/SourcesSkia.txt
    M Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp
    M Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
    M Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
    M Source/WebCore/platform/graphics/filters/FilterImage.cpp
    M Source/WebCore/platform/graphics/filters/FilterImage.h
    M Source/WebCore/platform/graphics/filters/SourceGraphic.cpp
    A Source/WebCore/platform/graphics/filters/skia/FEColorMatrixSkiaApplier.cpp
    A Source/WebCore/platform/graphics/filters/skia/FEColorMatrixSkiaApplier.h
    A 
Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkiaApplier.cpp
    A Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkiaApplier.h
    A Source/WebCore/platform/graphics/filters/skia/SourceGraphicSkiaApplier.cpp
    A Source/WebCore/platform/graphics/filters/skia/SourceGraphicSkiaApplier.h
    A Source/WebCore/platform/graphics/skia/FilterImageSkia.cpp

  Log Message:
  -----------
  [Skia] Add initial support for accelerated filters
https://bugs.webkit.org/show_bug.cgi?id=272535

Reviewed by Carlos Garcia Campos.

This changeset enables accelerated filters on Skia builds.

Make WebCore::Page report FilterRenderingMode::Accelerated on Skia
builds if accelerated compositing is enabled.

Create Skia filters both in accelerated and software-based code paths,
since Skia is able to handle unaccelerated buffers transparently.

Add Skia-specific code to WebCore::FilterImage. The idea is that Skia
filters acquire a SkCanvas with WebCore::FilterImage::beginRecording(),
render the source image however they want, and finish the operation with
WebCore::FilterImage::finishRecording(). This generates a SkPicture
which is then used to paint on the resulting image buffer.

The memory cost is estimated using SkPicture. It's not an accurate
measure though.

Implement 3 filters as an exercise of usage of this new code:

 * SourceGraphicSkiaApplier, which merely copies the source image
 * FEColorMatrixSkiaApplier, for CSS and SVG filters like saturate(),
   greyscale(), contrast(), and others
 * FEGaussianBlurSkiaApplier, for the blur() filter

More filters will be added in follow up commits, as needed.

* Source/WebCore/page/Page.cpp:
(WebCore::Page::preferredFilterRenderingModes const):
* Source/WebCore/platform/Skia.cmake:
* Source/WebCore/platform/SourcesSkia.txt:
* Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::supportedFilterRenderingModes const):
(WebCore::FEColorMatrix::createAcceleratedApplier const):
* Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::supportedFilterRenderingModes const):
(WebCore::FEGaussianBlur::createAcceleratedApplier const):
* Source/WebCore/platform/graphics/filters/FEGaussianBlur.h:
* Source/WebCore/platform/graphics/filters/FilterImage.cpp:
(WebCore::FilterImage::memoryCost const):
(WebCore::FilterImage::imageBuffer):
* Source/WebCore/platform/graphics/filters/FilterImage.h:
* Source/WebCore/platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::supportedFilterRenderingModes const):
(WebCore::SourceGraphic::createAcceleratedApplier const):
* Source/WebCore/platform/graphics/filters/skia/FEColorMatrixSkiaApplier.cpp: 
Added.
(WebCore::FEColorMatrixSkiaApplier::apply const):
* Source/WebCore/platform/graphics/filters/skia/FEColorMatrixSkiaApplier.h: 
Added.
* Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkiaApplier.cpp: 
Added.
(WebCore::FEGaussianBlurSkiaApplier::apply const):
* Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkiaApplier.h: 
Added.
* Source/WebCore/platform/graphics/filters/skia/SourceGraphicSkiaApplier.cpp: 
Added.
(WebCore::SourceGraphicSkiaApplier::apply const):
* Source/WebCore/platform/graphics/filters/skia/SourceGraphicSkiaApplier.h: 
Added.
* Source/WebCore/platform/graphics/skia/FilterImageSkia.cpp: Added.
(WebCore::FilterImage::beginRecording):
(WebCore::FilterImage::finishRecording):
(WebCore::FilterImage::memoryCostOfSkPicture const):
(WebCore::FilterImage::imageBufferFromSkPicture):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to