12020-11-01 Said Abou-Hallawa <said@apple.com>
2
3 [GPU Process] Control the life cycle of the platform image by a new class named NativeImage
4 https://bugs.webkit.org/show_bug.cgi?id=218427
5
6 Reviewed by NOBODY (OOPS!).
7
8 * Headers.cmake:
9 * Sources.txt:
10 * WebCore.xcodeproj/project.pbxproj:
11 * html/HTMLVideoElement.cpp:
12 (WebCore::HTMLVideoElement::nativeImageForCurrentTime):
13 * html/HTMLVideoElement.h:
14 * html/canvas/CanvasRenderingContext2DBase.cpp:
15 (WebCore::CanvasRenderingContext2DBase::drawImage):
16 * page/mac/TextIndicatorWindow.mm:
17 (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
18 (createContentCrossfadeAnimation):
19 * platform/graphics/BitmapImage.cpp:
20 (WebCore::BitmapImage::BitmapImage):
21 (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded):
22 (WebCore::BitmapImage::nativeImage):
23 (WebCore::BitmapImage::nativeImageForCurrentFrame):
24 (WebCore::BitmapImage::preTransformedNativeImageForCurrentFrame):
25 (WebCore::BitmapImage::nativeImageOfSize):
26 (WebCore::BitmapImage::framesNativeImages):
27 (WebCore::drawNativeImage):
28 (WebCore::BitmapImage::draw):
29 * platform/graphics/BitmapImage.h:
30 * platform/graphics/ConcreteImageBuffer.h:
31 * platform/graphics/GraphicsContext.cpp:
32 (WebCore::GraphicsContext::drawNativeImage):
33 * platform/graphics/GraphicsContext.h:
34 (WebCore::GraphicsContext::drawNativeImage):
35 (WebCore::GraphicsContext::drawPlatformImage):
36 * platform/graphics/GraphicsContextGLImageExtractor.h:
37 * platform/graphics/GraphicsContextImpl.h:
38 * platform/graphics/Icon.h:
39 * platform/graphics/Image.h:
40 (WebCore::Image::nativeImage):
41 (WebCore::Image::nativeImageForCurrentFrame):
42 (WebCore::Image::preTransformedNativeImageForCurrentFrame):
43 (WebCore::Image::nativeImageOfSize):
44 * platform/graphics/ImageBackingStore.h:
45 * platform/graphics/ImageBuffer.cpp:
46 (WebCore::ImageBuffer::sinkIntoNativeImage):
47 * platform/graphics/ImageBuffer.h:
48 * platform/graphics/ImageBufferBackend.cpp:
49 (WebCore::ImageBufferBackend::sinkIntoNativeImage):
50 * platform/graphics/ImageBufferBackend.h:
51 * platform/graphics/ImageDecoder.h:
52 * platform/graphics/ImageFrame.cpp:
53 (WebCore::ImageFrame::clearImage):
54 (WebCore::ImageFrame::singlePixelSolidColor const):
55 * platform/graphics/ImageFrame.h:
56 (WebCore::ImageFrame::nativeImage const):
57 * platform/graphics/ImageSource.cpp:
58 (WebCore::ImageSource::ImageSource):
59 (WebCore::ImageSource::setNativeImage):
60 (WebCore::ImageSource::cacheMetadataAtIndex):
61 (WebCore::ImageSource::cachePlatformImageAtIndex):
62 (WebCore::ImageSource::cachePlatformImageAtIndexAsync):
63 (WebCore::ImageSource::startAsyncDecodingQueue):
64 (WebCore::ImageSource::frameAtIndexCacheIfNeeded):
65 (WebCore::ImageSource::createFrameImageAtIndex):
66 (WebCore::ImageSource::frameImageAtIndex):
67 (WebCore::ImageSource::frameImageAtIndexCacheIfNeeded):
68 (WebCore::ImageSource::cacheNativeImageAtIndex): Deleted.
69 (WebCore::ImageSource::cacheNativeImageAtIndexAsync): Deleted.
70 * platform/graphics/ImageSource.h:
71 (WebCore::ImageSource::create):
72 * platform/graphics/MediaPlayer.cpp:
73 (WebCore::MediaPlayer::nativeImageForCurrentTime):
74 * platform/graphics/MediaPlayer.h:
75 * platform/graphics/MediaPlayerPrivate.h:
76 (WebCore::MediaPlayerPrivateInterface::nativeImageForCurrentTime):
77 * platform/graphics/NativeImage.cpp: Copied from Source/WebCore/platform/graphics/NativeImagePtr.h.
78 (WebCore::NativeImage::create):
79 (WebCore::NativeImage::NativeImage):
80 (WebCore::NativeImage::~NativeImage):
81 * platform/graphics/NativeImage.h:
82 (WebCore::NativeImage::renderingResourceIdentifier const):
83 (WebCore::NativeImage::isNull const):
84 (WebCore::NativeImage::platformImage):
85 (WebCore::NativeImage::platformImage const):
86 (WebCore::NativeImage::size const):
87 (WebCore::NativeImage::setObserver):
88 * platform/graphics/PlatformImagePtr.h: Renamed from Source/WebCore/platform/graphics/NativeImagePtr.h.
89 * platform/graphics/VideoLayerManager.h:
90 * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
91 * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
92 (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
93 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
94 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
95 (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage):
96 (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
97 (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
98 (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
99 (WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
100 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
101 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
102 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::nativeImageForCurrentTime):
103 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage):
104 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
105 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
106 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
107 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
108 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
109 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage):
110 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
111 * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h:
112 * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
113 (WebCore::VideoLayerManagerObjC::setVideoFullscreenLayer):
114 (WebCore::VideoLayerManagerObjC::updateVideoFullscreenInlineImage):
115 * platform/graphics/ca/GraphicsLayerCA.cpp:
116 (WebCore::GraphicsLayerCA::updateContentsImage):
117 * platform/graphics/ca/GraphicsLayerCA.h:
118 * platform/graphics/cairo/GraphicsContextCairo.cpp:
119 (WebCore::GraphicsContext::drawPlatformImage):
120 (WebCore::GraphicsContext::platformDrawNativeImage): Deleted.
121 * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
122 (WebCore::GraphicsContextImplCairo::drawNativeImage):
123 (WebCore::GraphicsContextImplCairo::drawPlatformImage):
124 (WebCore::GraphicsContextImplCairo::drawPattern):
125 (WebCore::GraphicsContextImplCairo::clipToImageBuffer):
126 * platform/graphics/cairo/GraphicsContextImplCairo.h:
127 * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp:
128 (WebCore::ImageBufferCairoSurfaceBackend::copyNativeImage const):
129 (WebCore::ImageBufferCairoSurfaceBackend::cairoSurfaceCoerceToImage const):
130 * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.h:
131 * platform/graphics/cairo/NativeImageCairo.cpp:
132 (WebCore::NativeImage::size):
133 (WebCore::NativeImage::hasAlpha const):
134 (WebCore::NativeImage::singlePixelSolidColor const):
135 (WebCore::NativeImage::clearSubimages):
136 (WebCore::nativeImageSize): Deleted.
137 (WebCore::nativeImageHasAlpha): Deleted.
138 (WebCore::nativeImageSinglePixelSolidColor): Deleted.
139 (WebCore::drawNativeImage): Deleted.
140 (WebCore::clearNativeImageSubimages): Deleted.
141 * platform/graphics/cg/GraphicsContextCG.cpp:
142 (WebCore::GraphicsContext::drawPlatformImage):
143 (WebCore::GraphicsContext::drawPattern):
144 (WebCore::GraphicsContext::clipToImageBuffer):
145 (WebCore::GraphicsContext::platformDrawNativeImage): Deleted.
146 * platform/graphics/cg/GraphicsContextGLCG.cpp:
147 (WebCore::GraphicsContextGLImageExtractor::extractImage):
148 (WebCore::GraphicsContextGLOpenGL::paintToCanvas):
149 * platform/graphics/cg/ImageBufferCGBackend.cpp:
150 (WebCore::createCroppedImageIfNecessary):
151 (WebCore::createBitmapImageAfterScalingIfNeeded):
152 (WebCore::ImageBufferCGBackend::copyImage const):
153 (WebCore::ImageBufferCGBackend::draw):
154 (WebCore::ImageBufferCGBackend::toCFData const):
155 * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp:
156 (WebCore::ImageBufferCGBitmapBackend::copyNativeImage const):
157 * platform/graphics/cg/ImageBufferCGBitmapBackend.h:
158 * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
159 (WebCore::ImageBufferIOSurfaceBackend::copyNativeImage const):
160 (WebCore::ImageBufferIOSurfaceBackend::sinkIntoNativeImage):
161 (WebCore::ImageBufferIOSurfaceBackend::drawConsuming):
162 * platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
163 * platform/graphics/cg/ImageDecoderCG.cpp:
164 (WebCore::ImageDecoderCG::createFrameImageAtIndex):
165 * platform/graphics/cg/ImageDecoderCG.h:
166 * platform/graphics/cg/NativeImageCG.cpp:
167 (WebCore::NativeImage::size):
168 (WebCore::NativeImage::hasAlpha const):
169 (WebCore::NativeImage::singlePixelSolidColor const):
170 (WebCore::NativeImage::clearSubimages):
171 (WebCore::nativeImageSize): Deleted.
172 (WebCore::nativeImageHasAlpha): Deleted.
173 (WebCore::nativeImageSinglePixelSolidColor): Deleted.
174 (WebCore::clearNativeImageSubimages): Deleted.
175 * platform/graphics/cg/PatternCG.cpp:
176 (WebCore::Pattern::createPlatformPattern const):
177 * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
178 (WebCore::FilterEffectRendererCoreImage::imageForSourceGraphic):
179 * platform/graphics/displaylists/DisplayList.h:
180 * platform/graphics/displaylists/DisplayListItems.cpp:
181 (WebCore::DisplayList::Item::sizeInBytes):
182 (WebCore::DisplayList::DrawNativeImage::DrawNativeImage):
183 (WebCore::DisplayList::DrawNativeImage::apply const):
184 (WebCore::DisplayList::operator<<):
185 (WebCore::DisplayList::DrawPlatformImage::DrawPlatformImage):
186 (WebCore::DisplayList::DrawPlatformImage::apply const):
187 * platform/graphics/displaylists/DisplayListItems.h:
188 (WebCore::DisplayList::DrawNativeImage::create):
189 (WebCore::DisplayList::DrawNativeImage::renderingResourceIdentifier const):
190 (WebCore::DisplayList::DrawNativeImage::imageSize const):
191 (WebCore::DisplayList::DrawNativeImage::options const):
192 (WebCore::DisplayList::DrawNativeImage::encode const):
193 (WebCore::DisplayList::DrawNativeImage::decode):
194 (WebCore::DisplayList::DrawPlatformImage::create):
195 (WebCore::DisplayList::DrawPlatformImage::source const):
196 (WebCore::DisplayList::DrawPlatformImage::destinationRect const):
197 (WebCore::DisplayList::DrawPlatformImage::encode const):
198 (WebCore::DisplayList::DrawPlatformImage::decode):
199 (WebCore::DisplayList::Item::encode const):
200 (WebCore::DisplayList::Item::decode):
201 * platform/graphics/displaylists/DisplayListRecorder.cpp:
202 (WebCore::DisplayList::Recorder::drawNativeImage):
203 (WebCore::DisplayList::Recorder::drawPlatformImage):
204 * platform/graphics/displaylists/DisplayListRecorder.h:
205 (WebCore::DisplayList::Recorder::Delegate::lockRemoteNativeImage):
206 * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
207 (WebCore::ImageDecoderGStreamer::createFrameImageAtIndex):
208 * platform/graphics/gstreamer/ImageDecoderGStreamer.h:
209 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
210 (WebCore::MediaPlayerPrivateGStreamer::nativeImageForCurrentTime):
211 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
212 * platform/graphics/ios/IconIOS.mm:
213 (WebCore::Icon::Icon):
214 (WebCore::Icon::createIconForImage):
215 (WebCore::Icon::paint):
216 * platform/graphics/mac/ImageMac.mm:
217 (WebCore::BitmapImage::tiffRepresentation):
218 * platform/graphics/nicosia/NicosiaImageBufferPipe.cpp:
219 (Nicosia::NicosiaImageBufferPipeSource::handle):
220 * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
221 (Nicosia::CairoOperationRecorder::drawNativeImage):
222 (Nicosia::CairoOperationRecorder::drawPlatformImage):
223 (Nicosia::CairoOperationRecorder::drawPattern):
224 (Nicosia::CairoOperationRecorder::clipToImageBuffer):
225 * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
226 * platform/graphics/texmap/BitmapTextureGL.cpp:
227 (WebCore::BitmapTextureGL::updateContents):
228 * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
229 (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
230 (WebCore::GraphicsLayerTextureMapper::setContentsToImage):
231 * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
232 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
233 (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
234 (WebCore::CoordinatedGraphicsLayer::setContentsToImage):
235 (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
236 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
237 * platform/graphics/win/GraphicsContextDirect2D.cpp:
238 (WebCore::GraphicsContext::drawPlatformImage):
239 (WebCore::GraphicsContext::platformDrawNativeImage): Deleted.
240 * platform/graphics/win/GraphicsContextImplDirect2D.cpp:
241 (WebCore::GraphicsContextImplDirect2D::drawNativeImage):
242 (WebCore::GraphicsContextImplDirect2D::drawPlatformImage):
243 * platform/graphics/win/GraphicsContextImplDirect2D.h:
244 * platform/graphics/win/ImageBufferDirect2DBackend.cpp:
245 (WebCore::ImageBufferDirect2DBackend::create):
246 (WebCore::ImageBufferDirect2DBackend::ImageBufferDirect2DBackend):
247 (WebCore::ImageBufferDirect2DBackend::copyNativeImage const):
248 (WebCore::createCroppedImageIfNecessary):
249 (WebCore::ImageBufferDirect2DBackend::copyImage const):
250 (WebCore::ImageBufferDirect2DBackend::sinkIntoImage):
251 (WebCore::ImageBufferDirect2DBackend::compatibleBitmap):
252 * platform/graphics/win/ImageBufferDirect2DBackend.h:
253 * platform/graphics/win/ImageCGWin.cpp:
254 (WebCore::BitmapImage::drawFrameMatchingSourceSize):
255 * platform/graphics/win/ImageCairoWin.cpp:
256 (WebCore::BitmapImage::drawFrameMatchingSourceSize):
257 * platform/graphics/win/ImageDecoderDirect2D.cpp:
258 (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex):
259 * platform/graphics/win/ImageDecoderDirect2D.h:
260 * platform/graphics/win/NativeImageDirect2D.cpp:
261 (WebCore::NativeImage::size):
262 (WebCore::NativeImage::hasAlpha const):
263 (WebCore::NativeImage::singlePixelSolidColor const):
264 (WebCore::NativeImage::clearSubimages):
265 (WebCore::nativeImageSize): Deleted.
266 (WebCore::nativeImageHasAlpha): Deleted.
267 (WebCore::nativeImageSinglePixelSolidColor): Deleted.
268 (WebCore::drawNativeImage): Deleted.
269 (WebCore::clearNativeImageSubimages): Deleted.
270 * platform/image-decoders/ScalableImageDecoder.cpp:
271 (WebCore::ScalableImageDecoder::createFrameImageAtIndex):
272 * platform/image-decoders/ScalableImageDecoder.h:
273 * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp:
274 (WebCore::ImageBackingStore::image const):
275 * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
276 (WebCore::DisplayCaptureSourceCocoa::emitFrame):
277 * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
278 * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
279 (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
280 * platform/win/DragImageCGWin.cpp:
281 (WebCore::createDragImageFromImage):
282 * rendering/RenderThemeIOS.mm:
283 (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
284 * svg/graphics/SVGImage.cpp:
285 (WebCore::SVGImage::nativeImageForCurrentFrame):
286 (WebCore::SVGImage::nativeImage):
287 * svg/graphics/SVGImage.h:
288 * svg/graphics/SVGImageForContainer.cpp:
289 (WebCore::SVGImageForContainer::nativeImageForCurrentFrame):
290 * svg/graphics/SVGImageForContainer.h:
291