Closed Bug 290903 Opened 19 years ago Closed 19 years ago

Do not bypass nsIRenderingContext for translations

Categories

(Core Graveyard :: GFX, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 290432

People

(Reporter: engel, Assigned: engel)

References

Details

Attachments

(1 file)

|nsIRenderingContext::GetCurrentTransform()| returns a pointer to the current
transformation matrix.  In four places, the translation portion of this matrix
is then modified, i.e., the translation of the rendering context is changed
*without* invoking nsIRenderingContext::Translate.

This is somewhat unfortunate, since it restricts implementations of
nsIRenderingContext.  For example, an OpenGL implementation would ideally use
the matrix stacks provided by OpenGL; however, this requires that all
translations must be known by the rendering context.

Currently, the matrix obtained via |GetCurrentTransform| is manipulated directly
because this allows a fast push/pop for translation operations (without running
into rounding problems).  Such a direct manipulation could be hidden by
introducing a |PushTranslation()| and a |PopTranslation()| method in
nsIRenderingContext.  Implementations using a different stack mechanism (e.g.,
OpenGL) can then override these methods.
* Add PushTranslation/PopTranslation to nsIRenderingContext

* A concrete implementation of PushTranslation/PopTranslation is provided in
nsRenderingContextImpl.  Thus, there are no new requirements for available
rendering contexts.
 
* The IID of nsIRenderingContext should be bumped.

* Ideally, the matrix returned by nsIRenderingContext::GetCurrentTransform()
should be marked as const.

* The returned matrix is still manipulated in
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/svg/renderer/src/libart/nsSVGLibartBitmapGdk.cpp&rev=1.6&root=/cvsroot#210
Attachment #181106 - Flags: review?(roc)
I have a patch for this that's already reviewed and awaiting approval in bug
290432. I need it for gfx/cairo.

It looks like you are working on an OpenGL nsIRenderingContext. We need to talk.
I'll explain what's going on in bug 170553.

*** This bug has been marked as a duplicate of 290432 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Oops, sorry, I did not see your patch.

Indeed, I am working on an OpenGL rendering context; we should definitely talk.
 Thank you for your updates on Bug 170553.
Attachment #181106 - Flags: review?(roc)
Comment on attachment 181106 [details] [diff] [review]
Implement PushTranslation/PopTranslation

cancelling review because it duplicates my patch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: