Create RIAA class for GraphicsContext::save() and restore()
Created attachment 90354 [details] Patch
Comment on attachment 90354 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=90354&action=review Looks great. > Source/WebCore/platform/graphics/GraphicsContext.h:556 > + class GraphicsContextStateSaver { Kinda a mouth-full, but I don't have better. > Source/WebCore/platform/graphics/GraphicsContext.h:560 > + : m_context(context) > + , m_saveAndRestore(saveAndRestore) I think we technically indent these on level (differnet from how xcode does things). > Source/WebCore/platform/graphics/GraphicsContext.h:576 > + ASSERT(!m_saveAndRestore); > + m_context.save(); > + m_saveAndRestore = true; We could make this a counter instead. Not sure how useful that would be. > Source/WebCore/rendering/RenderBoxModelObject.cpp:638 > + GraphicsContextStateSaver clipToBorderStateSaver(*context, clipToBorderRadius); > + if (clipToBorderRadius) { Oh, that's so sexy. > Source/WebCore/rendering/RenderBoxModelObject.cpp:1525 > + ++outerBorderTopWidth; > + ++outerBorderBottomWidth; > + ++outerBorderLeftWidth; > + ++outerBorderRightWidth; Bleh. (For another patch. :) > Source/WebCore/rendering/RenderBoxModelObject.cpp:1553 > + GraphicsContextStateSaver graphicsStateSaver(*graphicsContext); You call it "stateSaver" other places.
Comment on attachment 90354 [details] Patch Landed in http://trac.webkit.org/changeset/84463 Will keep bug open for more usage.
Created attachment 90490 [details] Patch
Comment on attachment 90490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=90490&action=review LGTM. > Source/WebCore/rendering/RenderFileUploadControl.cpp:212 > + GraphicsContextStateSaver stateSaver(*paintInfo.context, false); I think we should turn this bool into an Enum at some point.
http://trac.webkit.org/changeset/84504
http://trac.webkit.org/changeset/84504 might have broken GTK Linux 32-bit Release