Closed Bug 444498 Opened 17 years ago Closed 13 years ago

windowless plugin painting should only composite the dirty rect

Categories

(Core :: Graphics, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: karlt, Assigned: karlt)

Details

Attachments

(1 file)

Currently X11 windowless plugin painting uses gfxXlibNativeRenderer on the whole plugin rect even when only a portion needs repainting. The plugin is only asked to paint the dirty rect of the renderer's rect so when cairo_draw_with_xlib takes the fast path there should not be a performance impact with the current behavior (provided the plugin pays attention to the dirty rect). The impact on performance will be significant when cairo_draw_with_xlib takes the slow path, and does math on a pixmap and image surfaces the size of the renderer's rect. Since bug 430450 is fixed, the only cases that I know where this slow path is hit is with non-translation transformations, non-rectangular clip regions, or non-unit opacity.
This is a possible solution but there is one issue: gfxXlibNativeRenderer::NativeDraw does not get notified of clip regions outside the rendering region. If we keep this behavior then NativeDraw should assume that there could be surrounding clips and therefore _require_ plugins to clip their drawing to the dirty rect. That is what is done in this patch but there's an outside chance that unnecessarily forcing a smaller clip rect might impact performance on some plugins. nsNativeThemeGTK::DrawWidgetBackground only uses gfxXlibNativeRenderer on the dirty rect and comments indicate that Clearlooks doesn't clip to the dirty rect, but I'm not aware of problems due to painting outside clip rects outside the dirty rect. Perhaps that is because usually the clip rect corresponds to the edge of a surface and so it is not possible to draw outside the clip rect? (Similar issues were discussed in bug 333250.)
This looks like its fixed in the OOP implementation, at least.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: