Changeset 268145 in webkit
- Timestamp:
- Oct 7, 2020 1:13:24 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r268144 r268145 1 2020-10-07 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [GPU Process] Support CanvasRenderingContext2D.drawImage() with HTMLVideoElement 4 https://bugs.webkit.org/show_bug.cgi?id=217339 5 <rdar://problem/69409029> 6 7 Reviewed by Darin Adler. 8 9 Implements support for painting the current video frame into a canvas 2D graphics context. See below for more 10 details. 11 12 * html/HTMLVideoElement.cpp: 13 (WebCore::HTMLVideoElement::paintCurrentFrameInContext): 14 15 Flip this around to call `GraphicsContext::paintFrameForMedia` with the `MediaPlayer`, instead of calling into 16 `MediaPlayer` with the graphics context. See changes below. 17 18 * platform/graphics/GraphicsContext.cpp: 19 (WebCore::GraphicsContext::paintFrameForMedia): 20 * platform/graphics/GraphicsContext.h: 21 22 Add a `paintFrameForMedia` method that takes a `MediaPlayer` representing a video, and paints the current frame 23 of the video into the context. If the graphics context is backed by an platform context (i.e. `m_impl` is 24 `nullptr`), then we simply call through to `MediaPlayer`'s private impl to paint into the context. Otherwise, we 25 forward the call to the `GraphicsContextImpl` (see the changes to `DisplayListRecorder.cpp` below). 26 27 * platform/graphics/GraphicsContextImpl.h: 28 29 Add a new virtual function to paint the current frame of the given `MediaPlayer` into the destination rect. 30 31 * platform/graphics/MediaPlayer.cpp: 32 (WebCore::MediaPlayer::playerPrivate const): 33 (WebCore::MediaPlayer::playerPrivate): 34 (WebCore::MediaPlayer::paintCurrentFrameInContext): Deleted. 35 * platform/graphics/MediaPlayer.h: 36 37 Remove the existing `paintCurrentFrameInContext` method on `MediaPlayer`, which currently takes a graphics 38 context. Instead, move `paintCurrentFrameInContext` to `GraphicsContext`, rename it to `paintFrameForMedia`, and 39 pass it a `MediaPlayer`. Additionally, expose a helper method to get a non-const `MediaPlayerPrivateInterface`, 40 and move both method definitions to the implementation file to avoid style checker errors due to `MediaPlayer` 41 itself being `WEBCORE_EXPORT`-ed. 42 43 * platform/graphics/cairo/GraphicsContextImplCairo.cpp: 44 (WebCore::GraphicsContextImplCairo::paintFrameForMedia): 45 * platform/graphics/cairo/GraphicsContextImplCairo.h: 46 * platform/graphics/displaylists/DisplayList.h: 47 * platform/graphics/displaylists/DisplayListItems.cpp: 48 (WebCore::DisplayList::Item::sizeInBytes): 49 (WebCore::DisplayList::PaintFrameForMedia::create): 50 (WebCore::DisplayList::PaintFrameForMedia::PaintFrameForMedia): 51 (WebCore::DisplayList::PaintFrameForMedia::apply const): 52 (WebCore::DisplayList::operator<<): 53 * platform/graphics/displaylists/DisplayListItems.h: 54 (WebCore::DisplayList::PaintFrameForMedia::destination const): 55 (WebCore::DisplayList::PaintFrameForMedia::identifier const): 56 (WebCore::DisplayList::PaintFrameForMedia::encode const): 57 (WebCore::DisplayList::PaintFrameForMedia::decode): 58 (WebCore::DisplayList::Item::encode const): 59 (WebCore::DisplayList::Item::decode): 60 * platform/graphics/displaylists/DisplayListRecorder.cpp: 61 (WebCore::DisplayList::Recorder::paintFrameForMedia): 62 * platform/graphics/displaylists/DisplayListRecorder.h: 63 64 Add a new display list item, `PaintFrameForMedia`, that paints the current frame of a given `MediaPlayer`. This 65 works by serializing and then deserializing a `MediaPlayerHandle` and destination rect; similar to 66 `PutImageData`, the replayer delegate is responsible for applying this item by mapping the `MediaPlayerHandle` 67 to a concrete `MediaPlayer` instance. 68 69 * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: 70 (Nicosia::CairoOperationRecorder::paintFrameForMedia): 71 * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: 72 * platform/graphics/win/GraphicsContextImplDirect2D.cpp: 73 (WebCore::GraphicsContextImplDirect2D::paintFrameForMedia): 74 * platform/graphics/win/GraphicsContextImplDirect2D.h: 75 * rendering/RenderVideo.cpp: 76 (WebCore::RenderVideo::paintReplaced): 77 1 78 2020-10-07 Aditya Keerthi <akeerthi@apple.com> 2 79 -
trunk/Source/WebCore/html/HTMLVideoElement.cpp
r266728 r268145 298 298 299 299 player->setVisible(true); // Make player visible or it won't draw. 300 player->paintCurrentFrameInContext(context, destRect);300 context.paintFrameForMedia(*player, destRect); 301 301 } 302 302 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r267742 r268145 34 34 #include "ImageBuffer.h" 35 35 #include "IntRect.h" 36 #include "MediaPlayer.h" 37 #include "MediaPlayerPrivate.h" 36 38 #include "RoundedRect.h" 37 39 #include "TextRun.h" … … 1240 1242 1241 1243 #if !USE(CG) 1244 1242 1245 bool GraphicsContext::supportsInternalLinks() const 1243 1246 { … … 1252 1255 { 1253 1256 } 1254 #endif 1255 1256 } 1257 1258 #endif 1259 1260 void GraphicsContext::paintFrameForMedia(MediaPlayer& player, const FloatRect& destination) 1261 { 1262 if (paintingDisabled()) 1263 return; 1264 1265 if (m_impl && m_impl->canPaintFrameForMedia()) { 1266 m_impl->paintFrameForMedia(player, destination); 1267 return; 1268 } 1269 1270 player.playerPrivate()->paintCurrentFrameInContext(*this, destination); 1271 } 1272 1273 } -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r267742 r268145 93 93 class ImageBuffer; 94 94 class IntRect; 95 class MediaPlayer; 95 96 class RoundedRect; 96 97 class GraphicsContextGLOpenGL; … … 516 517 void setContentfulPaintDetected() { m_contenfulPaintDetected = true; } 517 518 bool contenfulPaintDetected() const { return m_contenfulPaintDetected; } 519 520 WEBCORE_EXPORT void paintFrameForMedia(MediaPlayer&, const FloatRect& destination); 518 521 519 522 #if OS(WINDOWS) -
trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h
r267742 r268145 108 108 virtual void clipToImageBuffer(ImageBuffer&, const FloatRect&) = 0; 109 109 virtual void clipToDrawingCommands(const FloatRect& destination, ColorSpace, Function<void(GraphicsContext&)>&& drawingFunction) = 0; 110 virtual void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) = 0; 111 virtual bool canPaintFrameForMedia() const = 0; 110 112 111 113 virtual void applyDeviceScaleFactor(float) = 0; -
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
r268070 r268145 32 32 #include "DeprecatedGlobalSettings.h" 33 33 #include "Document.h" 34 #include "GraphicsContext.h" 34 35 #include "IntRect.h" 35 36 #include "Logging.h" … … 303 304 static MainThreadNeverDestroyed<const AtomString> textPlain("text/plain", AtomString::ConstructFromLiteral); 304 305 return textPlain; 306 } 307 308 const MediaPlayerPrivateInterface* MediaPlayer::playerPrivate() const 309 { 310 return m_private.get(); 311 } 312 313 MediaPlayerPrivateInterface* MediaPlayer::playerPrivate() 314 { 315 return m_private.get(); 305 316 } 306 317 … … 968 979 } 969 980 970 void MediaPlayer::paintCurrentFrameInContext(GraphicsContext& p, const FloatRect& r)971 {972 m_private->paintCurrentFrameInContext(p, r);973 }974 975 981 bool MediaPlayer::copyVideoTextureToPlatformTexture(GraphicsContextGLOpenGL* context, PlatformGLObject texture, GCGLenum target, GCGLint level, GCGLenum internalFormat, GCGLenum format, GCGLenum type, bool premultiplyAlpha, bool flipY) 976 982 { -
trunk/Source/WebCore/platform/graphics/MediaPlayer.h
r268070 r268145 423 423 424 424 void paint(GraphicsContext&, const FloatRect&); 425 void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&);426 425 427 426 // copyVideoTextureToPlatformTexture() is used to do the GPU-GPU textures copy without a readback to system memory. … … 631 630 #endif 632 631 633 const MediaPlayerPrivateInterface* playerPrivate() const { return m_private.get(); } 632 const MediaPlayerPrivateInterface* playerPrivate() const; 633 MediaPlayerPrivateInterface* playerPrivate(); 634 634 635 635 DynamicRangeMode preferredDynamicRangeMode() const { return m_preferredDynamicRangeMode; } -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp
r267742 r268145 433 433 } 434 434 435 void GraphicsContextImplCairo::paintFrameForMedia(MediaPlayer&, const FloatRect&) 436 { 437 // FIXME: Not implemented. 438 } 439 435 440 } // namespace WebCore 436 441 -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h
r267742 r268145 108 108 void clipToImageBuffer(ImageBuffer&, const FloatRect&) override; 109 109 void clipToDrawingCommands(const FloatRect& destination, ColorSpace, Function<void(GraphicsContext&)>&&) override; 110 void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) override; 111 bool canPaintFrameForMedia() const override { return false; } 110 112 111 113 void applyDeviceScaleFactor(float) override; -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.h
r267742 r268145 84 84 FillEllipse, 85 85 PutImageData, 86 PaintFrameForMedia, 86 87 StrokeRect, 87 88 StrokePath, -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
r267858 r268145 30 30 #include "FontCascade.h" 31 31 #include "ImageData.h" 32 #include "MediaPlayer.h" 32 33 #include "SharedBuffer.h" 33 34 #include <wtf/text/TextStream.h> … … 146 147 case ItemType::PutImageData: 147 148 return sizeof(downcast<PutImageData>(item)); 149 case ItemType::PaintFrameForMedia: 150 return sizeof(downcast<PaintFrameForMedia>(item)); 148 151 case ItemType::StrokeRect: 149 152 return sizeof(downcast<StrokeRect>(item)); … … 1216 1219 ts.dumpProperty("destPoint", item.destPoint()); 1217 1220 ts.dumpProperty("destFormat", item.destFormat()); 1221 return ts; 1222 } 1223 1224 Ref<PaintFrameForMedia> PaintFrameForMedia::create(MediaPlayer& player, const FloatRect& destination) 1225 { 1226 return adoptRef(*new PaintFrameForMedia(player, destination)); 1227 } 1228 1229 Ref<PaintFrameForMedia> PaintFrameForMedia::create(MediaPlayerIdentifier identifier, const FloatRect& destination) 1230 { 1231 return adoptRef(*new PaintFrameForMedia(identifier, destination)); 1232 } 1233 1234 PaintFrameForMedia::PaintFrameForMedia(MediaPlayer& player, const FloatRect& destination) 1235 : DrawingItem(ItemType::PaintFrameForMedia) 1236 , m_identifier(player.identifier()) 1237 , m_destination(destination) 1238 { 1239 } 1240 1241 PaintFrameForMedia::PaintFrameForMedia(MediaPlayerIdentifier identifier, const FloatRect& destination) 1242 : DrawingItem(ItemType::PaintFrameForMedia) 1243 , m_identifier(identifier) 1244 , m_destination(destination) 1245 { 1246 } 1247 1248 PaintFrameForMedia::~PaintFrameForMedia() = default; 1249 1250 void PaintFrameForMedia::apply(GraphicsContext&) const 1251 { 1252 // Should be handled by the delegate. 1253 ASSERT_NOT_REACHED(); 1254 } 1255 1256 static TextStream& operator<<(TextStream& ts, const PaintFrameForMedia& item) 1257 { 1258 ts << static_cast<const DrawingItem&>(item); 1259 ts.dumpProperty("destination", item.destination()); 1218 1260 return ts; 1219 1261 } … … 1449 1491 case ItemType::FillEllipse: ts << "fill-ellipse"; break; 1450 1492 case ItemType::PutImageData: ts << "put-image-data"; break; 1493 case ItemType::PaintFrameForMedia: ts << "paint-frame-for-media"; break; 1451 1494 case ItemType::StrokeRect: ts << "stroke-rect"; break; 1452 1495 case ItemType::StrokePath: ts << "stroke-path"; break; … … 1588 1631 ts << downcast<PutImageData>(item); 1589 1632 break; 1633 case ItemType::PaintFrameForMedia: 1634 ts << downcast<PaintFrameForMedia>(item); 1635 break; 1590 1636 case ItemType::StrokeRect: 1591 1637 ts << downcast<StrokeRect>(item); -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
r267782 r268145 34 34 #include "Image.h" 35 35 #include "ImageData.h" 36 #include "MediaPlayerIdentifier.h" 36 37 #include "Pattern.h" 37 38 #include "SharedBuffer.h" … … 45 46 46 47 class ImageData; 48 class MediaPlayer; 47 49 struct ImagePaintingOptions; 48 50 … … 2583 2585 } 2584 2586 2587 class PaintFrameForMedia : public DrawingItem { 2588 public: 2589 static Ref<PaintFrameForMedia> create(MediaPlayer&, const FloatRect& destination); 2590 2591 WEBCORE_EXPORT virtual ~PaintFrameForMedia(); 2592 2593 const FloatRect& destination() const { return m_destination; } 2594 MediaPlayerIdentifier identifier() const { return m_identifier; } 2595 2596 template<class Encoder> void encode(Encoder&) const; 2597 template<class Decoder> static Optional<Ref<PaintFrameForMedia>> decode(Decoder&); 2598 2599 private: 2600 WEBCORE_EXPORT static Ref<PaintFrameForMedia> create(MediaPlayerIdentifier, const FloatRect& destination); 2601 2602 PaintFrameForMedia(MediaPlayer&, const FloatRect& destination); 2603 PaintFrameForMedia(MediaPlayerIdentifier, const FloatRect& destination); 2604 2605 void apply(GraphicsContext&) const override; 2606 2607 MediaPlayerIdentifier m_identifier; 2608 FloatRect m_destination; 2609 }; 2610 2611 template<class Encoder> 2612 void PaintFrameForMedia::encode(Encoder& encoder) const 2613 { 2614 encoder << m_identifier; 2615 encoder << m_destination; 2616 } 2617 2618 template<class Decoder> 2619 Optional<Ref<PaintFrameForMedia>> PaintFrameForMedia::decode(Decoder& decoder) 2620 { 2621 Optional<MediaPlayerIdentifier> identifier; 2622 decoder >> identifier; 2623 if (!identifier) 2624 return WTF::nullopt; 2625 2626 Optional<FloatRect> destination; 2627 decoder >> destination; 2628 if (!destination) 2629 return WTF::nullopt; 2630 2631 return PaintFrameForMedia::create(*identifier, *destination); 2632 } 2633 2585 2634 class StrokeRect : public DrawingItem { 2586 2635 public: … … 2984 3033 encoder << downcast<PutImageData>(*this); 2985 3034 break; 3035 case ItemType::PaintFrameForMedia: 3036 encoder << downcast<PaintFrameForMedia>(*this); 3037 break; 2986 3038 case ItemType::StrokeRect: 2987 3039 encoder << downcast<StrokeRect>(*this); … … 3189 3241 case ItemType::PutImageData: 3190 3242 if (auto item = PutImageData::decode(decoder)) 3243 return static_reference_cast<Item>(WTFMove(*item)); 3244 break; 3245 case ItemType::PaintFrameForMedia: 3246 if (auto item = PaintFrameForMedia::decode(decoder)) 3191 3247 return static_reference_cast<Item>(WTFMove(*item)); 3192 3248 break; … … 3292 3348 SPECIALIZE_TYPE_TRAITS_DISPLAYLIST_ITEM(FillEllipse) 3293 3349 SPECIALIZE_TYPE_TRAITS_DISPLAYLIST_ITEM(PutImageData) 3350 SPECIALIZE_TYPE_TRAITS_DISPLAYLIST_ITEM(PaintFrameForMedia) 3294 3351 SPECIALIZE_TYPE_TRAITS_DISPLAYLIST_ITEM(StrokeRect) 3295 3352 SPECIALIZE_TYPE_TRAITS_DISPLAYLIST_ITEM(StrokePath) … … 3353 3410 WebCore::DisplayList::ItemType::FillEllipse, 3354 3411 WebCore::DisplayList::ItemType::PutImageData, 3412 WebCore::DisplayList::ItemType::PaintFrameForMedia, 3355 3413 WebCore::DisplayList::ItemType::StrokeRect, 3356 3414 WebCore::DisplayList::ItemType::StrokePath, -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp
r267858 r268145 390 390 } 391 391 392 void Recorder::paintFrameForMedia(MediaPlayer& player, const FloatRect& destination) 393 { 394 appendItem(PaintFrameForMedia::create(player, destination)); 395 } 396 392 397 void Recorder::applyDeviceScaleFactor(float deviceScaleFactor) 393 398 { -
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h
r267742 r268145 138 138 void clipToImageBuffer(WebCore::ImageBuffer&, const FloatRect&) override; 139 139 void clipToDrawingCommands(const FloatRect& destination, ColorSpace, Function<void(GraphicsContext&)>&&) override; 140 void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) override; 141 bool canPaintFrameForMedia() const override { return true; } 140 142 141 143 void applyDeviceScaleFactor(float) override; -
trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp
r267742 r268145 1096 1096 } 1097 1097 1098 void CairoOperationRecorder::paintFrameForMedia(MediaPlayer&, const FloatRect&) 1099 { 1100 // FIXME: Not implemented. 1101 } 1102 1098 1103 } // namespace Nicosia -
trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h
r267742 r268145 101 101 void clipToImageBuffer(WebCore::ImageBuffer&, const WebCore::FloatRect&) override; 102 102 void clipToDrawingCommands(const WebCore::FloatRect& destination, WebCore::ColorSpace, Function<void(WebCore::GraphicsContext&)>&&) override; 103 void paintFrameForMedia(WebCore::MediaPlayer&, const WebCore::FloatRect& destination) override; 104 bool canPaintFrameForMedia() const override { return false; } 103 105 104 106 void applyDeviceScaleFactor(float) override; -
trunk/Source/WebCore/platform/graphics/win/GraphicsContextImplDirect2D.cpp
r267742 r268145 442 442 } 443 443 444 void GraphicsContextImplDirect2D::paintFrameForMedia(MediaPlayer&, const FloatRect&) 445 { 446 // FIXME: Not implemented. 447 } 448 444 449 } // namespace WebCore 445 450 -
trunk/Source/WebCore/platform/graphics/win/GraphicsContextImplDirect2D.h
r267742 r268145 105 105 void clipToImageBuffer(ImageBuffer&, const FloatRect&) override; 106 106 void clipToDrawingCommands(const FloatRect& destination, ColorSpace, Function<void(GraphicsContext&)>&&) override; 107 void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) override; 108 bool canPaintFrameForMedia() const override { return false; } 107 109 108 110 void applyDeviceScaleFactor(float) override; -
trunk/Source/WebCore/rendering/RenderVideo.cpp
r265904 r268145 227 227 else if (!videoElement().isFullscreen() || !mediaPlayer->supportsAcceleratedRendering()) { 228 228 if (paintInfo.paintBehavior.contains(PaintBehavior::FlattenCompositingLayers)) 229 mediaPlayer->paintCurrentFrameInContext(context, rect);229 context.paintFrameForMedia(*mediaPlayer, rect); 230 230 else 231 231 mediaPlayer->paint(context, rect); -
trunk/Source/WebKit/ChangeLog
r268136 r268145 1 2020-10-07 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [GPU Process] Support CanvasRenderingContext2D.drawImage() with HTMLVideoElement 4 https://bugs.webkit.org/show_bug.cgi?id=217339 5 <rdar://problem/69409029> 6 7 Reviewed by Darin Adler. 8 9 Implements support for painting the current video frame into a canvas 2D graphics context. See below (and 10 Source/WebCore/ChangeLog) for more details. 11 12 * GPUProcess/graphics/RemoteImageBufferMessageHandlerProxy.h: 13 (WebKit::RemoteImageBufferMessageHandlerProxy::backend): 14 * GPUProcess/graphics/RemoteImageBufferProxy.h: 15 (WebKit::RemoteImageBufferProxy::apply): 16 17 Refactor `apply` so that it treats `PutImageData` and `PaintFrameForMedia` as special cases, and otherwise 18 returns `false` by default. Implement `apply` in the case where the display list item is `PaintFrameForMedia` by 19 using the `MediaPlayerIdentifier` to look up the platform `MediaPlayer` instance, and then calling 20 `GraphicsContext::paintFrameForMedia` with this `MediaPlayer`. 21 22 * GPUProcess/graphics/RemoteRenderingBackendProxy.cpp: 23 (WebKit::RemoteRenderingBackendProxy::gpuConnectionToWebProcess const): 24 * GPUProcess/graphics/RemoteRenderingBackendProxy.h: 25 1 26 2020-10-07 Youenn Fablet <youenn@apple.com> 2 27 -
trunk/Source/WebKit/GPUProcess/graphics/RemoteImageBufferMessageHandlerProxy.h
r258253 r268145 60 60 void commitFlushContext(ImageBufferFlushIdentifier); 61 61 62 RemoteRenderingBackendProxy& backend() { return m_remoteRenderingBackendProxy; } 63 62 64 private: 63 65 RemoteRenderingBackendProxy& m_remoteRenderingBackendProxy; -
trunk/Source/WebKit/GPUProcess/graphics/RemoteImageBufferProxy.h
r267772 r268145 28 28 #if ENABLE(GPU_PROCESS) 29 29 30 #include "GPUConnectionToWebProcess.h" 30 31 #include "RemoteImageBufferMessageHandlerProxy.h" 31 32 #include <WebCore/ConcreteImageBuffer.h> … … 85 86 } 86 87 87 bool apply(WebCore::DisplayList::Item& item, WebCore::GraphicsContext& ) override88 bool apply(WebCore::DisplayList::Item& item, WebCore::GraphicsContext& context) override 88 89 { 89 if (item.type() != WebCore::DisplayList::ItemType::PutImageData) 90 return false; 90 if (item.type() == WebCore::DisplayList::ItemType::PutImageData) { 91 auto& putImageDataItem = static_cast<WebCore::DisplayList::PutImageData&>(item); 92 putImageData(putImageDataItem.inputFormat(), putImageDataItem.imageData(), putImageDataItem.srcRect(), putImageDataItem.destPoint(), putImageDataItem.destFormat()); 93 return true; 94 } 91 95 92 auto& putImageDataItem = static_cast<WebCore::DisplayList::PutImageData&>(item); 93 putImageData(putImageDataItem.inputFormat(), putImageDataItem.imageData(), putImageDataItem.srcRect(), putImageDataItem.destPoint(), putImageDataItem.destFormat()); 94 return true; 96 if (item.type() == WebCore::DisplayList::ItemType::PaintFrameForMedia) { 97 apply(static_cast<WebCore::DisplayList::PaintFrameForMedia&>(item), context); 98 return true; 99 } 100 101 return false; 102 } 103 104 void apply(WebCore::DisplayList::PaintFrameForMedia& item, WebCore::GraphicsContext& context) 105 { 106 auto process = backend().gpuConnectionToWebProcess(); 107 if (!process) 108 return; 109 110 auto playerProxy = process->remoteMediaPlayerManagerProxy().getProxy(item.identifier()); 111 if (!playerProxy) 112 return; 113 114 auto player = playerProxy->mediaPlayer(); 115 if (!player) 116 return; 117 118 context.paintFrameForMedia(*player, item.destination()); 95 119 } 96 120 }; -
trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackendProxy.cpp
r258253 r268145 122 122 } 123 123 124 GPUConnectionToWebProcess* RemoteRenderingBackendProxy::gpuConnectionToWebProcess() const 125 { 126 return m_gpuConnectionToWebProcess.get(); 127 } 128 124 129 } // namespace WebKit 125 130 -
trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackendProxy.h
r258253 r268145 61 61 62 62 RenderingBackendIdentifier renderingBackendIdentifier() const { return m_renderingBackendIdentifier; } 63 GPUConnectionToWebProcess* gpuConnectionToWebProcess() const; 63 64 64 65 private:
Note: See TracChangeset
for help on using the changeset viewer.