Changeset 283331 in webkit
- Timestamp:
- Sep 30, 2021, 1:21:45 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/displaylists/DisplayListRecorder.cpp (modified) (1 diff)
-
rendering/RenderThemeCocoa.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r283322 r283331 1 2021-09-30 Devin Rousso <drousso@apple.com> 2 3 [GPU Process] support rendering Apple Pay buttons 4 https://bugs.webkit.org/show_bug.cgi?id=230648 5 <rdar://problem/72061985> 6 7 Reviewed by Tim Horton. 8 9 * rendering/RenderThemeCocoa.mm: 10 (WebCore::RenderThemeCocoa::paintApplePayButton): 11 Instead of drawing directly into the `GraphicsContext::platformContext` (which will not be 12 valid in the WebProcess when DOM rendering happens in the GPUProcess), first draw into a 13 temporary `ImageBuffer` and then consume it to draw into the actual/used `GraphicsContext`. 14 While it is possible to create a dedicated display list item for this, we don't want to do 15 that because `PKDrawApplePayButtonWithCornerRadius` involves dealing with PDFs, which are 16 not as secure as we'd like for use in the GPUProcess. 17 1 18 2021-09-30 Chris Dumez <cdumez@apple.com> 2 19 -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp
r283273 r283331 278 278 AffineTransform Recorder::getCTM(GraphicsContext::IncludeDeviceScale) const 279 279 { 280 // FIXME: Respect the given value of IncludeDeviceScale.280 // FIXME: <https://webkit.org/b/230647> ([GPU Process] add support for `IncludeDeviceScale` inside `DisplayList::Recorder::getCTM`) 281 281 return currentState().ctm; 282 282 } -
trunk/Source/WebCore/rendering/RenderThemeCocoa.mm
r278618 r283331 29 29 #import "GraphicsContextCG.h" 30 30 #import "HTMLInputElement.h" 31 #import "ImageBuffer.h" 31 32 #import "RenderText.h" 32 33 #import "UserAgentScripts.h" … … 152 153 bool RenderThemeCocoa::paintApplePayButton(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& paintRect) 153 154 { 154 GraphicsContextStateSaver stateSaver(paintInfo.context()); 155 156 paintInfo.context().setShouldSmoothFonts(true); 157 paintInfo.context().scale(FloatSize(1, -1)); 155 auto& destinationContext = paintInfo.context(); 156 157 auto imageBuffer = ImageBuffer::createCompatibleBuffer(paintRect.size(), destinationContext); 158 if (!imageBuffer) 159 return false; 158 160 159 161 auto& style = renderer.style(); … … 169 171 }); 170 172 171 PKDrawApplePayButtonWithCornerRadius(paintInfo.context().platformContext(), CGRectMake(paintRect.x(), -paintRect.maxY(), paintRect.width(), paintRect.height()), 1.0, largestCornerRadius, toPKPaymentButtonType(style.applePayButtonType()), toPKPaymentButtonStyle(style.applePayButtonStyle()), style.computedLocale()); 173 auto& imageContext = imageBuffer->context(); 174 imageContext.setShouldSmoothFonts(true); 175 imageContext.setShouldSubpixelQuantizeFonts(false); 176 imageContext.scale(FloatSize(1, -1)); 177 PKDrawApplePayButtonWithCornerRadius(imageContext.platformContext(), CGRectMake(0, -paintRect.height(), paintRect.width(), paintRect.height()), 1.0, largestCornerRadius, toPKPaymentButtonType(style.applePayButtonType()), toPKPaymentButtonStyle(style.applePayButtonStyle()), style.computedLocale()); 178 179 destinationContext.drawConsumingImageBuffer(WTFMove(imageBuffer), paintRect); 172 180 return false; 173 181 }
Note:
See TracChangeset
for help on using the changeset viewer.