Closed Bug 573409 Opened 14 years ago Closed 14 years ago

expire unused cached double-buffering back surfaces

Categories

(Core :: Graphics, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: karlt, Assigned: karlt)

References

Details

(Keywords: memory-footprint)

Attachments

(1 file, 2 obsolete files)

roc and I were discussing the value of caching surfaces when their contents need not be retained. It seemed to come down to the possibility of significant overhead with large resource allocations. For opaque surfaces the initialization to black is also unnecessary (while cairo_surface_create_similar initializes to black). AIUI CONTENT_COLOR_ALPHA surfaces typically need to be initialized before use. However, there is also significant resource cost in retaining these resources while they are unused. If we are going to do this then we should expire on a timer. Bug 564991 comment 27 proposes retaining these surfaces. (This bug is about expiring them.) I considered sharing surfaces between layer managers but one reason not to do this is that there is value in keeping the surfaces associated with a single window so as not to migrate the surfaces from one graphics card to another when sharing between windows driven by different cards.
Attached patch patch v0.1 (obsolete) (deleted) — Splinter Review
Needs testing, and better documentation.
(In reply to comment #0) > AIUI CONTENT_COLOR_ALPHA surfaces typically need to be initialized before use. If we have a layer tree whose layers don't completely fill the window, or whose layers are transparent, we need to clear the backbuffer before drawing the layer tree into it. But that can only happen when the backbuffer is CONTENT_COLOR_ALPHA. If the backbuffer is CONTENT_COLOR, then we know the layers must completely fill the window with opaque pixels so there is no need to clear the backbuffer before drawing the layers into it.
(Matt and I considered an optimization where we avoid clearing the backbuffer if (some subset of) the leaf layers are transparent but completely fill the window without overlapping; then we could use OPERATOR_SOURCE to draw them. But it's totally not worth the complexity.)
Depends on: 564991
OS: Linux → All
Attachment #452617 - Attachment is obsolete: true
Attached patch patch (obsolete) (deleted) — Splinter Review
Attachment #452873 - Flags: superreview?(roc)
Attachment #452873 - Flags: review?(joe)
Keywords: footprint
Blocks: 573626
Comment on attachment 452873 [details] [diff] [review] patch +gfxCachedTempSurface::Use(gfxASurface::gfxContentType aContentType, + const gfxIntSize& aSize, + gfxASurface* aSimilarTo) +{ I think this should be called "Get".
Attachment #452873 - Flags: superreview?(roc) → superreview+
Attachment #452873 - Flags: review?(joe) → review?(vladimir)
Attached patch addressed review comments (deleted) — Splinter Review
Attachment #452873 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: