зеркало из https://github.com/mozilla/gecko-dev.git
Bug 454059 - Add a new PaintForPrinting display list builder mode, and only create a Linkifier when printing. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D114474
This commit is contained in:
Родитель
11144bf7be
Коммит
63f05b6d5a
|
@ -3131,6 +3131,10 @@ nsresult nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext,
|
|||
TimeStamp startBuildDisplayList = TimeStamp::Now();
|
||||
|
||||
const bool buildCaret = !(aFlags & PaintFrameFlags::HideCaret);
|
||||
|
||||
// Note that isForPainting here does not include the PaintForPrinting builder
|
||||
// mode; that's OK because there is no point in using retained display lists
|
||||
// for a print destination.
|
||||
const bool isForPainting = (aFlags & PaintFrameFlags::WidgetLayers) &&
|
||||
aBuilderMode == nsDisplayListBuilderMode::Painting;
|
||||
|
||||
|
|
|
@ -673,7 +673,7 @@ nsresult nsPageSequenceFrame::PrintNextSheet() {
|
|||
nsRegion drawingRegion(drawingRect);
|
||||
nsLayoutUtils::PaintFrame(gCtx, currentSheetFrame, drawingRegion,
|
||||
NS_RGBA(0, 0, 0, 0),
|
||||
nsDisplayListBuilderMode::Painting,
|
||||
nsDisplayListBuilderMode::PaintForPrinting,
|
||||
nsLayoutUtils::PaintFrameFlags::SyncDecodeImages);
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -341,6 +341,7 @@ struct ActiveScrolledRoot {
|
|||
|
||||
enum class nsDisplayListBuilderMode : uint8_t {
|
||||
Painting,
|
||||
PaintForPrinting,
|
||||
EventDelivery,
|
||||
FrameVisibility,
|
||||
TransformComputation,
|
||||
|
@ -463,10 +464,20 @@ class nsDisplayListBuilder {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return true if the display list is being built for painting.
|
||||
* @return true if the display list is being built for painting. This
|
||||
* includes both painting to a window or other buffer and painting to
|
||||
* a print/pdf destination.
|
||||
*/
|
||||
bool IsForPainting() const {
|
||||
return mMode == nsDisplayListBuilderMode::Painting;
|
||||
return mMode == nsDisplayListBuilderMode::Painting ||
|
||||
mMode == nsDisplayListBuilderMode::PaintForPrinting;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if the display list is being built specifically for printing.
|
||||
*/
|
||||
bool IsForPrinting() const {
|
||||
return mMode == nsDisplayListBuilderMode::PaintForPrinting;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче