[Qt] Repaint counter for accelerated compositing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jul 2012 23:06:16 +0000 (23:06 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Jul 2012 23:06:16 +0000 (23:06 +0000)
commitb70c7b46d6fedcef5926b4a2e31edc646136faf2
treef45ca75f2d540bc99a05fa7caf00ad802cc68b12
parentdefbaab04856d6de89745e56ae9a43fe49128721
[Qt] Repaint counter for accelerated compositing
https://bugs.webkit.org/show_bug.cgi?id=90116

Patch by Helder Correia <helder.correia@nokia.com> on 2012-07-10
Reviewed by Noam Rosenthal.

No new tests, just introducing a debug feature.

For this feature to be enabled, the environment variable
QT_WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS must be set to 1. Once enabled,
both repaint counters and tile borders will be painted.

Important notes:
- Only WebKit2 is targetted for now.
- There is no integration with Preferences. That aproach was
taken initially but revealed complex and overkill for such a
debugging-only functionality. Thus, to disable it simply restart with
the environment variable unset or set to some other value.

A Qt-specific drawRepaintCounter() function was added to
TextureMapperGL. A QImage is used as scratch buffer to paint borders and
counters. It is then uploaded to a BitmapTexture acquired from the pool
and finally draw by TextureMapper. The actual compositing happens inside
LayerBackingStore::paintToTextureMapper(). Each LayerBackingStoreTile
now has a repaint counter which gets incremented in
LayerBackingStore::updateTile().

Source/WebCore:

* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore):
(WebCore::TextureMapperGL::drawRepaintCounter):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperImageBuffer.h:

Source/WebKit2:

* UIProcess/texmap/LayerBackingStore.cpp:
(WebKit::LayerBackingStore::updateTile):
(WebKit):
(WebKit::shouldShowTileDebugVisuals):
(WebKit::LayerBackingStore::paintToTextureMapper):
* UIProcess/texmap/LayerBackingStore.h:
(WebKit::LayerBackingStoreTile::LayerBackingStoreTile):
(LayerBackingStoreTile):
(WebKit::LayerBackingStoreTile::incrementRepaintCount):
(WebKit::LayerBackingStoreTile::repaintCount):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/texmap/LayerBackingStore.cpp
Source/WebKit2/UIProcess/texmap/LayerBackingStore.h