Commit e3272cc3 authored by Daniel Libby's avatar Daniel Libby Committed by Commit Bot

Remove no-op paint layer flag and compositing state query

First in a series of changes to get rid of the
DisableCompositingQueryAsserts in PaintLayerPainter::Paint.

kPaintLayerUncachedClipRects is only used to determine whether a paint
layer should create a subsequence (for potential benefits of caching/
reusing the subsequence). However, it is currently only set if
kGlobalPaintFlattenCompositingLayers is set (either manually in
data_transfer.cc or via the code in PaintLayerPainter::Paint).

If that global flag is set ShouldCreateSubsequence always returns false,
so the kPaintLayerUncachedClipRects flag is unnecessary. Removing this
code gets rid of 1 out of 3 compositing queries in this codepath.

Bug: 1007989
Change-Id: I59cddc51a65c9acd8e134845d7c9c4b6320fc4d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864414Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Daniel Libby <dlibby@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#706973}
parent 1b42ce21
......@@ -123,8 +123,7 @@ class DraggedNodeImageBuilder {
PaintLayerPaintingInfo painting_info(
layer, CullRect(EnclosingIntRect(bounding_box)),
kGlobalPaintFlattenCompositingLayers, PhysicalOffset());
PaintLayerFlags flags = kPaintLayerHaveTransparency |
kPaintLayerUncachedClipRects;
PaintLayerFlags flags = kPaintLayerHaveTransparency;
PaintRecordBuilder builder;
dragged_layout_object->GetDocument().Lifecycle().AdvanceTo(
......
......@@ -78,17 +78,6 @@ PaintResult PaintLayerPainter::Paint(
// https://code.google.com/p/chromium/issues/detail?id=343772
DisableCompositingQueryAsserts disabler;
if (paint_layer_.GetCompositingState() != kNotComposited) {
if (painting_info.GetGlobalPaintFlags() &
kGlobalPaintFlattenCompositingLayers) {
// FIXME: ok, but what about GlobalPaintFlattenCompositingLayers? That's
// for printing and drag-image.
// FIXME: why isn't the code here global, as opposed to being set on each
// paint() call?
paint_flags |= kPaintLayerUncachedClipRects;
}
}
// Non self-painting layers without self-painting descendants don't need to be
// painted as their layoutObject() should properly paint itself.
if (!paint_layer_.IsSelfPaintingLayer() &&
......@@ -146,8 +135,8 @@ static bool ShouldCreateSubsequence(const PaintLayer& paint_layer,
if (painting_info.GetGlobalPaintFlags() &
kGlobalPaintFlattenCompositingLayers)
return false;
if (paint_flags & (kPaintLayerPaintingOverlayOverflowControls |
kPaintLayerUncachedClipRects))
if (paint_flags & kPaintLayerPaintingOverlayOverflowControls)
return false;
return true;
......
......@@ -63,7 +63,6 @@ class PaintLayer;
enum PaintLayerFlag {
kPaintLayerNoFlag = 0,
kPaintLayerHaveTransparency = 1,
kPaintLayerUncachedClipRects = 1 << 2,
kPaintLayerPaintingOverlayOverflowControls = 1 << 3,
kPaintLayerPaintingCompositingBackgroundPhase = 1 << 4,
kPaintLayerPaintingCompositingForegroundPhase = 1 << 5,
......@@ -137,8 +136,6 @@ inline String PaintLayerFlagsToDebugString(PaintLayerFlags flags) {
if (flags & kPaintLayerHaveTransparency)
append("kPaintLayerHaveTransparency");
if (flags & kPaintLayerUncachedClipRects)
append("kPaintLayerUncachedClipRects");
if (flags & kPaintLayerPaintingOverlayOverflowControls)
append("kPaintLayerPaintingOverlayOverflowControls");
if (flags & kPaintLayerPaintingCompositingScrollingPhase)
......
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