[Cairo] Move state stack, CTM, transparency layer operations in GraphicsContextCairo to CairoOperations
Created attachment 326721 [details] Patch
Comment on attachment 326721 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=326721&action=review > Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:56 > +void save(PlatformContextCairo& platformContext) > +{ > + platformContext.save(); > +} > + > +void restore(PlatformContextCairo& platformContext) > +{ > + platformContext.restore(); > +} What's the point of these? They don't use cairo directly, I guess caller could call save restore on platform context, no? Just consistency? > Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:90 > + cairo_paint_with_alpha(cr, platformContext.layers().last()); > + platformContext.layers().removeLast(); We could use takeLast() here.
Comment on attachment 326721 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=326721&action=review >> Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:56 >> +} > > What's the point of these? They don't use cairo directly, I guess caller could call save restore on platform context, no? Just consistency? Yes, it's for consistency. But essentially we don't need to know about the PlatformContextCairo save() and restore() methods in the GraphicsContextCairo file, we can just pass the memory address of the given PlatformContextCairo object and isolate the PlatformContextCairo operations in CairoOperations file. In theory this is a clear-cut approach that basically isolates PlatformContextCairo usage to a single .cpp file, but this doesn't really apply anymore with the unified builds since different .cpp files are now pulled into a single source file compilation. I think it's still possible to exclude specific build targets from the unified build, that might be useful.
Created attachment 326747 [details] Patch for landing
Comment on attachment 326747 [details] Patch for landing Clearing flags on attachment: 326747 Committed r224744: <https://trac.webkit.org/changeset/224744>
All reviewed patches have been landed. Closing bug.
<rdar://problem/35561948>