Unreviewed, rolling out r118580.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 May 2012 11:13:04 +0000 (11:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 May 2012 11:13:04 +0000 (11:13 +0000)
http://trac.webkit.org/changeset/118580
https://bugs.webkit.org/show_bug.cgi?id=87647

Caused webkit_unit_tests to crash on chromium. (Requested by
bulach on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-05-28

* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerPainter::create):
(WebCore::ContentLayerPainter::paint):
(WebCore::ContentLayerPainter::ContentLayerPainter):
(ContentLayerPainter):
(WebCore::ContentLayerChromium::createTextureUpdaterIfNeeded):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(UpdatableTile):
(WebCore::UpdatableTile::UpdatableTile):
(WebCore::TiledLayerChromium::updateTiles):
* platform/graphics/chromium/TiledLayerChromium.h:
(TiledLayerChromium):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::CCSettings::CCSettings):
(CCSettings):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118673 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h

index 4cd7bc8..a4712b9 100644 (file)
@@ -1,3 +1,28 @@
+2012-05-28  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r118580.
+        http://trac.webkit.org/changeset/118580
+        https://bugs.webkit.org/show_bug.cgi?id=87647
+
+        Caused webkit_unit_tests to crash on chromium. (Requested by
+        bulach on #webkit).
+
+        * platform/graphics/chromium/ContentLayerChromium.cpp:
+        (WebCore::ContentLayerPainter::create):
+        (WebCore::ContentLayerPainter::paint):
+        (WebCore::ContentLayerPainter::ContentLayerPainter):
+        (ContentLayerPainter):
+        (WebCore::ContentLayerChromium::createTextureUpdaterIfNeeded):
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (UpdatableTile):
+        (WebCore::UpdatableTile::UpdatableTile):
+        (WebCore::TiledLayerChromium::updateTiles):
+        * platform/graphics/chromium/TiledLayerChromium.h:
+        (TiledLayerChromium):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        (WebCore::CCSettings::CCSettings):
+        (CCSettings):
+
 2012-05-28  Peter Beverloo  <peter@chromium.org>
 
         &AElig doesn't get rendered as U+00C6
index b86ad31..ae8d320 100644 (file)
@@ -49,9 +49,9 @@ namespace WebCore {
 class ContentLayerPainter : public LayerPainterChromium {
     WTF_MAKE_NONCOPYABLE(ContentLayerPainter);
 public:
-    static PassOwnPtr<ContentLayerPainter> create(ContentLayerDelegate* delegate, TiledLayerChromium* layer)
+    static PassOwnPtr<ContentLayerPainter> create(ContentLayerDelegate* delegate)
     {
-        return adoptPtr(new ContentLayerPainter(delegate, layer));
+        return adoptPtr(new ContentLayerPainter(delegate));
     }
 
     virtual void paint(GraphicsContext& context, const IntRect& contentRect)
@@ -59,27 +59,19 @@ public:
         double paintStart = currentTime();
         context.clearRect(contentRect);
         context.clip(contentRect);
-        {
-            GraphicsContextStateSaver stateSaver(context, m_layer->layerTreeHost()->settings().debugShowTileInfo);
-
-            m_delegate->paintContents(context, contentRect);
-            double paintEnd = currentTime();
-            double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintEnd - paintStart);
-            WebKit::Platform::current()->histogramCustomCounts("Renderer4.AccelContentPaintDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30);
-            WebKit::Platform::current()->histogramCustomCounts("Renderer4.AccelContentPaintMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30);
-        }
-        if (m_layer->layerTreeHost()->settings().debugShowTileInfo)
-            m_layer->paintDebugTileInfo(context, contentRect);
+        m_delegate->paintContents(context, contentRect);
+        double paintEnd = currentTime();
+        double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintEnd - paintStart);
+        WebKit::Platform::current()->histogramCustomCounts("Renderer4.AccelContentPaintDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30);
+        WebKit::Platform::current()->histogramCustomCounts("Renderer4.AccelContentPaintMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30);
     }
 private:
-    explicit ContentLayerPainter(ContentLayerDelegate* delegate, TiledLayerChromium* layer)
+    explicit ContentLayerPainter(ContentLayerDelegate* delegate)
         : m_delegate(delegate)
-        , m_layer(layer)
     {
     }
 
     ContentLayerDelegate* m_delegate;
-    TiledLayerChromium* m_layer;
 };
 
 PassRefPtr<ContentLayerChromium> ContentLayerChromium::create(ContentLayerDelegate* delegate)
@@ -134,11 +126,11 @@ void ContentLayerChromium::createTextureUpdaterIfNeeded()
     if (m_textureUpdater)
         return;
     if (layerTreeHost()->settings().acceleratePainting)
-        m_textureUpdater = FrameBufferSkPictureCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate, this));
+        m_textureUpdater = FrameBufferSkPictureCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate));
     else if (layerTreeHost()->settings().perTilePainting)
-        m_textureUpdater = BitmapSkPictureCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate, this), layerTreeHost()->layerRendererCapabilities().usingMapSub);
+        m_textureUpdater = BitmapSkPictureCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate), layerTreeHost()->layerRendererCapabilities().usingMapSub);
     else
-        m_textureUpdater = BitmapCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate, this), layerTreeHost()->layerRendererCapabilities().usingMapSub);
+        m_textureUpdater = BitmapCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate), layerTreeHost()->layerRendererCapabilities().usingMapSub);
     m_textureUpdater->setOpaque(opaque());
 
     GC3Denum textureFormat = layerTreeHost()->layerRendererCapabilities().bestTextureFormat;
index d029d77..17c351f 100644 (file)
 
 #include "TiledLayerChromium.h"
 
-#include "FontCache.h"
-#include "FontDescription.h"
 #include "GraphicsContext3D.h"
 #include "LayerRendererChromium.h"
 #include "ManagedTexture.h"
 #include "Region.h"
-#include "TextRun.h"
 #include "TextStream.h"
 #include "TraceEvent.h"
 
@@ -76,15 +73,11 @@ public:
     bool partialUpdate;
     bool updated;
     bool isInUseOnImpl;
-    int lastUpdateFrame;
-    int totalPaintCount;
 private:
     explicit UpdatableTile(PassOwnPtr<LayerTextureUpdater::Texture> texture)
         : partialUpdate(false)
         , updated(false)
         , isInUseOnImpl(false)
-        , lastUpdateFrame(0)
-        , totalPaintCount(0)
         , m_texture(texture)
     {
     }
@@ -416,13 +409,6 @@ void TiledLayerChromium::updateTiles(bool idle, int left, int top, int right, in
                 return;
             }
 
-            if (tile->isDirty() && layerTreeHost()->settings().debugShowTileInfo) {
-                // Invalidate the entire tile so that text updates.
-                tile->dirtyRect = m_tiler->tileRect(tile);
-                tile->lastUpdateFrame = layerTreeHost()->frameNumber();
-                tile->totalPaintCount++;
-            }
-
             paintRect.unite(tile->dirtyRect);
         }
     }
@@ -726,71 +712,5 @@ IntRect TiledLayerChromium::idlePaintRect(const IntRect& visibleLayerRect)
     return prepaintRect;
 }
 
-void TiledLayerChromium::paintDebugTileInfo(GraphicsContext& context, const IntRect& layerRect)
-{
-    FontCachePurgePreventer fontCachePurgePreventer;
-
-    // Don't bother writing info onto small tiles.
-    const int minDimension = 200;
-    if (m_tiler->tileSize().width() < minDimension || m_tiler->tileSize().height() < minDimension)
-        return;
-
-    if (!m_debugInfoFont) {
-        FontDescription fontDesc;
-        fontDesc.setGenericFamily(FontDescription::MonospaceFamily);
-        fontDesc.setComputedSize(10);
-        m_debugInfoFont = adoptPtr(new Font(fontDesc, 0, 0));
-        m_debugInfoFont->update(0);
-    }
-
-    int fontHeight = m_debugInfoFont->fontMetrics().floatHeight() + 2;
-
-    int left, top, right, bottom;
-    m_tiler->layerRectToTileIndices(layerRect, left, top, right, bottom);
-    for (int j = top; j <= bottom; ++j) {
-        for (int i = left; i <= right; ++i) {
-            UpdatableTile* tile = tileAt(i, j);
-            if (!tile)
-                continue;
-
-            IntRect tileRect = m_tiler->tileRect(tile);
-            String info[] = {
-                String::format("LayerId(%d)", id()),
-                String::format("Index(%d, %d)", i, j),
-                String::format("Tile(%d, %d, %d, %d)", tileRect.x(), tileRect.y(), tileRect.width(), tileRect.height()),
-                String::format("Frame(%d)", tile->lastUpdateFrame),
-                String::format("Count(%d)", tile->totalPaintCount),
-                String::format("Layer(%d, %d)", contentBounds().width(), contentBounds().height()),
-            };
-            const size_t lines = sizeof(info) / sizeof(info[0]);
-            int width[lines];
-
-            IntPoint center = m_tiler->tileRect(tile).center();
-            int currentY = center.y() - fontHeight * lines / 2;
-
-            int maxWidth = 0;
-            for (size_t i = 0; i < lines; ++i) {
-                width[i] = m_debugInfoFont->width(TextRun(info[i]));
-                maxWidth = max(width[i], maxWidth);
-            }
-
-            IntRect textRect(IntPoint(center.x() - maxWidth / 2, currentY - fontHeight / 2), IntSize(maxWidth, fontHeight * lines + fontHeight / 2));
-
-            context.setFillColor(Color(192, 192, 192, 192), ColorSpaceDeviceRGB);
-            context.fillRect(FloatRect(textRect));
-
-            context.setFillColor(Color(64, 64, 64), ColorSpaceDeviceRGB);
-
-            for (size_t i = 0; i < lines; ++i) {
-                TextRun run(info[i]);
-                int textWidth = m_debugInfoFont->width(run);
-                IntPoint textStart(center.x() - textWidth / 2, currentY + fontHeight / 2);
-                context.drawText(*m_debugInfoFont, run, textStart);
-                currentY += fontHeight;
-            }
-        }
-    }
-}
-
 }
 #endif // USE(ACCELERATED_COMPOSITING)
index ebc4ee4..ca389f2 100644 (file)
@@ -28,7 +28,6 @@
 
 #if USE(ACCELERATED_COMPOSITING)
 
-#include "Font.h"
 #include "LayerChromium.h"
 #include "cc/CCLayerTilingData.h"
 #include "cc/CCTiledLayerImpl.h"
@@ -66,8 +65,6 @@ public:
 
     virtual Region visibleContentOpaqueRegion() const OVERRIDE;
 
-    void paintDebugTileInfo(GraphicsContext&, const IntRect&);
-
 protected:
     TiledLayerChromium();
 
@@ -130,7 +127,6 @@ private:
 
     TilingOption m_tilingOption;
     OwnPtr<CCLayerTilingData> m_tiler;
-    OwnPtr<Font> m_debugInfoFont;
 };
 
 }
index 7146023..ecec23b 100644 (file)
@@ -77,7 +77,6 @@ protected:
 struct CCSettings {
     CCSettings()
             : acceleratePainting(false)
-            , debugShowTileInfo(false)
             , showFPSCounter(false)
             , showPlatformLayerTree(false)
             , showPaintRects(false)
@@ -94,7 +93,6 @@ struct CCSettings {
     { }
 
     bool acceleratePainting;
-    bool debugShowTileInfo;
     bool showFPSCounter;
     bool showPlatformLayerTree;
     bool showPaintRects;