Changeset 142595 in webkit


Ignore:
Timestamp:
Feb 12, 2013 1:34:40 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[TexMap] Apply frames-per-second debug counter to WK1.
https://bugs.webkit.org/show_bug.cgi?id=109540

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

Source/WebCore:

r142524 implemented frames-per-second debug counter on WK2. This patch
applies frames-per-second debug counter to WK1 also.

Visual debugging feature, no need for new tests.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • Target.pri:
  • platform/graphics/texmap/TextureMapper.h:
  • platform/graphics/texmap/TextureMapperFPSCounter.cpp: Added.

(WebCore):
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
(WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):

  • platform/graphics/texmap/TextureMapperFPSCounter.h: Added.

(WebCore):
(TextureMapperFPSCounter):

  • platform/graphics/texmap/TextureMapperGL.cpp:

(WebCore):
(WebCore::TextureMapperGL::drawNumber):

Rename from drawRepaintCounter to drawNumber.

  • platform/graphics/texmap/TextureMapperGL.h:
  • platform/graphics/texmap/TextureMapperImageBuffer.cpp:

(WebCore::TextureMapperImageBuffer::drawNumber):

  • platform/graphics/texmap/TextureMapperImageBuffer.h:

(TextureMapperImageBuffer):

  • platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:

(WebCore::TextureMapperTiledBackingStore::drawRepaintCounter):

  • platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:

(WebCore::CoordinatedBackingStore::drawRepaintCounter):

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp: Move frames-per-second debug counter code to TextureMapperFPSCounter.

(WebCore::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
(WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext):
(WebCore::CoordinatedGraphicsScene::paintToGraphicsContext):

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:

Source/WebKit/efl:

Make AcceleratedCompositingContextEfl use TextureMapperFPSCounter.

  • WebCoreSupport/AcceleratedCompositingContextEfl.cpp:

(WebCore::AcceleratedCompositingContext::renderLayers):

  • WebCoreSupport/AcceleratedCompositingContextEfl.h:

(AcceleratedCompositingContext):

Source/WebKit/gtk:

Make AcceleratedCompositingContext use TextureMapperFPSCounter.

  • WebCoreSupport/AcceleratedCompositingContext.h:
  • WebCoreSupport/AcceleratedCompositingContextGL.cpp:

(WebKit::AcceleratedCompositingContext::compositeLayersToContext):

Source/WebKit/qt:

Make TextureMapperLayerClientQt use TextureMapperFPSCounter.

  • WebCoreSupport/TextureMapperLayerClientQt.cpp:

(TextureMapperLayerClientQt::renderCompositedLayers):

  • WebCoreSupport/TextureMapperLayerClientQt.h:

(TextureMapperLayerClientQt):

Location:
trunk/Source
Files:
2 added
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r142573 r142595  
    20022002    platform/graphics/texmap/TextureMapper.cpp
    20032003    platform/graphics/texmap/TextureMapperBackingStore.cpp
     2004    platform/graphics/texmap/TextureMapperFPSCounter.cpp
    20042005    platform/graphics/texmap/TextureMapperImageBuffer.cpp
    20052006    platform/graphics/texmap/TextureMapperLayer.cpp
  • trunk/Source/WebCore/ChangeLog

    r142594 r142595  
     12013-02-12  Huang Dongsung  <luxtella@company100.net>
     2
     3        [TexMap] Apply frames-per-second debug counter to WK1.
     4        https://bugs.webkit.org/show_bug.cgi?id=109540
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        r142524 implemented frames-per-second debug counter on WK2. This patch
     9        applies frames-per-second debug counter to WK1 also.
     10
     11        Visual debugging feature, no need for new tests.
     12
     13        * CMakeLists.txt:
     14        * GNUmakefile.list.am:
     15        * Target.pri:
     16        * platform/graphics/texmap/TextureMapper.h:
     17        * platform/graphics/texmap/TextureMapperFPSCounter.cpp: Added.
     18        (WebCore):
     19        (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
     20        (WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
     21        * platform/graphics/texmap/TextureMapperFPSCounter.h: Added.
     22        (WebCore):
     23        (TextureMapperFPSCounter):
     24        * platform/graphics/texmap/TextureMapperGL.cpp:
     25        (WebCore):
     26        (WebCore::TextureMapperGL::drawNumber):
     27          Rename from drawRepaintCounter to drawNumber.
     28        * platform/graphics/texmap/TextureMapperGL.h:
     29        * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
     30        (WebCore::TextureMapperImageBuffer::drawNumber):
     31        * platform/graphics/texmap/TextureMapperImageBuffer.h:
     32        (TextureMapperImageBuffer):
     33        * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
     34        (WebCore::TextureMapperTiledBackingStore::drawRepaintCounter):
     35        * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
     36        (WebCore::CoordinatedBackingStore::drawRepaintCounter):
     37        * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
     38          Move frames-per-second debug counter code to TextureMapperFPSCounter.
     39        (WebCore::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
     40        (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext):
     41        (WebCore::CoordinatedGraphicsScene::paintToGraphicsContext):
     42        * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
     43
    1442013-02-11  Yury Semikhatsky  <yurys@chromium.org>
    245
  • trunk/Source/WebCore/GNUmakefile.list.am

    r142573 r142595  
    64856485        Source/WebCore/platform/graphics/texmap/TextureMapper.cpp \
    64866486        Source/WebCore/platform/graphics/texmap/TextureMapper.h \
     6487        Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.cpp \
     6488        Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.h \
    64876489        Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp \
    64886490        Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h \
  • trunk/Source/WebCore/Target.pri

    r142573 r142595  
    22722272    platform/graphics/texmap/TextureMapper.h \
    22732273    platform/graphics/texmap/TextureMapperBackingStore.h \
     2274    platform/graphics/texmap/TextureMapperFPSCounter.h \
    22742275    platform/graphics/texmap/TextureMapperImageBuffer.h \
    22752276    platform/graphics/texmap/TextureMapperLayer.h \
     
    29082909    platform/graphics/texmap/TextureMapper.cpp \
    29092910    platform/graphics/texmap/TextureMapperBackingStore.cpp \
     2911    platform/graphics/texmap/TextureMapperFPSCounter.cpp \
    29102912    platform/graphics/texmap/TextureMapperImageBuffer.cpp \
    29112913    platform/graphics/texmap/TextureMapperLayer.cpp \
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h

    r140821 r142595  
    131131
    132132    virtual void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) = 0;
    133     virtual void drawRepaintCounter(int repaintCount, const Color&, const FloatPoint&, const TransformationMatrix&) = 0;
     133    virtual void drawNumber(int number, const Color&, const FloatPoint&, const TransformationMatrix&) = 0;
    134134
    135135    virtual void drawTexture(const BitmapTexture&, const FloatRect& target, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0f, const BitmapTexture* maskTexture = 0, unsigned exposedEdges = AllEdges) = 0;
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp

    r141807 r142595  
    322322}
    323323
    324 void TextureMapperGL::drawRepaintCounter(int repaintCount, const Color& color, const FloatPoint& targetPoint, const TransformationMatrix& modelViewMatrix)
     324// FIXME: drawNumber() should save a number texture-atlas and re-use whenever possible.
     325void TextureMapperGL::drawNumber(int number, const Color& color, const FloatPoint& targetPoint, const TransformationMatrix& modelViewMatrix)
    325326{
    326327    int pointSize = 8;
    327328#if PLATFORM(QT)
    328     QString counterString = QString::number(repaintCount);
     329    QString counterString = QString::number(number);
    329330
    330331    QFont font(QString::fromLatin1("Monospace"), pointSize, QFont::Bold);
     
    352353
    353354#elif USE(CAIRO)
    354     CString counterString = String::number(repaintCount).ascii();
     355    CString counterString = String::number(number).ascii();
    355356    // cairo_text_extents() requires a cairo_t, so dimensions need to be guesstimated.
    356357    int width = counterString.length() * pointSize * 1.2;
     
    386387
    387388#else
    388     UNUSED_PARAM(repaintCount);
     389    UNUSED_PARAM(number);
    389390    UNUSED_PARAM(pointSize);
    390391    UNUSED_PARAM(targetPoint);
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h

    r140821 r142595  
    5454    // TextureMapper implementation
    5555    virtual void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) OVERRIDE;
    56     virtual void drawRepaintCounter(int repaintCount, const Color&, const FloatPoint&, const TransformationMatrix&) OVERRIDE;
     56    virtual void drawNumber(int number, const Color&, const FloatPoint&, const TransformationMatrix&) OVERRIDE;
    5757    virtual void drawTexture(const BitmapTexture&, const FloatRect&, const TransformationMatrix&, float opacity, const BitmapTexture* maskTexture, unsigned exposedEdges) OVERRIDE;
    5858    virtual void drawTexture(Platform3DObject texture, Flags, const IntSize& textureSize, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity, const BitmapTexture* maskTexture, unsigned exposedEdges = AllEdges);
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp

    r140821 r142595  
    171171}
    172172
    173 void TextureMapperImageBuffer::drawRepaintCounter(int /* repaintCount */, const Color&, const FloatPoint&, const TransformationMatrix&)
     173void TextureMapperImageBuffer::drawNumber(int /* number */, const Color&, const FloatPoint&, const TransformationMatrix&)
    174174{
    175175    notImplemented();
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h

    r140821 r142595  
    5555    // TextureMapper implementation
    5656    virtual void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) OVERRIDE;
    57     virtual void drawRepaintCounter(int repaintCount, const Color&, const FloatPoint&, const TransformationMatrix&) OVERRIDE;
     57    virtual void drawNumber(int number, const Color&, const FloatPoint&, const TransformationMatrix&) OVERRIDE;
    5858    virtual void drawTexture(const BitmapTexture&, const FloatRect& targetRect, const TransformationMatrix&, float opacity, const BitmapTexture* maskTexture, unsigned exposedEdges) OVERRIDE;
    5959    virtual void drawSolidColor(const FloatRect&, const TransformationMatrix&, const Color&) OVERRIDE;
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp

    r142366 r142595  
    6767    TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
    6868    for (size_t i = 0; i < m_tiles.size(); ++i)
    69         textureMapper->drawRepaintCounter(repaintCount, borderColor, m_tiles[i].rect().location(), adjustedTransform);
     69        textureMapper->drawNumber(repaintCount, borderColor, m_tiles[i].rect().location(), adjustedTransform);
    7070}
    7171
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp

    r141543 r142595  
    170170    CoordinatedBackingStoreTileMap::iterator end = m_tiles.end();
    171171    for (CoordinatedBackingStoreTileMap::iterator it = m_tiles.begin(); it != end; ++it)
    172         textureMapper->drawRepaintCounter(repaintCount, borderColor, it->value.rect().location(), adjustedTransform);
     172        textureMapper->drawNumber(repaintCount, borderColor, it->value.rect().location(), adjustedTransform);
    173173}
    174174
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp

    r142586 r142595  
    3333#include <OpenGLShims.h>
    3434#include <wtf/Atomics.h>
    35 #include <wtf/CurrentTime.h>
    3635#include <wtf/MainThread.h>
    3736
     
    6867    , m_backgroundColor(Color::white)
    6968    , m_setDrawsBackground(false)
    70     , m_isShowingFPS(false)
    71     , m_fpsInterval(0)
    72     , m_fpsTimestamp(0)
    73     , m_lastFPS(0)
    74     , m_frameCount(0)
    7569{
    7670    ASSERT(isMainThread());
    77 
    78     String showFPSEnvironment = getenv("WEBKIT_SHOW_FPS");
    79     bool ok = false;
    80     m_fpsInterval = showFPSEnvironment.toDouble(&ok);
    81     if (ok && m_fpsInterval) {
    82         m_isShowingFPS = true;
    83         m_fpsTimestamp = WTF::currentTime();
    84     }
    8571}
    8672
     
    129115
    130116    layer->paint();
    131     if (m_isShowingFPS)
    132         updateFPS(clipRect.location(), matrix);
     117    m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), clipRect.location(), matrix);
    133118    m_textureMapper->endClip();
    134119    m_textureMapper->endPainting();
     
    183168
    184169    layer->paint();
    185     if (m_isShowingFPS)
    186         updateFPS(clipRect.location());
     170    m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), clipRect.location());
    187171    m_textureMapper->endPainting();
    188172    m_textureMapper->setGraphicsContext(0);
     
    696680}
    697681
    698 void CoordinatedGraphicsScene::updateFPS(const FloatPoint& location, const TransformationMatrix& matrix)
    699 {
    700     m_frameCount++;
    701     double delta = WTF::currentTime() - m_fpsTimestamp;
    702     if (delta >= m_fpsInterval) {
    703         m_lastFPS = int(m_frameCount / delta);
    704         m_frameCount = 0;
    705         m_fpsTimestamp += delta;
    706     }
    707 
    708     // FIXME: drawRepaintCounter() should save a texture and re-use whenever possible.
    709     m_textureMapper->drawRepaintCounter(m_lastFPS, Color::black, location, matrix);
    710 }
    711 
    712682} // namespace WebCore
    713683
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h

    r142586 r142595  
    3333#include "TextureMapper.h"
    3434#include "TextureMapperBackingStore.h"
     35#include "TextureMapperFPSCounter.h"
    3536#include "Timer.h"
    3637#include <wtf/Functional.h>
     
    173174    void resetBackingStoreSizeToLayerSize(GraphicsLayer*);
    174175
    175     void updateFPS(const FloatPoint&, const TransformationMatrix& = TransformationMatrix());
    176 
    177176    // Render queue can be accessed ony from main thread or updatePaintNode call stack!
    178177    Vector<Function<void()> > m_renderQueue;
     
    223222#endif
    224223
    225     bool m_isShowingFPS;
    226     double m_fpsInterval;
    227     double m_fpsTimestamp;
    228     int m_lastFPS;
    229     int m_frameCount;
     224    TextureMapperFPSCounter m_fpsCounter;
    230225};
    231226
  • trunk/Source/WebKit/efl/ChangeLog

    r142576 r142595  
     12013-02-12  Huang Dongsung  <luxtella@company100.net>
     2
     3        [TexMap] Apply frames-per-second debug counter to WK1.
     4        https://bugs.webkit.org/show_bug.cgi?id=109540
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        Make AcceleratedCompositingContextEfl use TextureMapperFPSCounter.
     9
     10        * WebCoreSupport/AcceleratedCompositingContextEfl.cpp:
     11        (WebCore::AcceleratedCompositingContext::renderLayers):
     12        * WebCoreSupport/AcceleratedCompositingContextEfl.h:
     13        (AcceleratedCompositingContext):
     14
    1152013-02-11  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp

    r141238 r142595  
    9090    m_textureMapper->beginPainting();
    9191    m_rootTextureMapperLayer->paint();
     92    m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get());
    9293    m_textureMapper->endPainting();
    9394}
  • trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h

    r140261 r142595  
    2626#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL)
    2727
     28#include "TextureMapperFPSCounter.h"
    2829#include "ewk_private.h"
    2930
     
    5758
    5859    RefPtr<GraphicsContext3D> m_context3D;
     60    TextureMapperFPSCounter m_fpsCounter;
    5961};
    6062
  • trunk/Source/WebKit/gtk/ChangeLog

    r142576 r142595  
     12013-02-12  Huang Dongsung  <luxtella@company100.net>
     2
     3        [TexMap] Apply frames-per-second debug counter to WK1.
     4        https://bugs.webkit.org/show_bug.cgi?id=109540
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        Make AcceleratedCompositingContext use TextureMapperFPSCounter.
     9
     10        * WebCoreSupport/AcceleratedCompositingContext.h:
     11        * WebCoreSupport/AcceleratedCompositingContextGL.cpp:
     12        (WebKit::AcceleratedCompositingContext::compositeLayersToContext):
     13
    1142013-02-11  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h

    r137483 r142595  
    3535#include "GLContext.h"
    3636#include "RedirectedXCompositeWindow.h"
     37#include "TextureMapperFPSCounter.h"
    3738#endif
    3839
     
    8990    double m_redrawPendingTime;
    9091    bool m_needsExtraFlush;
     92    WebCore::TextureMapperFPSCounter m_fpsCounter;
    9193
    9294    void layerFlushTimerFired();
  • trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextGL.cpp

    r141238 r142595  
    190190    m_textureMapper->beginPainting();
    191191    toTextureMapperLayer(m_rootLayer.get())->paint();
     192    m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get());
    192193    m_textureMapper->endPainting();
    193194
  • trunk/Source/WebKit/qt/ChangeLog

    r142576 r142595  
     12013-02-12  Huang Dongsung  <luxtella@company100.net>
     2
     3        [TexMap] Apply frames-per-second debug counter to WK1.
     4        https://bugs.webkit.org/show_bug.cgi?id=109540
     5
     6        Reviewed by Noam Rosenthal.
     7
     8        Make TextureMapperLayerClientQt use TextureMapperFPSCounter.
     9
     10        * WebCoreSupport/TextureMapperLayerClientQt.cpp:
     11        (TextureMapperLayerClientQt::renderCompositedLayers):
     12        * WebCoreSupport/TextureMapperLayerClientQt.h:
     13        (TextureMapperLayerClientQt):
     14
    1152013-02-11  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp

    r141238 r142595  
    123123    m_textureMapper->beginClip(matrix, clip);
    124124    m_rootTextureMapperLayer->paint();
     125    m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), IntPoint::zero(), matrix);
    125126    m_textureMapper->endClip();
    126127    m_textureMapper->endPainting();
  • trunk/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.h

    r136235 r142595  
    2626#include "GraphicsLayer.h"
    2727#include "TextureMapper.h"
     28#include "TextureMapperFPSCounter.h"
    2829#include "Timer.h"
    2930#include <wtf/OwnPtr.h>
     
    5455    WebCore::TextureMapperLayer* m_rootTextureMapperLayer;
    5556    OwnPtr<WebCore::TextureMapper> m_textureMapper;
     57    WebCore::TextureMapperFPSCounter m_fpsCounter;
    5658};
    5759#endif
Note: See TracChangeset for help on using the changeset viewer.