Give ResourceUsageOverlay a stacked chart for dirty memory per category.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Nov 2015 11:36:15 +0000 (11:36 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Nov 2015 11:36:15 +0000 (11:36 +0000)
commitd0f6102c11027f63b3968b8d01eb268befe714b2
tree007d3c61820f7b5fa60150c7357affd04be7e09d
parent21874e08d2b46567feff04c8ec86c86328a9ba7b
Give ResourceUsageOverlay a stacked chart for dirty memory per category.
<https://webkit.org/b/150905>

Reviewed by Antti Koivisto.

Refactored the data gathering to operate on "memory categories", a memory category is at
the top level a VM tag, e.g the VM tag for our bmalloc allocator. It can in turn have
sub-categories, e.g one for the GC heap, which allocates all of its blocks through bmalloc
and thus end up in the same tag.

Each category also has a hard-coded color, which is used consistently in labels and charts.

Also went back to drawing everything with CGContext directly instead of GraphicsContext
since the latter is not thread safe.

* page/ResourceUsageOverlay.h:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(-[WebOverlayLayer drawInContext:]):
(WebCore::RingBuffer::last):
(WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
(WebCore::ResourceUsageData::ResourceUsageData):
(WebCore::showText):
(WebCore::drawGraphLabel):
(WebCore::drawCpuHistory):
(WebCore::drawGCHistory):
(WebCore::drawMemHistory):
(WebCore::drawSlice):
(WebCore::drawMemoryPie):
(WebCore::ResourceUsageOverlay::platformDraw):
(WebCore::categoryForVMTag):
(WebCore::runSamplerThread):
(WebCore::drawPlate): Deleted.
(WebCore::fontCascade): Deleted.
(WebCore::ResourceUsageOverlay::draw): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/ResourceUsageOverlay.h
Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm