canvas performance regression with OMTC due to readback

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
4 years ago
3 years ago

People

(Reporter: karlt, Unassigned)

Tracking

({regression})

Trunk
x86
Linux
regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox42 affected)

Details

(Whiteboard: [gfx-noted])

+++ This bug was initially created as a clone of Bug #1155649 +++

2D Canvas is first drawn to an X11/GPU surface and then read back into an image/CPU surface from TextureClient::CreateForRawBufferAccess(), which the compositor thread then needs to upload back to the X server and GPU.

https://hg.mozilla.org/mozilla-central/annotate/cef11c3e86c3/gfx/layers/client/CanvasClient.cpp#l127

Using CreateTextureClientForDrawing() for an X11/GPU surface in the texture client resolves the performance issue I see on
https://bugzilla.mozilla.org/attachment.cgi?id=8386517

I don't know why the "double buffering" issue is relevant only when ndef XP_WIN (bug 1008211).

Rendering canvas to an image/CPU surface may be an alternative solution to consider.

This regression was originally reported in bug 1155649, but much of the discussion there is on a different topic.

#0  0x00007f57313efbd4 in _XReply () from /usr/lib64/libX11.so.6
#1  0x00007f57313d562c in XGetImage () from /usr/lib64/libX11.so.6
#2  0x00007f573b643d19 in _get_image_surface (surface=0x7f56fb507c00, 
    interest_rect=interest_rect@entry=0x0, 
    image_out=image_out@entry=0x7ffc3b5ed198, image_rect=image_rect@entry=0x0)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo-xlib-surface.c:855
#3  0x00007f573b644533 in _cairo_xlib_surface_acquire_source_image (
    abstract_surface=<optimized out>, image_out=0x7ffc3b5ed2b0, 
    image_extra=0x7ffc3b5ed2e0)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo-xlib-surface.c:1390
#4  0x00007f573b671958 in _cairo_surface_acquire_source_image (
    surface=0x7f56fb507c00, image_out=0x7ffc3b5ed2b0, 
    image_extra=<optimized out>)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo-surface.c:1452
#5  0x00007f573b658188 in _pixman_image_for_surface (iy=0x7ffc3b5ed3b4, 
    ix=0x7ffc3b5ed3b0, extents=<optimized out>, is_mask=0, 
    pattern=0x7ffc3b5ed9b8)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo-image-surface.c:1502
#6  _pixman_image_for_pattern (pattern=pattern@entry=0x7ffc3b5ed9b8, 
    is_mask=is_mask@entry=0, extents=extents@entry=0x7ffc3b5ed480, 
    tx=tx@entry=0x7ffc3b5ed3b0, ty=ty@entry=0x7ffc3b5ed3b4)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo-image-surface.c:1680
#7  0x00007f573b6598f6 in _composite_boxes (extents=0x7ffc3b5ed460, clip=0x0, 
    antialias=CAIRO_ANTIALIAS_DEFAULT, boxes=0x7ffc3b5ed6b0, 
    pattern=0x7ffc3b5ed9b8, op=CAIRO_OPERATOR_SOURCE, dst=0x7f56975bf0c0)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo-image-surface.c:3016
#8  _clip_and_composite_boxes (dst=0x7f56975bf0c0, op=CAIRO_OPERATOR_SOURCE, 
    src=0x7ffc3b5ed9b8, boxes=0x7ffc3b5ed6b0, 
    antialias=CAIRO_ANTIALIAS_DEFAULT, extents=0x7ffc3b5ed460, clip=0x0)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo-image-surface.c:3077
#9  0x00007f573b65b165 in _cairo_image_surface_paint (
    abstract_surface=0x7f56975bf0c0, op=CAIRO_OPERATOR_SOURCE, 
    source=0x7ffc3b5ed9b8, clip=0x0)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo-image-surface.c:3325
#10 0x00007f573b6766db in _cairo_surface_paint (surface=0x7f56975bf0c0, 
    op=CAIRO_OPERATOR_SOURCE, source=0x7ffc3b5ed9b8, clip=0x0)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo-surface.c:2109
#11 0x00007f573b65ab64 in _cairo_gstate_fill (
    gstate=0x7f573d2eaa68 <_context_stash+4728>, 
    path=0x7f573d2eac08 <_context_stash+5144>)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo-gstate.c:1285
#12 0x00007f573b67a713 in INT__moz_cairo_fill_preserve (
    cr=cr@entry=0x7f573d2ea8a0 <_context_stash+4272>)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo.c:2464
#13 0x00007f573b67a736 in _moz_cairo_fill (
    cr=0x7f573d2ea8a0 <_context_stash+4272>)
    at /mnt/ssd1/karl/moz/dev/gfx/cairo/cairo/src/cairo.c:2440
#14 0x00007f573a2221a7 in mozilla::gfx::DrawTargetCairo::CopySurfaceInternal (
    this=0x7f56faf41480, aSurface=0x7f56fb507c00, aSource=..., aDest=...)
    at /mnt/ssd1/karl/moz/dev/gfx/2d/DrawTargetCairo.cpp:1039
#15 0x00007f573a22229e in mozilla::gfx::DrawTargetCairo::CopySurface (
    this=0x7f56faf41480, aSurface=<optimized out>, aSource=..., aDest=...)
    at /mnt/ssd1/karl/moz/dev/gfx/2d/DrawTargetCairo.cpp:1061
#16 0x00007f573a28cd23 in mozilla::layers::CopyableCanvasLayer::UpdateTarget (
    this=0x7f56fad64000, aDestTarget=0x7f56faf41480)
    at /mnt/ssd1/karl/moz/dev/gfx/layers/CopyableCanvasLayer.cpp:92
#17 0x00007f573a2ad6de in mozilla::layers::CanvasClient2D::Update (
    this=0x7f5714117180, aSize=..., aLayer=<optimized out>)
    at /mnt/ssd1/karl/moz/dev/gfx/layers/client/CanvasClient.cpp:94
#18 0x00007f573a2ac87d in mozilla::layers::ClientCanvasLayer::RenderLayer (
    this=0x7f56fad64000)
    at /mnt/ssd1/karl/moz/dev/gfx/layers/client/ClientCanvasLayer.cpp:170
#19 0x00007f573a2b22e8 in mozilla::layers::ClientContainerLayer::RenderLayer (
    this=0x7f568f0f8800)
    at /mnt/ssd1/karl/moz/dev/gfx/layers/client/ClientContainerLayer.h:66
#20 0x00007f573a2b22e8 in mozilla::layers::ClientContainerLayer::RenderLayer (
    this=0x7f56fbb91800)
    at /mnt/ssd1/karl/moz/dev/gfx/layers/client/ClientContainerLayer.h:66
#21 0x00007f573a2aa047 in mozilla::layers::ClientLayerManager::EndTransactionInternal (this=0x7f56fc1b3e80, aCallback=aCallback@entry=0x0, 
    aCallbackData=aCallbackData@entry=0x0)
    at /mnt/ssd1/karl/moz/dev/gfx/layers/client/ClientLayerManager.cpp:274
#22 0x00007f573a2b07f1 in mozilla::layers::ClientLayerManager::EndEmptyTransaction (this=0x7f56fc1b3e80, 
    aFlags=mozilla::layers::LayerManager::END_NO_COMPOSITE)
    at /mnt/ssd1/karl/moz/dev/gfx/layers/client/ClientLayerManager.cpp:346
#23 0x00007f573b049ae8 in PresShell::Paint (this=0x7f56c45ef400, 
    aViewToPaint=aViewToPaint@entry=0x7f56bc2388d0, aDirtyRegion=..., 
    aFlags=aFlags@entry=1)
    at /mnt/ssd1/karl/moz/dev/layout/base/nsPresShell.cpp:6069
#24 0x00007f573ae81bdb in nsViewManager::ProcessPendingUpdatesPaint (
    this=0x7f56bc23fa80, aWidget=aWidget@entry=0x7f573d3878c0)
    at /mnt/ssd1/karl/moz/dev/view/nsViewManager.cpp:456
#25 0x00007f573ae81d6a in nsViewManager::ProcessPendingUpdatesForView (
    this=<optimized out>, aView=<optimized out>, 
    aFlushDirtyRegion=aFlushDirtyRegion@entry=true)
    at /mnt/ssd1/karl/moz/dev/view/nsViewManager.cpp:396
#26 0x00007f573ae81e0e in nsViewManager::ProcessPendingUpdates (
    this=this@entry=0x7f56bc23fa80)
    at /mnt/ssd1/karl/moz/dev/view/nsViewManager.cpp:1086
#27 0x00007f573afcee55 in nsRefreshDriver::Tick (this=0x7f56c45ef000, 
    aNowEpoch=aNowEpoch@entry=1436171609415415, aNowTime=...)
    at /mnt/ssd1/karl/moz/dev/layout/base/nsRefreshDriver.cpp:1819
#28 0x00007f573afd048a in mozilla::RefreshDriverTimer::TickDriver (
    driver=<optimized out>, jsnow=jsnow@entry=1436171609415415, now=..., 
    now@entry=...)
    at /mnt/ssd1/karl/moz/dev/layout/base/nsRefreshDriver.cpp:196
(Reporter)

Updated

4 years ago
See Also: → bug 1100744

Comment 1

4 years ago
Isn't removing xrender supposed to fix the issue?
https://bugzilla.mozilla.org/show_bug.cgi?id=1180942
Depends on: 1167235
No longer depends on: 1161636
Whiteboard: [gfx-noted]
(Reporter)

Updated

4 years ago
Blocks: 1172181
Since we disabled xrender in bug 1180942, and switched to Skia canvas in bug 1244754, this bug is no longer applicable. We don't as yet plan on supporting xrender again by default for canvas/content rendering, maybe at best compositing, so I don't expect this should pop up again.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Depends on: 1180942, 1244754
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.