[Texmap] Refactor code related to debug border and repaint count.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2013 13:50:58 +0000 (13:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2013 13:50:58 +0000 (13:50 +0000)
commit361d83f133a6c3933e3f0cfe4452aef1408cf5d7
tree42c96305ecb58ee84b7b90aa7bf39a927976553b
parenta023bbcf91627f750d6de5a4d83e91f712db05d6
[Texmap] Refactor code related to debug border and repaint count.
https://bugs.webkit.org/show_bug.cgi?id=105787

Patch by Huang Dongsung <luxtella@company100.net> on 2013-01-25
Reviewed by Noam Rosenthal.

Currently, TextureMapperBackingStore, CoordinatedBackingStore and
GraphicsLayerTextureMapper have duplicated code to draw debug border or
repaint count. This patch refactors that all platform layers draw debug
border and repaint count in the consistent way:
TextureMapper::drawBorder() and TextureMapper::drawRepaintCounter().

There are three big changes:
1. TextureMapperLayer has the debug visuals like GraphicsLayer.
Both debug border and repaint count are called as the debug visuals.
2. We use the same color and width to Mac port because we get that info using
GraphicsLayer::updateDebugIndicators().
3. Draw borders for background color, backing store and contents layer,
while drawing repaint count only for backing store.

No new tests. This functionality is for debugging, so we cannot test using DRT.

* platform/graphics/cairo/GraphicsContext3DPrivate.h:
* platform/graphics/qt/GraphicsContext3DQt.cpp:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::setShowDebugBorder):
(WebCore):
(WebCore::GraphicsLayerTextureMapper::setShowRepaintCounter):
(WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
(WebCore::GraphicsLayerTextureMapper::updateDebugBorderAndRepaintCountIfNeeded):
(WebCore::GraphicsLayerTextureMapper::setDebugBorder):
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
(WebCore::GraphicsLayerTextureMapper::prepareBackingStore):
(WebCore::GraphicsLayerTextureMapper::setRepaintCount):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
(GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::debugBorderColor):
(WebCore::GraphicsLayerTextureMapper::debugBorderWidth):
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperBackingStore.cpp:
(WebCore::TextureMapperTiledBackingStore::adjustedTransformForRect):
(WebCore):
(WebCore::TextureMapperTiledBackingStore::paintToTextureMapper):
(WebCore::TextureMapperTiledBackingStore::drawBorder):
    Override TextureMapperPlatformLayer::drawBorder() to draw the border
    for each tile.
(WebCore::TextureMapperTiledBackingStore::drawRepaintCounter):
* platform/graphics/texmap/TextureMapperBackingStore.h:
(WebCore::TextureMapperBackingStore::drawRepaintCounter):
(TextureMapperBackingStore):
(TextureMapperTiledBackingStore):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawRepaintCounter):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperImageBuffer.cpp:
(WebCore::TextureMapperImageBuffer::drawBorder):
(WebCore):
(WebCore::TextureMapperImageBuffer::drawRepaintCounter):
* platform/graphics/texmap/TextureMapperImageBuffer.h:
(TextureMapperImageBuffer):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf):
(WebCore::TextureMapperLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/texmap/TextureMapperLayer.h:
(State):
(WebCore::TextureMapperLayer::State::State):
* platform/graphics/texmap/TextureMapperPlatformLayer.h:
(WebCore::TextureMapperPlatformLayer::drawBorder):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h
Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h