[webkit-changes] [WebKit/WebKit] 832bcc: [Skia] Make sure the Skia GL context is current wh...

Carlos Garcia Campos noreply at github.com
Wed Feb 28 00:18:32 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 832bcc5229f97a3f10f2387c9b9da94723ce9834
      https://github.com/WebKit/WebKit/commit/832bcc5229f97a3f10f2387c9b9da94723ce9834
  Author: Carlos Garcia Campos <cgarcia at igalia.com>
  Date:   2024-02-28 (Wed, 28 Feb 2024)

  Changed paths:
    M Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
    M Source/WebCore/platform/graphics/skia/GraphicsContextSkia.h
    M Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp
    M Source/WebCore/platform/graphics/skia/ImageBufferSkiaSurfaceBackend.cpp
    M Source/WebCore/platform/graphics/skia/ImageBufferSkiaSurfaceBackend.h
    M Source/WebCore/platform/graphics/skia/ImageBufferSkiaUnacceleratedBackend.cpp
    M Source/WebCore/platform/graphics/skia/PathSkia.cpp
    M Source/WebCore/platform/graphics/skia/ShareableBitmapSkia.cpp
    M Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayerSkia.cpp

  Log Message:
  -----------
  [Skia] Make sure the Skia GL context is current when calling SkCanvas draw operations for 2D canvas
https://bugs.webkit.org/show_bug.cgi?id=269984

Reviewed by Nikolas Zimmermann.

When rendering layer contents, we make the Skia GL context current
before rendering the layer contents and it remains current, but in the
case of 2D canvas, we can't make sure the context is current when the
draw operations are called. This is causing rendering issues in some
cases that only happen with the GL renderer. This patch adds RenderingMode
and RenderingPurpose parameters to GraphicsContextSkia, and a helper
function makeGLContextCurrentIfNeeded() that makes the Skia GL context
current when the RenderingMode is Accelerated and RenderingPurpose is Canvas.

* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContextSkia::GraphicsContextSkia):
(WebCore::GraphicsContextSkia::makeGLContextCurrentIfNeeded):
(WebCore::GraphicsContextSkia::drawRect):
(WebCore::GraphicsContextSkia::drawNativeImageInternal):
(WebCore::GraphicsContextSkia::drawLine):
(WebCore::GraphicsContextSkia::drawEllipse):
(WebCore::GraphicsContextSkia::fillPath):
(WebCore::GraphicsContextSkia::strokePath):
(WebCore::GraphicsContextSkia::fillRect):
(WebCore::GraphicsContextSkia::beginTransparencyLayer):
(WebCore::GraphicsContextSkia::endTransparencyLayer):
(WebCore::GraphicsContextSkia::clearRect):
(WebCore::GraphicsContextSkia::strokeRect):
(WebCore::GraphicsContextSkia::fillRoundedRectImpl):
(WebCore::GraphicsContextSkia::fillRectWithRoundedHole):
(WebCore::GraphicsContextSkia::drawPattern):
(WebCore::GraphicsContextSkia::renderingMode const): Deleted.
* Source/WebCore/platform/graphics/skia/GraphicsContextSkia.h:
* Source/WebCore/platform/graphics/skia/ImageBufferSkiaAcceleratedBackend.cpp:
(WebCore::ImageBufferSkiaAcceleratedBackend::ImageBufferSkiaAcceleratedBackend):
* Source/WebCore/platform/graphics/skia/ImageBufferSkiaSurfaceBackend.cpp:
(WebCore::ImageBufferSkiaSurfaceBackend::ImageBufferSkiaSurfaceBackend):
* Source/WebCore/platform/graphics/skia/ImageBufferSkiaSurfaceBackend.h:
* Source/WebCore/platform/graphics/skia/ImageBufferSkiaUnacceleratedBackend.cpp:
(WebCore::ImageBufferSkiaUnacceleratedBackend::ImageBufferSkiaUnacceleratedBackend):
* Source/WebCore/platform/graphics/skia/PathSkia.cpp:
(WebCore::PathSkia::strokeContains const):
(WebCore::PathSkia::strokeBoundingRect const):
* Source/WebCore/platform/graphics/skia/ShareableBitmapSkia.cpp:
(WebCore::ShareableBitmap::createGraphicsContext):
* Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayerSkia.cpp:
(WebCore::CoordinatedGraphicsLayer::paintTile):
(WebCore::CoordinatedGraphicsLayer::paintImage):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list