Changeset 86808 in webkit


Ignore:
Timestamp:
May 18, 2011 5:38:20 PM (13 years ago)
Author:
enne@google.com
Message:

2011-05-16 Adrienne Walker <enne@google.com>

Reviewed by James Robinson.

[chromium] Robustly handle mapTexSubImage2D returning NULL
https://bugs.webkit.org/show_bug.cgi?id=60934

Also, lazily create the temp buffer so that both the map and non-map
cases can use it.

  • platform/graphics/chromium/LayerTextureSubImage.cpp: (WebCore::LayerTextureSubImage::setSubImageSize): (WebCore::LayerTextureSubImage::uploadWithTexSubImage): (WebCore::LayerTextureSubImage::uploadWithMapTexSubImage):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86807 r86808  
     12011-05-16  Adrienne Walker  <enne@google.com>
     2
     3        Reviewed by James Robinson.
     4
     5        [chromium] Robustly handle mapTexSubImage2D returning NULL
     6        https://bugs.webkit.org/show_bug.cgi?id=60934
     7
     8        Also, lazily create the temp buffer so that both the map and non-map
     9        cases can use it.
     10
     11        * platform/graphics/chromium/LayerTextureSubImage.cpp:
     12        (WebCore::LayerTextureSubImage::setSubImageSize):
     13        (WebCore::LayerTextureSubImage::uploadWithTexSubImage):
     14        (WebCore::LayerTextureSubImage::uploadWithMapTexSubImage):
     15
    1162011-05-18  Emil A Eklund  <eae@chromium.org>
    217
  • trunk/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp

    r86805 r86808  
    5050
    5151    m_subImageSize = subImageSize;
    52     if (!m_useMapTexSubImage)
    53         m_subImage = adoptArrayPtr(new uint8_t[m_subImageSize.width() * m_subImageSize.height() * 4]);
     52    m_subImage.clear();
    5453}
    5554
     
    6867                                                 GraphicsContext3D* context)
    6968{
     69    if (!m_subImage)
     70        m_subImage = adoptArrayPtr(new uint8_t[m_subImageSize.width() * m_subImageSize.height() * 4]);
     71
    7072    // Offset from image-rect to source-rect.
    7173    IntPoint offset(sourceRect.x() - imageRect.x(), sourceRect.y() - imageRect.y());
     
    9799    Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context->getExtensions());
    98100    uint8_t* pixelDest = static_cast<uint8_t*>(extensions->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, destRect.x(), destRect.y(), destRect.width(), destRect.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY));
    99     ASSERT(pixelDest);
     101
     102    if (!pixelDest) {
     103        uploadWithTexSubImage(image, imageRect, sourceRect, destRect, context);
     104        return;
     105    }
     106
    100107    if (imageRect.width() == sourceRect.width() && !offset.x())
    101108        memcpy(pixelDest, &image[4 * offset.y() * imageRect.width()], imageRect.width() * destRect.height() * 4);
Note: See TracChangeset for help on using the changeset viewer.