WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 58807
Create RIAA class for GraphicsContext::save() and restore()
https://bugs.webkit.org/show_bug.cgi?id=58807
Summary
Create RIAA class for GraphicsContext::save() and restore()
Simon Fraser (smfr)
Reported
2011-04-18 12:12:15 PDT
Create RIAA class for GraphicsContext::save() and restore()
Attachments
Patch
(27.90 KB, text/plain)
2011-04-20 09:59 PDT
,
Simon Fraser (smfr)
no flags
Details
Patch
(81.76 KB, patch)
2011-04-20 21:47 PDT
,
Simon Fraser (smfr)
eric
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2011-04-20 09:59:34 PDT
Created
attachment 90354
[details]
Patch
Eric Seidel (no email)
Comment 2
2011-04-20 10:31:50 PDT
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.
Simon Fraser (smfr)
Comment 3
2011-04-20 20:42:19 PDT
Comment on
attachment 90354
[details]
Patch Landed in
http://trac.webkit.org/changeset/84463
Will keep bug open for more usage.
Simon Fraser (smfr)
Comment 4
2011-04-20 21:47:12 PDT
Created
attachment 90490
[details]
Patch
Eric Seidel (no email)
Comment 5
2011-04-20 22:06:14 PDT
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.
Simon Fraser (smfr)
Comment 6
2011-04-21 08:56:18 PDT
http://trac.webkit.org/changeset/84504
WebKit Review Bot
Comment 7
2011-04-21 10:45:57 PDT
http://trac.webkit.org/changeset/84504
might have broken GTK Linux 32-bit Release
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug