Title: [86808] trunk/Source/WebCore
- Revision
- 86808
- Author
- [email protected]
- Date
- 2011-05-18 17:38:20 -0700 (Wed, 18 May 2011)
Log Message
2011-05-16 Adrienne Walker <[email protected]>
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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (86807 => 86808)
--- trunk/Source/WebCore/ChangeLog 2011-05-19 00:16:40 UTC (rev 86807)
+++ trunk/Source/WebCore/ChangeLog 2011-05-19 00:38:20 UTC (rev 86808)
@@ -1,3 +1,18 @@
+2011-05-16 Adrienne Walker <[email protected]>
+
+ 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):
+
2011-05-18 Emil A Eklund <[email protected]>
Reviewed by Darin Adler.
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp (86807 => 86808)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp 2011-05-19 00:16:40 UTC (rev 86807)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerTextureSubImage.cpp 2011-05-19 00:38:20 UTC (rev 86808)
@@ -49,8 +49,7 @@
return;
m_subImageSize = subImageSize;
- if (!m_useMapTexSubImage)
- m_subImage = adoptArrayPtr(new uint8_t[m_subImageSize.width() * m_subImageSize.height() * 4]);
+ m_subImage.clear();
}
void LayerTextureSubImage::upload(const uint8_t* image, const IntRect& imageRect,
@@ -67,6 +66,9 @@
const IntRect& sourceRect, const IntRect& destRect,
GraphicsContext3D* context)
{
+ if (!m_subImage)
+ m_subImage = adoptArrayPtr(new uint8_t[m_subImageSize.width() * m_subImageSize.height() * 4]);
+
// Offset from image-rect to source-rect.
IntPoint offset(sourceRect.x() - imageRect.x(), sourceRect.y() - imageRect.y());
@@ -96,7 +98,12 @@
// Upload tile data via a mapped transfer buffer
Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context->getExtensions());
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));
- ASSERT(pixelDest);
+
+ if (!pixelDest) {
+ uploadWithTexSubImage(image, imageRect, sourceRect, destRect, context);
+ return;
+ }
+
if (imageRect.width() == sourceRect.width() && !offset.x())
memcpy(pixelDest, &image[4 * offset.y() * imageRect.width()], imageRect.width() * destRect.height() * 4);
else {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes