[webkit-changes] [WebKit/WebKit] 165006: Implement ImageBufferCGPDFDocumentBackend

Said Abou-Hallawa noreply at github.com
Tue Dec 10 18:03:33 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1650060029d11c2236ed8cd004db04c55a9150ab
      https://github.com/WebKit/WebKit/commit/1650060029d11c2236ed8cd004db04c55a9150ab
  Author: Said Abou-Hallawa <said at apple.com>
  Date:   2024-12-10 (Tue, 10 Dec 2024)

  Changed paths:
    M Source/WebCore/SourcesCocoa.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/platform/graphics/BifurcatedGraphicsContext.cpp
    M Source/WebCore/platform/graphics/BifurcatedGraphicsContext.h
    M Source/WebCore/platform/graphics/GraphicsContext.h
    M Source/WebCore/platform/graphics/ImageBuffer.cpp
    M Source/WebCore/platform/graphics/ImageBuffer.h
    M Source/WebCore/platform/graphics/ImageBufferBackend.cpp
    M Source/WebCore/platform/graphics/ImageBufferBackend.h
    M Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
    M Source/WebCore/platform/graphics/cg/GraphicsContextCG.h
    M Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp
    M Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.h
    M Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.cpp
    A Source/WebCore/platform/graphics/cg/ImageBufferCGPDFDocumentBackend.cpp
    A Source/WebCore/platform/graphics/cg/ImageBufferCGPDFDocumentBackend.h
    M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  Implement ImageBufferCGPDFDocumentBackend
https://bugs.webkit.org/show_bug.cgi?id=284211
rdar://141078672

Reviewed by Simon Fraser.

This backend will be used to snapshotting the page into PDFDocument. It will be
used later by GPUProcess to do the snapshotting of the main frame remotely.

* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/BifurcatedGraphicsContext.cpp:
(WebCore::BifurcatedGraphicsContext::beginPage):
(WebCore::BifurcatedGraphicsContext::endPage):
* Source/WebCore/platform/graphics/BifurcatedGraphicsContext.h:
* Source/WebCore/platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::beginPage):
(WebCore::GraphicsContext::endPage):
* Source/WebCore/platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
(WebCore::ImageBuffer::sinkToPDFDocument):
* Source/WebCore/platform/graphics/ImageBuffer.h:
* Source/WebCore/platform/graphics/ImageBufferBackend.cpp:
(WebCore::ImageBufferBackend::sinkToPDFDocument):
* Source/WebCore/platform/graphics/ImageBufferBackend.h:
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::beginPage):
(WebCore::GraphicsContextCG::endPage):
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.h:
* Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp:
(WebCore::ImageBufferCGBackend::ImageBufferCGBackend):
* Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.h:
* Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.cpp:
(WebCore::ImageBufferCGBitmapBackend::ImageBufferCGBitmapBackend):
* Source/WebCore/platform/graphics/cg/ImageBufferCGPDFDocumentBackend.cpp: Added.
(WebCore::ImageBufferCGPDFDocumentBackend::calculateMemoryCost):
(WebCore::ImageBufferCGPDFDocumentBackend::create):
(WebCore::ImageBufferCGPDFDocumentBackend::ImageBufferCGPDFDocumentBackend):
(WebCore::ImageBufferCGPDFDocumentBackend::context):
(WebCore::ImageBufferCGPDFDocumentBackend::sinkToPDFDocument):
(WebCore::ImageBufferCGPDFDocumentBackend::debugDescription const):
* Source/WebCore/platform/graphics/cg/ImageBufferCGPDFDocumentBackend.h: Added.
(WebCore::ImageBufferCGPDFDocumentBackend::canMapBackingStore const):
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::pdfSnapshotAtSize):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::drawToPDF):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::drawToPDFiOS):

Canonical link: https://commits.webkit.org/287644@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