You need to
before you can comment on or make changes to this bug.
Currently we are creating shadows using the complete size of the element in the page, we can use the clip information to reduce that size.
Created an attachment (id=65587) [details]
Does this patch net any performance improvements on its own?
(In reply to comment #2)
> Does this patch net any performance improvements on its own?
Yep, mostly when scrolling a webpage, we blur a rect as big as the scroll movement, and also for big pages we only blur the viewport part even if the page is bigger than that, for instance identi.ca.
Is it possible to make calculateShadowBufferDimensions a non-static method and to do this there? That way we could benefit from this improvement at all call sites.
(In reply to comment #4)
> Is it possible to make calculateShadowBufferDimensions a non-static method and to do this there? That way we could benefit from this improvement at all call sites.
It is, I planned this patch just to make it the rects because they are the main issue nowadays. I'll review the patch.
(From update of attachment 65587 [details])
Seems like a good optimization.
Remember to add a dot at the end of comments.
Do you mind creating a static function that take a rectangle and intersects it with the current Cairo clip? It could be passed an optional minimumSize argument. I think we may want to use this optimization in other places later on.
IntRect intersectRectWithCurrentCairoClip(cairo_t*, IntRect, int minimumSize=0);
Committing this patch after talking to martin we will leave the generalization for the contextshadow patch in the bug 45599.