Changeset 118673 in webkit
- Timestamp:
- May 28, 2012, 4:13:04 AM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/chromium/ContentLayerChromium.cpp (modified) (3 diffs)
-
platform/graphics/chromium/TiledLayerChromium.cpp (modified) (5 diffs)
-
platform/graphics/chromium/TiledLayerChromium.h (modified) (3 diffs)
-
platform/graphics/chromium/cc/CCLayerTreeHost.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r118672 r118673 1 2012-05-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r118580. 4 http://trac.webkit.org/changeset/118580 5 https://bugs.webkit.org/show_bug.cgi?id=87647 6 7 Caused webkit_unit_tests to crash on chromium. (Requested by 8 bulach on #webkit). 9 10 * platform/graphics/chromium/ContentLayerChromium.cpp: 11 (WebCore::ContentLayerPainter::create): 12 (WebCore::ContentLayerPainter::paint): 13 (WebCore::ContentLayerPainter::ContentLayerPainter): 14 (ContentLayerPainter): 15 (WebCore::ContentLayerChromium::createTextureUpdaterIfNeeded): 16 * platform/graphics/chromium/TiledLayerChromium.cpp: 17 (UpdatableTile): 18 (WebCore::UpdatableTile::UpdatableTile): 19 (WebCore::TiledLayerChromium::updateTiles): 20 * platform/graphics/chromium/TiledLayerChromium.h: 21 (TiledLayerChromium): 22 * platform/graphics/chromium/cc/CCLayerTreeHost.h: 23 (WebCore::CCSettings::CCSettings): 24 (CCSettings): 25 1 26 2012-05-28 Peter Beverloo <peter@chromium.org> 2 27 -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
r118580 r118673 50 50 WTF_MAKE_NONCOPYABLE(ContentLayerPainter); 51 51 public: 52 static PassOwnPtr<ContentLayerPainter> create(ContentLayerDelegate* delegate , TiledLayerChromium* layer)52 static PassOwnPtr<ContentLayerPainter> create(ContentLayerDelegate* delegate) 53 53 { 54 return adoptPtr(new ContentLayerPainter(delegate , layer));54 return adoptPtr(new ContentLayerPainter(delegate)); 55 55 } 56 56 … … 60 60 context.clearRect(contentRect); 61 61 context.clip(contentRect); 62 { 63 GraphicsContextStateSaver stateSaver(context, m_layer->layerTreeHost()->settings().debugShowTileInfo); 64 65 m_delegate->paintContents(context, contentRect); 66 double paintEnd = currentTime(); 67 double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintEnd - paintStart); 68 WebKit::Platform::current()->histogramCustomCounts("Renderer4.AccelContentPaintDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30); 69 WebKit::Platform::current()->histogramCustomCounts("Renderer4.AccelContentPaintMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30); 70 } 71 if (m_layer->layerTreeHost()->settings().debugShowTileInfo) 72 m_layer->paintDebugTileInfo(context, contentRect); 62 m_delegate->paintContents(context, contentRect); 63 double paintEnd = currentTime(); 64 double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintEnd - paintStart); 65 WebKit::Platform::current()->histogramCustomCounts("Renderer4.AccelContentPaintDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30); 66 WebKit::Platform::current()->histogramCustomCounts("Renderer4.AccelContentPaintMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30); 73 67 } 74 68 private: 75 explicit ContentLayerPainter(ContentLayerDelegate* delegate , TiledLayerChromium* layer)69 explicit ContentLayerPainter(ContentLayerDelegate* delegate) 76 70 : m_delegate(delegate) 77 , m_layer(layer)78 71 { 79 72 } 80 73 81 74 ContentLayerDelegate* m_delegate; 82 TiledLayerChromium* m_layer;83 75 }; 84 76 … … 135 127 return; 136 128 if (layerTreeHost()->settings().acceleratePainting) 137 m_textureUpdater = FrameBufferSkPictureCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate , this));129 m_textureUpdater = FrameBufferSkPictureCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate)); 138 130 else if (layerTreeHost()->settings().perTilePainting) 139 m_textureUpdater = BitmapSkPictureCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate , this), layerTreeHost()->layerRendererCapabilities().usingMapSub);131 m_textureUpdater = BitmapSkPictureCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate), layerTreeHost()->layerRendererCapabilities().usingMapSub); 140 132 else 141 m_textureUpdater = BitmapCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate , this), layerTreeHost()->layerRendererCapabilities().usingMapSub);133 m_textureUpdater = BitmapCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate), layerTreeHost()->layerRendererCapabilities().usingMapSub); 142 134 m_textureUpdater->setOpaque(opaque()); 143 135 -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
r118580 r118673 30 30 #include "TiledLayerChromium.h" 31 31 32 #include "FontCache.h"33 #include "FontDescription.h"34 32 #include "GraphicsContext3D.h" 35 33 #include "LayerRendererChromium.h" 36 34 #include "ManagedTexture.h" 37 35 #include "Region.h" 38 #include "TextRun.h"39 36 #include "TextStream.h" 40 37 #include "TraceEvent.h" … … 77 74 bool updated; 78 75 bool isInUseOnImpl; 79 int lastUpdateFrame;80 int totalPaintCount;81 76 private: 82 77 explicit UpdatableTile(PassOwnPtr<LayerTextureUpdater::Texture> texture) … … 84 79 , updated(false) 85 80 , isInUseOnImpl(false) 86 , lastUpdateFrame(0)87 , totalPaintCount(0)88 81 , m_texture(texture) 89 82 { … … 415 408 } 416 409 return; 417 }418 419 if (tile->isDirty() && layerTreeHost()->settings().debugShowTileInfo) {420 // Invalidate the entire tile so that text updates.421 tile->dirtyRect = m_tiler->tileRect(tile);422 tile->lastUpdateFrame = layerTreeHost()->frameNumber();423 tile->totalPaintCount++;424 410 } 425 411 … … 727 713 } 728 714 729 void TiledLayerChromium::paintDebugTileInfo(GraphicsContext& context, const IntRect& layerRect)730 {731 FontCachePurgePreventer fontCachePurgePreventer;732 733 // Don't bother writing info onto small tiles.734 const int minDimension = 200;735 if (m_tiler->tileSize().width() < minDimension || m_tiler->tileSize().height() < minDimension)736 return;737 738 if (!m_debugInfoFont) {739 FontDescription fontDesc;740 fontDesc.setGenericFamily(FontDescription::MonospaceFamily);741 fontDesc.setComputedSize(10);742 m_debugInfoFont = adoptPtr(new Font(fontDesc, 0, 0));743 m_debugInfoFont->update(0);744 }745 746 int fontHeight = m_debugInfoFont->fontMetrics().floatHeight() + 2;747 748 int left, top, right, bottom;749 m_tiler->layerRectToTileIndices(layerRect, left, top, right, bottom);750 for (int j = top; j <= bottom; ++j) {751 for (int i = left; i <= right; ++i) {752 UpdatableTile* tile = tileAt(i, j);753 if (!tile)754 continue;755 756 IntRect tileRect = m_tiler->tileRect(tile);757 String info[] = {758 String::format("LayerId(%d)", id()),759 String::format("Index(%d, %d)", i, j),760 String::format("Tile(%d, %d, %d, %d)", tileRect.x(), tileRect.y(), tileRect.width(), tileRect.height()),761 String::format("Frame(%d)", tile->lastUpdateFrame),762 String::format("Count(%d)", tile->totalPaintCount),763 String::format("Layer(%d, %d)", contentBounds().width(), contentBounds().height()),764 };765 const size_t lines = sizeof(info) / sizeof(info[0]);766 int width[lines];767 768 IntPoint center = m_tiler->tileRect(tile).center();769 int currentY = center.y() - fontHeight * lines / 2;770 771 int maxWidth = 0;772 for (size_t i = 0; i < lines; ++i) {773 width[i] = m_debugInfoFont->width(TextRun(info[i]));774 maxWidth = max(width[i], maxWidth);775 }776 777 IntRect textRect(IntPoint(center.x() - maxWidth / 2, currentY - fontHeight / 2), IntSize(maxWidth, fontHeight * lines + fontHeight / 2));778 779 context.setFillColor(Color(192, 192, 192, 192), ColorSpaceDeviceRGB);780 context.fillRect(FloatRect(textRect));781 782 context.setFillColor(Color(64, 64, 64), ColorSpaceDeviceRGB);783 784 for (size_t i = 0; i < lines; ++i) {785 TextRun run(info[i]);786 int textWidth = m_debugInfoFont->width(run);787 IntPoint textStart(center.x() - textWidth / 2, currentY + fontHeight / 2);788 context.drawText(*m_debugInfoFont, run, textStart);789 currentY += fontHeight;790 }791 }792 }793 }794 795 715 } 796 716 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
r118580 r118673 29 29 #if USE(ACCELERATED_COMPOSITING) 30 30 31 #include "Font.h"32 31 #include "LayerChromium.h" 33 32 #include "cc/CCLayerTilingData.h" … … 66 65 67 66 virtual Region visibleContentOpaqueRegion() const OVERRIDE; 68 69 void paintDebugTileInfo(GraphicsContext&, const IntRect&);70 67 71 68 protected: … … 131 128 TilingOption m_tilingOption; 132 129 OwnPtr<CCLayerTilingData> m_tiler; 133 OwnPtr<Font> m_debugInfoFont;134 130 }; 135 131 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
r118580 r118673 78 78 CCSettings() 79 79 : acceleratePainting(false) 80 , debugShowTileInfo(false)81 80 , showFPSCounter(false) 82 81 , showPlatformLayerTree(false) … … 95 94 96 95 bool acceleratePainting; 97 bool debugShowTileInfo;98 96 bool showFPSCounter; 99 97 bool showPlatformLayerTree;
Note:
See TracChangeset
for help on using the changeset viewer.