DescriptionCache a screen compatible DC to avoid re-creating it excessively.
Profiling revealed that creating and deleting the DC carries
a significant cost.
This is an important optimization when you consider the case
of ElideRectangleText(), which calls font.GetStringWidth()
on many substrings of the input string. Each such call
currently creates a temporary DC in RenderTextWin when using
canvas_skia_skia.cc.
Having a global compatible DC allows all those calls to
re-use the same DC instead of creating and deleting them.
This needs to be global because CanvasSkia::SizeStringInt()
is a static function, so we can't just store it e.g. on the canvas.
BUG=105550
TEST=CreateCompatibleDC() and DeleteDC() should disappear
from the profiler output when running with use_canvas_skia_skia=1
and rapidly clicking the SSL bubble on paypal.com
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=120594
Patch Set 1 : . #
Total comments: 2
Patch Set 2 : '' #
Total comments: 9
Patch Set 3 : '' #Patch Set 4 : '' #
Messages
Total messages: 16 (0 generated)
|