Closed Bug 369834 Opened 17 years ago Closed 17 years ago

Get rid of SetAltDevice and friends

Categories

(Core :: Print Preview, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sharparrow1, Assigned: sharparrow1)

References

Details

Attachments

(1 file, 5 obsolete files)

Attached patch WIP (obsolete) — Splinter Review
Pretty straightforward bug; posting with WIP.  There is one semi-blocking issue for this, though: the print preview pages are *way* too big.  I'll figure that out soon and post a real patch for review.

As a side effect, this should fix print preview, which has basically been broken since Thebes landed.
Attached patch WIP 2 (obsolete) — Splinter Review
Almost working; still some repainting problems with the scaled print preview, but essentially working.

Unfortunately, it appears that some sort of hinting problem is remaining, because some of the text in the print preview window overlaps.
Attachment #254520 - Attachment is obsolete: true
Attached patch Finished Patch v1 (obsolete) — Splinter Review
I'm not really sure of the nsSimplePageSequence changes.  Hopefully, though, that code should go away once we get rid of the current print preview mode.

If we end up needing the PPScale factor for more things, it might be worth naming it something more general.  (One thing we might want it for is scaling up native form controls when printing.)
Attachment #254586 - Attachment is obsolete: true
Attachment #254632 - Flags: review?(roc)
I think instead of this scaling display list item, I'd prefer nsSimplePageSequenceFrame::BuildDisplayList to just build a "pagesequence display item" that's a leaf, and just calls nsLayoutUtils::PaintFrame to paint the children. That way if we need to enhance DisplayListBuilder in the future (e.g. new setup parameters) we won't have to update this code.

PPScale needs a better name, at least call it Get/SetPrintPreviewScale. And add a comment explaining what it does (scales the display, but not layout, of page contents by that amount). Probably should explain why we need both PageScale and PrintPreviewScale -- the former affects layout, the latter does not (right?).

Other than that, this is good.
Attached patch Patch v2 (obsolete) — Splinter Review
Okay, updated to comments.  Not quite sure this is what you wanted, but it works.
Attachment #254632 - Attachment is obsolete: true
Attachment #254917 - Flags: review?(roc)
Attachment #254632 - Flags: review?(roc)
Attached patch Patch v2 repost (obsolete) — Splinter Review
Oops, that version had a bunch of extra stuff in there accidentally.
Attachment #254917 - Attachment is obsolete: true
Attachment #254918 - Flags: review?(roc)
Attachment #254917 - Flags: review?(roc)
Do we need to scale the nsSimplePageSequence's background, border and outline? Does it ever even have one? If not, we can avoid mReentrantPainting by calling nsLayoutUtils::PaintFrame for each child frame.

+  friend void PaintPageSequence(nsIFrame* aFrame, nsIRenderingContext* aCtx,
+                                const nsRect& aDirtyRect, nsPoint aPt);
+  void PaintPageSequence(nsIRenderingContext& aRenderingContext,
+                         const nsRect&        aDirtyRect,
+                         nsPoint              aPt);

Just make PaintPageSequence public, it's easier than this :-).
Attached patch Patch v3Splinter Review
I guess this works too.  I'm kind of wondering about performance, but I guess it's not a serious issue.
Attachment #254918 - Attachment is obsolete: true
Attachment #254930 - Flags: review?(roc)
Attachment #254918 - Flags: review?(roc)
(In reply to comment #6)
> Do we need to scale the nsSimplePageSequence's background, border and outline?
> Does it ever even have one?

It has a solid gray background, but no border or outline.
Checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Depends on: 373091
Depends on: 374141
Depends on: 378272
Depends on: 379430
Depends on: 389359
No longer depends on: 378272
Depends on: 378272
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: