New issue
Advanced search Search tips

Issue 628831 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , All
Pri: 2
Type: Bug

Blocking:
issue 529938



Sign in to add a comment

Raster regression for some pages with cc RTree patch.

Project Member Reported by wkorman@chromium.org, Jul 16 2016

Issue description

Investigating http://www.wholecloud.net/ as spinoff from cluster telemetry raster regression. It appears we lose ~0.5ms raster time per tile to CompositingDisplayItem/EndCompositingDisplayItem::Raster(), which basically does a saveLayer/restore. We theorize that with the previous one-big-SkPicture approach, Skia was able to optimize these away.

Sent email to fmalita/reed to guide further investigation.

Traces attached:

vmpstr1 = rtree patch (http://crrev.com/1484163002) applied
vmpstr2 = tot
 
trace_vmpstr1.json.gz
1.8 MB Download
trace_vmpstr2.json.gz
1.4 MB Download
note from fmalita@ --

Skia applies a set of peephole optimizations when done recording pictures (SkRecordOpts.cpp).  Do you know the exact saveLayer pattern which shows up as a regression?  Off-hand I'm thinking you're seeing the effect of SaveLayerDrawRestoreNooper (https://cs.chromium.org/chromium/src/third_party/skia/src/core/SkRecordOpts.cpp?rcl=0&l=176):

// For some SaveLayer-[drawing command]-Restore patterns, merge the SaveLayer's alpha into the
// draw, and no-op the SaveLayer and Restore.
Owner: chrishtr@chromium.org
Use case 2: avoiding saveLayer/restore that has no drawing opts between them.
This can happen if the rtree culls out all of the drawing opts.

@wkorman: stealing this bug to think of solutions, will report back on this bug.
SkRecordOpts stores the list of optimizations performed on SkPictures (or at least, the ones covered
in this bug).

SaveLayerDrawRestoreNooper (SaveLayer Draw restore when SaveLayer is opacity)
SaveNoDrawsRestoreNooper (Save followed by things that are not saveLayer or Draw, then Restore):
SvgOpacityAndFilterLayerMergePass (SaveLayer Save clipRect SaveLayer Restore Restore Restore, when the first SaveLayer is opacity and the second is compatible)

https://codereview.chromium.org/2186643002 should address the use case of SaveLayerDrawRestoreNooper.

SaveNoDrawsRestoreNooper can be handled in cc::DisplayItemList::Raster by skipping sequences that
have no draws in them. It *might* be reasonable to optimize this in Blink if there is such inefficient content, but I'd want to see good examples first. 

That leaves SvgOpacityAndFilterLayerMergePass. I'm going to try to find an example of this in the
layout tests.
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/46344c2a474c1599c6cbc44297a1b9afcae04bb6

commit 46344c2a474c1599c6cbc44297a1b9afcae04bb6
Author: tzik <tzik@chromium.org>
Date: Mon Aug 01 08:03:17 2016

Revert of Fold compositing display items into contained drawings if the drawing is a singleton. (patchset #7 id:110001 of https://codereview.chromium.org/2186643002/ )

Reason for revert:
This CL seems to break layout tests on bot.
An example of failure is:
https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Linux__dbg_/results/layout-test-results/scrollingcoordinator/non-fast-scrollable-region-transformed-iframe-crash-log.txt

STDERR: [4:4:0731/203155:3802475433:FATAL:PaintController.cpp(554)] Check failed: false.
STDERR: #0 0x7f109c38b99e base::debug::StackTrace::StackTrace()
STDERR: #1 0x7f109c3f2fef logging::LogMessage::~LogMessage()
STDERR: #2 0x7f1097594655 blink::PaintController::checkUnderInvalidation()
STDERR: #3 0x7f1097592e64 blink::PaintController::processNewItem()
STDERR: #4 0x7f1097583d52 _ZN5blink15PaintController15createAndAppendINS_18DrawingDisplayItemEJRKNS_17DisplayItemClientERKNS_11DisplayItem4TypeEN3WTF10PassRefPtrI9SkPictureEERbEEEvDpOT0_
STDERR: #5 0x7f1097583af1 blink::DrawingRecorder::~DrawingRecorder()
STDERR: #6 0x7f109422f925 base::internal::OptionalStorage<>::~OptionalStorage()
STDERR: #7 0x7f109422f8c5 base::Optional<>::~Optional()
STDERR: #8 0x7f109422ed83 blink::LayoutObjectDrawingRecorder::~LayoutObjectDrawingRecorder()
STDERR: #9 0x7f109423e187 blink::BoxPainter::paintBoxDecorationBackgroundWithRect()
STDERR: #10 0x7f109423dcde blink::BoxPainter::paintBoxDecorationBackground()
STDERR: #11 0x7f10943f34f5 blink::LayoutBox::paintBoxDecorationBackground()
STDERR: #12 0x7f109422dbcd blink::BlockPainter::paintObject()
STDERR: #13 0x7f10943b1bd5 blink::LayoutBlock::paintObject()
STDERR: #14 0x7f109422d25c blink::BlockPainter::paint()
STDERR: #15 0x7f10943b1b55 blink::LayoutBlock::paint()

Original issue's description:
> Fold compositing display items into contained drawings if the drawing is a singleton.
>
> BUG= 628831 
>
> Committed: https://crrev.com/09f3b178cfb677eaaf91a282df0d898a041378cd
> Cr-Commit-Position: refs/heads/master@{#408725}

TBR=fmalita@chromium.org,wangxianzhu@chromium.org,wkorman@chromium.org,chrishtr@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 628831 

Review-Url: https://codereview.chromium.org/2197903002
Cr-Commit-Position: refs/heads/master@{#408928}

[modify] https://crrev.com/46344c2a474c1599c6cbc44297a1b9afcae04bb6/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
[modify] https://crrev.com/46344c2a474c1599c6cbc44297a1b9afcae04bb6/third_party/WebKit/Source/platform/graphics/paint/CompositingRecorder.cpp
[modify] https://crrev.com/46344c2a474c1599c6cbc44297a1b9afcae04bb6/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
[modify] https://crrev.com/46344c2a474c1599c6cbc44297a1b9afcae04bb6/third_party/WebKit/Source/platform/graphics/paint/PaintController.h

Project Member

Comment 6 by bugdroid1@chromium.org, Aug 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b4169ff2158e3aaecb6c90dcd49452ae6191eeca

commit b4169ff2158e3aaecb6c90dcd49452ae6191eeca
Author: wangxianzhu <wangxianzhu@chromium.org>
Date: Mon Aug 01 18:40:26 2016

Reland of Fold compositing display items into contained drawings if the drawing is a singleton.

Original issue's description:
> Fold compositing display items into contained drawings if the drawing is a singleton.
>
> BUG= 628831 
>
> Committed: https://crrev.com/09f3b178cfb677eaaf91a282df0d898a041378cd
> Cr-Commit-Position: refs/heads/master@{#408725}

This reverts patchset #7 id:110001 of https://codereview.chromium.org/2186643002/
(46344c2a474c1599c6cbc44297a1b9afcae04bb6).

Change on the original CL:
- During under-invalidation checking, allow invalidated display items
  in cached subsequence as long as they are the same as the the cached
  display items. This is to support skipped-cache display items in a
  cached subsequence.
- Added an under-invalidation checking test for compositing drawing
  folding in cached subsequence.

Review-Url: https://codereview.chromium.org/2198113002
Cr-Commit-Position: refs/heads/master@{#409004}

[modify] https://crrev.com/b4169ff2158e3aaecb6c90dcd49452ae6191eeca/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
[modify] https://crrev.com/b4169ff2158e3aaecb6c90dcd49452ae6191eeca/third_party/WebKit/Source/platform/graphics/paint/CompositingRecorder.cpp
[modify] https://crrev.com/b4169ff2158e3aaecb6c90dcd49452ae6191eeca/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
[modify] https://crrev.com/b4169ff2158e3aaecb6c90dcd49452ae6191eeca/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
[modify] https://crrev.com/b4169ff2158e3aaecb6c90dcd49452ae6191eeca/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp

Status: Fixed (was: Assigned)
Project Member

Comment 8 by bugdroid1@chromium.org, Feb 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/424a2d302d2106dabd248ee96ab751bd54d38f1a

commit 424a2d302d2106dabd248ee96ab751bd54d38f1a
Author: pdr <pdr@chromium.org>
Date: Fri Feb 03 03:31:24 2017

Optimize CompositingRecorder::endCompositing to not need an SkPictureBuilder

CompositingRecorder::endCompositing has an optimization [1] to turn
patterns like [..., begin compositing, drawing, end compositing]
into [..., composited drawing] which takes advantage of an SkPicture
recording optimization. An SkPictureBuilder is not needed in this
case, as we can modify the underlying display list while creating the
new composited drawing. To do this, a DCHECK in DrawingRecorder that
the underlying list doesn't change has been suppressed with
DisableListModificationCheck.

The last user of DisableNullPaintPropertyChecks has been removed which
lets us delete code from PaintChunker.

[1] https://codereview.chromium.org/2186643002

BUG= 628831 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2675773003
Cr-Commit-Position: refs/heads/master@{#447903}

[modify] https://crrev.com/424a2d302d2106dabd248ee96ab751bd54d38f1a/third_party/WebKit/Source/platform/graphics/paint/CompositingRecorder.cpp
[modify] https://crrev.com/424a2d302d2106dabd248ee96ab751bd54d38f1a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
[modify] https://crrev.com/424a2d302d2106dabd248ee96ab751bd54d38f1a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.h
[modify] https://crrev.com/424a2d302d2106dabd248ee96ab751bd54d38f1a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp
[modify] https://crrev.com/424a2d302d2106dabd248ee96ab751bd54d38f1a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h

Sign in to add a comment