Changeset 74324 in webkit


Ignore:
Timestamp:
Dec 19, 2010 9:24:07 AM (13 years ago)
Author:
kenneth@webkit.org
Message:

2010-12-19 Kenneth Rohde Christiansen <kenneth@webkit.org>

Reviewed by Andreas Kling.

[Qt] [WK2] Client are expected to render their own background for WebPages
https://bugs.webkit.org/show_bug.cgi?id=51296

Remove the rendering of the checkerboard from the tiled DrawingAreaProxy

  • UIProcess/TiledDrawingAreaProxy.cpp: (WebKit::TiledDrawingAreaProxy::paint):
  • UIProcess/TiledDrawingAreaTile.h:
  • UIProcess/qt/TiledDrawingAreaTileQt.cpp:
Location:
trunk/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r74322 r74324  
     12010-12-19  Kenneth Rohde Christiansen  <kenneth@webkit.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] [WK2] Client are expected to render their own background for WebPages
     6        https://bugs.webkit.org/show_bug.cgi?id=51296
     7
     8        Remove the rendering of the checkerboard from the tiled DrawingAreaProxy
     9
     10        * UIProcess/TiledDrawingAreaProxy.cpp:
     11        (WebKit::TiledDrawingAreaProxy::paint):
     12        * UIProcess/TiledDrawingAreaTile.h:
     13        * UIProcess/qt/TiledDrawingAreaTileQt.cpp:
     14
    1152010-12-19  Benjamin Poulain  <benjamin.poulain@nokia.com>
    216
  • trunk/WebKit2/UIProcess/TiledDrawingAreaProxy.cpp

    r74294 r74324  
    347347            if (currentTile && currentTile->isReadyToPaint())
    348348                currentTile->paint(&gc, dirtyRect);
    349             else {
    350                 IntRect tileRect = tileRectForCoordinate(currentCoordinate);
    351                 IntRect target = intersection(tileRect, dirtyRect);
    352                 if (target.isEmpty())
    353                     continue;
    354                 TiledDrawingAreaTile::paintCheckerPattern(&gc, FloatRect(target));
    355             }
    356349        }
    357350    }
  • trunk/WebKit2/UIProcess/TiledDrawingAreaTile.h

    r72010 r74324  
    6666    void updateFromChunk(UpdateChunk* updateChunk, float);
    6767
    68     static void paintCheckerPattern(WebCore::GraphicsContext*, const WebCore::FloatRect&);
    69 
    7068    int ID() const { return m_ID; }
    7169
  • trunk/WebKit2/UIProcess/qt/TiledDrawingAreaTileQt.cpp

    r73221 r74324  
    4040
    4141namespace WebKit {
    42 
    43 static const unsigned checkerSize = 16;
    44 static const unsigned checkerColor1 = 0xff555555;
    45 static const unsigned checkerColor2 = 0xffaaaaaa;
    46 
    47 static QPixmap& checkeredPixmap()
    48 {
    49     static QPixmap* pixmap;
    50     if (!pixmap) {
    51         pixmap = new QPixmap(checkerSize, checkerSize);
    52         QPainter painter(pixmap);
    53         QColor color1(checkerColor1);
    54         QColor color2(checkerColor2);
    55         for (unsigned y = 0; y < checkerSize; y += checkerSize / 2) {
    56             bool alternate = y % checkerSize;
    57             for (unsigned x = 0; x < checkerSize; x += checkerSize / 2) {
    58                 painter.fillRect(x, y, checkerSize / 2, checkerSize / 2, alternate ? color1 : color2);
    59                 alternate = !alternate;
    60             }
    61         }
    62     }
    63     return *pixmap;
    64 }
    6542
    6643TiledDrawingAreaTile::TiledDrawingAreaTile(TiledDrawingAreaProxy* proxy, const Coordinate& tileCoordinate)
     
    140117}
    141118
    142 void TiledDrawingAreaTile::paintCheckerPattern(GraphicsContext* context, const FloatRect& target)
    143 {
    144     QPainter* painter = context->platformContext();
    145     QTransform worldTransform = painter->worldTransform();
    146     qreal scaleX = worldTransform.m11();
    147     qreal scaleY = worldTransform.m22();
    148 
    149     QRect targetViewRect = QRectF(target.x() * scaleX,
    150                                   target.y() * scaleY,
    151                                   target.width() * scaleX,
    152                                   target.height() * scaleY).toAlignedRect();
    153 
    154     QTransform adjustedTransform(1., worldTransform.m12(), worldTransform.m13(),
    155                                  worldTransform.m21(), 1., worldTransform.m23(),
    156                                  worldTransform.m31(), worldTransform.m32(), worldTransform.m33());
    157     painter->setWorldTransform(adjustedTransform);
    158 
    159     painter->drawTiledPixmap(targetViewRect,
    160                              checkeredPixmap(),
    161                              QPoint(targetViewRect.left() % checkerSize,
    162                                     targetViewRect.top() % checkerSize));
    163 
    164     painter->setWorldTransform(worldTransform);
    165 }
    166 
    167119void TiledDrawingAreaTile::updateFromChunk(UpdateChunk* updateChunk, float)
    168120{
Note: See TracChangeset for help on using the changeset viewer.