Commit 91338692 authored by ckitagawa's avatar ckitagawa Committed by Commit Bot

Make GlobalPaintFlags const in Paint Phase

AFAICT this behavior was only necessary due to the upstream print caller
not setting flags correctly. The upstream print code now uses the
correct flags so modifying the GlobalPaintFlags in FramePainter is no
longer required.

Also manually tested printing on Linux Desktop.

Bug: 510280
Change-Id: I4400b361fe5c389a60f0d758555360ca14b52a2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1783357
Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693887}
parent b4331155
...@@ -414,7 +414,10 @@ class ChromePrintContext : public PrintContext { ...@@ -414,7 +414,10 @@ class ChromePrintContext : public PrintContext {
&context); &context);
frame_view->PaintContentsOutsideOfLifecycle( frame_view->PaintContentsOutsideOfLifecycle(
builder.Context(), kGlobalPaintNormalPhase, CullRect(page_rect)); builder.Context(),
kGlobalPaintNormalPhase | kGlobalPaintFlattenCompositingLayers |
kGlobalPaintPrinting,
CullRect(page_rect));
{ {
ScopedPaintChunkProperties scoped_paint_chunk_properties( ScopedPaintChunkProperties scoped_paint_chunk_properties(
builder.Context().GetPaintController(), property_tree_state, builder, builder.Context().GetPaintController(), property_tree_state, builder,
......
...@@ -74,17 +74,11 @@ void FramePainter::PaintContents(GraphicsContext& context, ...@@ -74,17 +74,11 @@ void FramePainter::PaintContents(GraphicsContext& context,
FontCachePurgePreventer font_cache_purge_preventer; FontCachePurgePreventer font_cache_purge_preventer;
// TODO(jchaffraix): GlobalPaintFlags should be const during a paint
// phase. Thus we should set this flag upfront (crbug.com/510280).
GlobalPaintFlags updated_global_paint_flags = global_paint_flags;
PaintLayerFlags root_layer_paint_flags = 0; PaintLayerFlags root_layer_paint_flags = 0;
if (document->Printing()) { // This will prevent clipping the root PaintLayer to its visible content
updated_global_paint_flags |= // rect when root layer scrolling is enabled.
kGlobalPaintFlattenCompositingLayers | kGlobalPaintPrinting; if (document->Printing())
// This will prevent clipping the root PaintLayer to its visible content
// rect when root layer scrolling is enabled.
root_layer_paint_flags = kPaintLayerPaintingOverflowContents; root_layer_paint_flags = kPaintLayerPaintingOverflowContents;
}
PaintLayer* root_layer = layout_view->Layer(); PaintLayer* root_layer = layout_view->Layer();
...@@ -100,7 +94,7 @@ void FramePainter::PaintContents(GraphicsContext& context, ...@@ -100,7 +94,7 @@ void FramePainter::PaintContents(GraphicsContext& context,
root_layer->GetLayoutObject().GetFrame()); root_layer->GetLayoutObject().GetFrame());
context.SetDeviceScaleFactor(device_scale_factor); context.SetDeviceScaleFactor(device_scale_factor);
layer_painter.Paint(context, cull_rect, updated_global_paint_flags, layer_painter.Paint(context, cull_rect, global_paint_flags,
root_layer_paint_flags); root_layer_paint_flags);
// Regions may have changed as a result of the visibility/z-index of element // Regions may have changed as a result of the visibility/z-index of element
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment