Changeset 174367 in webkit


Ignore:
Timestamp:
Oct 6, 2014 2:52:42 PM (10 years ago)
Author:
Simon Fraser
Message:

Don't attempt to paint into zero-sized backing store
https://bugs.webkit.org/show_bug.cgi?id=137465

Reviewed by Tim Horton.

Page scale could cause the backing store for a small composited element to become empty,
in which case we'd try to allocate, and paint into a graphics context with no surface
behind it.

Fix by bailing from RemoteLayerBackingStore::display() when checking the backing store
size after accounting for scale.

  • Shared/mac/RemoteLayerBackingStore.h:
  • Shared/mac/RemoteLayerBackingStore.mm:

(WebKit::RemoteLayerBackingStore::backingStoreSize):
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
(WebKit::RemoteLayerBackingStore::display):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r174351 r174367  
     12014-10-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Don't attempt to paint into zero-sized backing store
     4        https://bugs.webkit.org/show_bug.cgi?id=137465
     5
     6        Reviewed by Tim Horton.
     7       
     8        Page scale could cause the backing store for a small composited element to become empty,
     9        in which case we'd try to allocate, and paint into a graphics context with no surface
     10        behind it.
     11       
     12        Fix by bailing from RemoteLayerBackingStore::display() when checking the backing store
     13        size after accounting for scale.
     14
     15        * Shared/mac/RemoteLayerBackingStore.h:
     16        * Shared/mac/RemoteLayerBackingStore.mm:
     17        (WebKit::RemoteLayerBackingStore::backingStoreSize):
     18        (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
     19        (WebKit::RemoteLayerBackingStore::display):
     20
    1212014-10-06  Christophe Dumez  <cdumez@apple.com>
    222
  • trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.h

    r170923 r174367  
    9797    void clearBackingStore();
    9898    void swapToValidFrontBuffer();
     99   
     100    WebCore::IntSize backingStoreSize() const;
    99101
    100102    PlatformCALayerRemote* m_layer;
  • trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm

    r173710 r174367  
    172172}
    173173
    174 void RemoteLayerBackingStore::swapToValidFrontBuffer()
     174IntSize RemoteLayerBackingStore::backingStoreSize() const
    175175{
    176176    FloatSize scaledSize = m_size;
    177177    scaledSize.scale(m_scale);
    178     IntSize expandedScaledSize = roundedIntSize(scaledSize);
     178    return roundedIntSize(scaledSize);
     179}
     180
     181void RemoteLayerBackingStore::swapToValidFrontBuffer()
     182{
     183    IntSize expandedScaledSize = backingStoreSize();
    179184
    180185#if USE(IOSURFACE)
     
    216221    setBufferVolatility(BufferType::Front, false);
    217222
    218     if (m_dirtyRegion.isEmpty() || m_size.isEmpty())
     223    IntSize expandedScaledSize = backingStoreSize();
     224
     225    if (m_dirtyRegion.isEmpty() || expandedScaledSize.isEmpty())
    219226        return false;
    220227
     
    228235    }
    229236
    230     FloatSize scaledSize = m_size;
    231     scaledSize.scale(m_scale);
    232     IntSize expandedScaledSize = roundedIntSize(scaledSize);
    233237    IntRect expandedScaledLayerBounds(IntPoint(), expandedScaledSize);
    234238    bool willPaintEntireBackingStore = m_dirtyRegion.contains(layerBounds);
Note: See TracChangeset for help on using the changeset viewer.