Many code, especially GraphicsSurface related code, will be shared between WebCoordinatedSurface and WebKit1 CoordinatedSurface. Therefore, those code should be implemented in CoordinatedSurface.* to prevent from code duplication.
Created attachment 188005 [details] Patch
Comment on attachment 188005 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=188005&action=review > Source/WebCore/ChangeLog:3 > + Coordinated Graphics : Prevent code duplication of CoordinatedSurface Coordinated Graphics: > Source/WebCore/ChangeLog:10 > + This is patch moves CoordinatedSurface implementation that will be shared > + between WebKit1 CoordinatedSurface and WebCoordinatedSurface to > + CoordinatedSurface so that it prevents code duplication. Move some of the duplicated code to CoordinatedSurface. > Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedSurface.cpp:64 > +PassRefPtr<GraphicsSurface> CoordinatedSurface::createGraphicsSurface(const IntSize& size, Flags flags) createWithNewGraphicsSurface > Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedSurface.cpp:84 > + RefPtr<BitmapTextureGL> textureGL = toBitmapTextureGL(texture); > + if (textureGL) { You can't assume that textureMapper is GL based. You should only do this when isBackedByOpenGL returns true.
This code seems to modify 'CoordinatedSurface.cpp/h' files, which don't exist in WebKit anymore but this commit did seems to highlight renaming: https://github.com/WebKit/WebKit/commit/fe9d29899711bb87766fd5cb2b2b4f3bbfead88f So not sure, whether it is needed or not. Appreciate if someone can confirm whether it is needed or not.