Closed
Bug 290432
Opened 19 years ago
Closed 19 years ago
Add push/pop translation functions to nsIRenderingContext
Categories
(Core Graveyard :: GFX, defect)
Core Graveyard
GFX
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: roc, Assigned: roc)
References
Details
Attachments
(1 file, 1 obsolete file)
10.56 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
asa
:
approval1.8b2+
|
Details | Diff | Splinter Review |
In a couple of places frames need to save and restore the current translation in the rendering context while they paint a child. We don't use PushState/PopState because those do a lot more work than we really need to do. We can't just apply a negative translation at the end because roundoff errors can accumulate. Instead we save and restore part of the translation matrix. This causes problems for Cairo since Cairo doesn't have a translation matrix; what actually happens is that it conses up a fake one, and when frames poke the translation matrix to restore the old translation, that has no effect.
Assignee | ||
Comment 1•19 years ago
|
||
This just moves the save and restore code behind virtual functions in nsIRenderingContext so that I can override them to do something else in nsCairoRenderingContext.
Attachment #180776 -
Flags: superreview?(bzbarsky)
Attachment #180776 -
Flags: review?(bzbarsky)
Comment 2•19 years ago
|
||
Comment on attachment 180776 [details] [diff] [review] fix >Index: gfx/public/nsIRenderingContext.h >+ struct PushedTranslation { >+ float mSavedX, mSavedY; >+ }; >+ NS_IMETHOD PushTranslation(PushedTranslation* aState) = 0; >+ >+ NS_IMETHOD PopTranslation(PushedTranslation* aState) = 0; Is there a reason to have PopTranslation called manually instead of having the PushedTranslation destructor pop? The latter can't be forgotten and all... >Index: gfx/src/shared/nsRenderingContextImpl.cpp > nsRenderingContextImpl::PushTranslation(PushedTranslation* aState) NS_PRECONDITION(aState, ...) > nsRenderingContextImpl::PopTranslation(PushedTranslation* aState) NS_PRECONDITION(aState, ....) r+sr=bzbarsky, with either approach on popping...
Attachment #180776 -
Flags: superreview?(bzbarsky)
Attachment #180776 -
Flags: superreview+
Attachment #180776 -
Flags: review?(bzbarsky)
Attachment #180776 -
Flags: review+
Assignee | ||
Comment 3•19 years ago
|
||
OK, here's the patch with an auto-object to do the popping.
Attachment #180776 -
Attachment is obsolete: true
Attachment #181100 -
Flags: superreview?(bzbarsky)
Attachment #181100 -
Flags: review?(bzbarsky)
Comment 4•19 years ago
|
||
Comment on attachment 181100 [details] [diff] [review] fix #2 Looks good.
Attachment #181100 -
Flags: superreview?(bzbarsky)
Attachment #181100 -
Flags: superreview+
Attachment #181100 -
Flags: review?(bzbarsky)
Attachment #181100 -
Flags: review+
Assignee | ||
Comment 5•19 years ago
|
||
Comment on attachment 181100 [details] [diff] [review] fix #2 Modest code refactoring that should have no effect on the regular builds but is needed for Cairo Gfx to work.
Attachment #181100 -
Flags: approval1.8b2?
Assignee | ||
Comment 6•19 years ago
|
||
*** Bug 290903 has been marked as a duplicate of this bug. ***
Comment 7•19 years ago
|
||
Comment on attachment 181100 [details] [diff] [review] fix #2 a=asa
Attachment #181100 -
Flags: approval1.8b2? → approval1.8b2+
Assignee | ||
Comment 8•19 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•