Changeset 79595 in webkit
- Timestamp:
- Feb 24, 2011 11:31:59 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r79592 r79595 1 2011-02-24 Misha Tyutyunik <michael.tyutyunik@nokia.com> 2 3 Reviewed by Andreas Kling. 4 5 [Qt] Dont use QPixmapCache if QPixmapCache::cacheLimit() is too small 6 (2048Kb for now). 7 https://bugs.webkit.org/show_bug.cgi?id=54887 8 9 No new tests required. 10 11 * platform/graphics/qt/GraphicsLayerQt.cpp: 12 (WebCore::GraphicsLayerQtImpl::allowAcceleratedCompositingCache): 13 (WebCore::GraphicsLayerQtImpl::drawLayerContent): 14 (WebCore::GraphicsLayerQtImpl::paint): 15 (WebCore::GraphicsLayerQtImpl::flushChanges): 16 1 17 2011-02-20 Martin Robinson <mrobinson@igalia.com> 2 18 -
trunk/Source/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
r76600 r79595 55 55 #endif 56 56 57 58 57 #define QT_DEBUG_RECACHE 0 59 58 #define QT_DEBUG_CACHEDUMP 0 … … 62 61 63 62 namespace WebCore { 63 64 static const int gMinimumPixmapCacheLimit = 2048; 64 65 65 66 #ifndef QT_NO_GRAPHICSEFFECT … … 207 208 virtual Color tiledBackingStoreBackgroundColor() const; 208 209 #endif 210 211 static bool allowAcceleratedCompositingCache() { return QPixmapCache::cacheLimit() > gMinimumPixmapCacheLimit; } 212 213 void drawLayerContent(QPainter*, const QRect&); 209 214 210 215 public slots: … … 382 387 } 383 388 389 390 void GraphicsLayerQtImpl::drawLayerContent(QPainter* painter, const QRect& clipRect) 391 { 392 painter->setClipRect(clipRect, Qt::IntersectClip); 393 painter->setCompositionMode(QPainter::CompositionMode_SourceOver); 394 GraphicsContext gc(painter); 395 m_layer->paintGraphicsLayerContents(gc, clipRect); 396 } 397 384 398 QPixmap GraphicsLayerQtImpl::recache(const QRegion& regionToUpdate) 385 399 { … … 631 645 case HTMLContentType: 632 646 if (m_state.drawsContent) { 633 QPixmap backingStore; 634 // We might need to recache, in case we try to paint and the cache was purged (e.g. if it was full). 635 if (!QPixmapCache::find(m_backingStore.key, &backingStore) || backingStore.size() != m_size.toSize()) 636 backingStore = recache(QRegion(m_state.contentsRect)); 637 const QRectF bounds(0, 0, m_backingStore.size.width(), m_backingStore.size.height()); 638 painter->drawPixmap(0, 0, backingStore); 647 if (!allowAcceleratedCompositingCache()) 648 drawLayerContent(painter, option->exposedRect.toRect()); 649 else { 650 QPixmap backingStore; 651 // We might need to recache, in case we try to paint and the cache was purged (e.g. if it was full). 652 if (!QPixmapCache::find(m_backingStore.key, &backingStore) || backingStore.size() != m_size.toSize()) 653 backingStore = recache(QRegion(m_state.contentsRect)); 654 const QRectF bounds(0, 0, m_backingStore.size.width(), m_backingStore.size.height()); 655 painter->drawPixmap(0, 0, backingStore); 656 } 639 657 } 640 658 break; … … 838 856 // We only need to do this for HTML content, there's no point in caching directly composited 839 857 // content like images or solid rectangles. 840 if (m_pendingContent.contentType == HTMLContentType )858 if (m_pendingContent.contentType == HTMLContentType && allowAcceleratedCompositingCache()) 841 859 recache(m_pendingContent.regionToUpdate); 842 860 #endif
Note: See TracChangeset
for help on using the changeset viewer.