⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 118673 in webkit


Ignore:
Timestamp:
May 28, 2012, 4:13:04 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

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).

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):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r118672 r118673  
     12012-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
    1262012-05-28  Peter Beverloo  <peter@chromium.org>
    227
  • trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp

    r118580 r118673  
    5050    WTF_MAKE_NONCOPYABLE(ContentLayerPainter);
    5151public:
    52     static PassOwnPtr<ContentLayerPainter> create(ContentLayerDelegate* delegate, TiledLayerChromium* layer)
     52    static PassOwnPtr<ContentLayerPainter> create(ContentLayerDelegate* delegate)
    5353    {
    54         return adoptPtr(new ContentLayerPainter(delegate, layer));
     54        return adoptPtr(new ContentLayerPainter(delegate));
    5555    }
    5656
     
    6060        context.clearRect(contentRect);
    6161        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);
    7367    }
    7468private:
    75     explicit ContentLayerPainter(ContentLayerDelegate* delegate, TiledLayerChromium* layer)
     69    explicit ContentLayerPainter(ContentLayerDelegate* delegate)
    7670        : m_delegate(delegate)
    77         , m_layer(layer)
    7871    {
    7972    }
    8073
    8174    ContentLayerDelegate* m_delegate;
    82     TiledLayerChromium* m_layer;
    8375};
    8476
     
    135127        return;
    136128    if (layerTreeHost()->settings().acceleratePainting)
    137         m_textureUpdater = FrameBufferSkPictureCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate, this));
     129        m_textureUpdater = FrameBufferSkPictureCanvasLayerTextureUpdater::create(ContentLayerPainter::create(m_delegate));
    138130    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);
    140132    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);
    142134    m_textureUpdater->setOpaque(opaque());
    143135
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp

    r118580 r118673  
    3030#include "TiledLayerChromium.h"
    3131
    32 #include "FontCache.h"
    33 #include "FontDescription.h"
    3432#include "GraphicsContext3D.h"
    3533#include "LayerRendererChromium.h"
    3634#include "ManagedTexture.h"
    3735#include "Region.h"
    38 #include "TextRun.h"
    3936#include "TextStream.h"
    4037#include "TraceEvent.h"
     
    7774    bool updated;
    7875    bool isInUseOnImpl;
    79     int lastUpdateFrame;
    80     int totalPaintCount;
    8176private:
    8277    explicit UpdatableTile(PassOwnPtr<LayerTextureUpdater::Texture> texture)
     
    8479        , updated(false)
    8580        , isInUseOnImpl(false)
    86         , lastUpdateFrame(0)
    87         , totalPaintCount(0)
    8881        , m_texture(texture)
    8982    {
     
    415408                }
    416409                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++;
    424410            }
    425411
     
    727713}
    728714
    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 
    795715}
    796716#endif // USE(ACCELERATED_COMPOSITING)
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h

    r118580 r118673  
    2929#if USE(ACCELERATED_COMPOSITING)
    3030
    31 #include "Font.h"
    3231#include "LayerChromium.h"
    3332#include "cc/CCLayerTilingData.h"
     
    6665
    6766    virtual Region visibleContentOpaqueRegion() const OVERRIDE;
    68 
    69     void paintDebugTileInfo(GraphicsContext&, const IntRect&);
    7067
    7168protected:
     
    131128    TilingOption m_tilingOption;
    132129    OwnPtr<CCLayerTilingData> m_tiler;
    133     OwnPtr<Font> m_debugInfoFont;
    134130};
    135131
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h

    r118580 r118673  
    7878    CCSettings()
    7979            : acceleratePainting(false)
    80             , debugShowTileInfo(false)
    8180            , showFPSCounter(false)
    8281            , showPlatformLayerTree(false)
     
    9594
    9695    bool acceleratePainting;
    97     bool debugShowTileInfo;
    9896    bool showFPSCounter;
    9997    bool showPlatformLayerTree;
Note: See TracChangeset for help on using the changeset viewer.