Changeset 142595 in webkit
- Timestamp:
- Feb 12, 2013 1:34:40 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r142573 r142595 2002 2002 platform/graphics/texmap/TextureMapper.cpp 2003 2003 platform/graphics/texmap/TextureMapperBackingStore.cpp 2004 platform/graphics/texmap/TextureMapperFPSCounter.cpp 2004 2005 platform/graphics/texmap/TextureMapperImageBuffer.cpp 2005 2006 platform/graphics/texmap/TextureMapperLayer.cpp -
trunk/Source/WebCore/ChangeLog
r142594 r142595 1 2013-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 1 44 2013-02-11 Yury Semikhatsky <yurys@chromium.org> 2 45 -
trunk/Source/WebCore/GNUmakefile.list.am
r142573 r142595 6485 6485 Source/WebCore/platform/graphics/texmap/TextureMapper.cpp \ 6486 6486 Source/WebCore/platform/graphics/texmap/TextureMapper.h \ 6487 Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.cpp \ 6488 Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.h \ 6487 6489 Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp \ 6488 6490 Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h \ -
trunk/Source/WebCore/Target.pri
r142573 r142595 2272 2272 platform/graphics/texmap/TextureMapper.h \ 2273 2273 platform/graphics/texmap/TextureMapperBackingStore.h \ 2274 platform/graphics/texmap/TextureMapperFPSCounter.h \ 2274 2275 platform/graphics/texmap/TextureMapperImageBuffer.h \ 2275 2276 platform/graphics/texmap/TextureMapperLayer.h \ … … 2908 2909 platform/graphics/texmap/TextureMapper.cpp \ 2909 2910 platform/graphics/texmap/TextureMapperBackingStore.cpp \ 2911 platform/graphics/texmap/TextureMapperFPSCounter.cpp \ 2910 2912 platform/graphics/texmap/TextureMapperImageBuffer.cpp \ 2911 2913 platform/graphics/texmap/TextureMapperLayer.cpp \ -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h
r140821 r142595 131 131 132 132 virtual void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) = 0; 133 virtual void draw RepaintCounter(int repaintCount, const Color&, const FloatPoint&, const TransformationMatrix&) = 0;133 virtual void drawNumber(int number, const Color&, const FloatPoint&, const TransformationMatrix&) = 0; 134 134 135 135 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 322 322 } 323 323 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. 325 void TextureMapperGL::drawNumber(int number, const Color& color, const FloatPoint& targetPoint, const TransformationMatrix& modelViewMatrix) 325 326 { 326 327 int pointSize = 8; 327 328 #if PLATFORM(QT) 328 QString counterString = QString::number( repaintCount);329 QString counterString = QString::number(number); 329 330 330 331 QFont font(QString::fromLatin1("Monospace"), pointSize, QFont::Bold); … … 352 353 353 354 #elif USE(CAIRO) 354 CString counterString = String::number( repaintCount).ascii();355 CString counterString = String::number(number).ascii(); 355 356 // cairo_text_extents() requires a cairo_t, so dimensions need to be guesstimated. 356 357 int width = counterString.length() * pointSize * 1.2; … … 386 387 387 388 #else 388 UNUSED_PARAM( repaintCount);389 UNUSED_PARAM(number); 389 390 UNUSED_PARAM(pointSize); 390 391 UNUSED_PARAM(targetPoint); -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
r140821 r142595 54 54 // TextureMapper implementation 55 55 virtual void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) OVERRIDE; 56 virtual void draw RepaintCounter(int repaintCount, const Color&, const FloatPoint&, const TransformationMatrix&) OVERRIDE;56 virtual void drawNumber(int number, const Color&, const FloatPoint&, const TransformationMatrix&) OVERRIDE; 57 57 virtual void drawTexture(const BitmapTexture&, const FloatRect&, const TransformationMatrix&, float opacity, const BitmapTexture* maskTexture, unsigned exposedEdges) OVERRIDE; 58 58 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 171 171 } 172 172 173 void TextureMapperImageBuffer::draw RepaintCounter(int /* repaintCount*/, const Color&, const FloatPoint&, const TransformationMatrix&)173 void TextureMapperImageBuffer::drawNumber(int /* number */, const Color&, const FloatPoint&, const TransformationMatrix&) 174 174 { 175 175 notImplemented(); -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
r140821 r142595 55 55 // TextureMapper implementation 56 56 virtual void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) OVERRIDE; 57 virtual void draw RepaintCounter(int repaintCount, const Color&, const FloatPoint&, const TransformationMatrix&) OVERRIDE;57 virtual void drawNumber(int number, const Color&, const FloatPoint&, const TransformationMatrix&) OVERRIDE; 58 58 virtual void drawTexture(const BitmapTexture&, const FloatRect& targetRect, const TransformationMatrix&, float opacity, const BitmapTexture* maskTexture, unsigned exposedEdges) OVERRIDE; 59 59 virtual void drawSolidColor(const FloatRect&, const TransformationMatrix&, const Color&) OVERRIDE; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp
r142366 r142595 67 67 TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect); 68 68 for (size_t i = 0; i < m_tiles.size(); ++i) 69 textureMapper->draw RepaintCounter(repaintCount, borderColor, m_tiles[i].rect().location(), adjustedTransform);69 textureMapper->drawNumber(repaintCount, borderColor, m_tiles[i].rect().location(), adjustedTransform); 70 70 } 71 71 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp
r141543 r142595 170 170 CoordinatedBackingStoreTileMap::iterator end = m_tiles.end(); 171 171 for (CoordinatedBackingStoreTileMap::iterator it = m_tiles.begin(); it != end; ++it) 172 textureMapper->draw RepaintCounter(repaintCount, borderColor, it->value.rect().location(), adjustedTransform);172 textureMapper->drawNumber(repaintCount, borderColor, it->value.rect().location(), adjustedTransform); 173 173 } 174 174 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp
r142586 r142595 33 33 #include <OpenGLShims.h> 34 34 #include <wtf/Atomics.h> 35 #include <wtf/CurrentTime.h>36 35 #include <wtf/MainThread.h> 37 36 … … 68 67 , m_backgroundColor(Color::white) 69 68 , m_setDrawsBackground(false) 70 , m_isShowingFPS(false)71 , m_fpsInterval(0)72 , m_fpsTimestamp(0)73 , m_lastFPS(0)74 , m_frameCount(0)75 69 { 76 70 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 }85 71 } 86 72 … … 129 115 130 116 layer->paint(); 131 if (m_isShowingFPS) 132 updateFPS(clipRect.location(), matrix); 117 m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), clipRect.location(), matrix); 133 118 m_textureMapper->endClip(); 134 119 m_textureMapper->endPainting(); … … 183 168 184 169 layer->paint(); 185 if (m_isShowingFPS) 186 updateFPS(clipRect.location()); 170 m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), clipRect.location()); 187 171 m_textureMapper->endPainting(); 188 172 m_textureMapper->setGraphicsContext(0); … … 696 680 } 697 681 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 712 682 } // namespace WebCore 713 683 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h
r142586 r142595 33 33 #include "TextureMapper.h" 34 34 #include "TextureMapperBackingStore.h" 35 #include "TextureMapperFPSCounter.h" 35 36 #include "Timer.h" 36 37 #include <wtf/Functional.h> … … 173 174 void resetBackingStoreSizeToLayerSize(GraphicsLayer*); 174 175 175 void updateFPS(const FloatPoint&, const TransformationMatrix& = TransformationMatrix());176 177 176 // Render queue can be accessed ony from main thread or updatePaintNode call stack! 178 177 Vector<Function<void()> > m_renderQueue; … … 223 222 #endif 224 223 225 bool m_isShowingFPS; 226 double m_fpsInterval; 227 double m_fpsTimestamp; 228 int m_lastFPS; 229 int m_frameCount; 224 TextureMapperFPSCounter m_fpsCounter; 230 225 }; 231 226 -
trunk/Source/WebKit/efl/ChangeLog
r142576 r142595 1 2013-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 1 15 2013-02-11 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp
r141238 r142595 90 90 m_textureMapper->beginPainting(); 91 91 m_rootTextureMapperLayer->paint(); 92 m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get()); 92 93 m_textureMapper->endPainting(); 93 94 } -
trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.h
r140261 r142595 26 26 #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL) 27 27 28 #include "TextureMapperFPSCounter.h" 28 29 #include "ewk_private.h" 29 30 … … 57 58 58 59 RefPtr<GraphicsContext3D> m_context3D; 60 TextureMapperFPSCounter m_fpsCounter; 59 61 }; 60 62 -
trunk/Source/WebKit/gtk/ChangeLog
r142576 r142595 1 2013-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 1 14 2013-02-11 Ryosuke Niwa <rniwa@webkit.org> 2 15 -
trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h
r137483 r142595 35 35 #include "GLContext.h" 36 36 #include "RedirectedXCompositeWindow.h" 37 #include "TextureMapperFPSCounter.h" 37 38 #endif 38 39 … … 89 90 double m_redrawPendingTime; 90 91 bool m_needsExtraFlush; 92 WebCore::TextureMapperFPSCounter m_fpsCounter; 91 93 92 94 void layerFlushTimerFired(); -
trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextGL.cpp
r141238 r142595 190 190 m_textureMapper->beginPainting(); 191 191 toTextureMapperLayer(m_rootLayer.get())->paint(); 192 m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get()); 192 193 m_textureMapper->endPainting(); 193 194 -
trunk/Source/WebKit/qt/ChangeLog
r142576 r142595 1 2013-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 1 15 2013-02-11 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp
r141238 r142595 123 123 m_textureMapper->beginClip(matrix, clip); 124 124 m_rootTextureMapperLayer->paint(); 125 m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), IntPoint::zero(), matrix); 125 126 m_textureMapper->endClip(); 126 127 m_textureMapper->endPainting(); -
trunk/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.h
r136235 r142595 26 26 #include "GraphicsLayer.h" 27 27 #include "TextureMapper.h" 28 #include "TextureMapperFPSCounter.h" 28 29 #include "Timer.h" 29 30 #include <wtf/OwnPtr.h> … … 54 55 WebCore::TextureMapperLayer* m_rootTextureMapperLayer; 55 56 OwnPtr<WebCore::TextureMapper> m_textureMapper; 57 WebCore::TextureMapperFPSCounter m_fpsCounter; 56 58 }; 57 59 #endif
Note: See TracChangeset
for help on using the changeset viewer.