Changeset 106997 in webkit
- Timestamp:
- Feb 7, 2012 3:29:58 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106996 r106997 1 2012-02-07 David Reveman <reveman@chromium.org> 2 3 [Chromium] Crash when using per-tile painting on Windows. 4 https://bugs.webkit.org/show_bug.cgi?id=75715 5 6 Reviewed by James Robinson. 7 8 PlatformCanvas constructor on win32 expects forth argument to be a 9 shared section handle. Passing a pointer to a system memory causes 10 it to crash. Fix this by not using the PlatformCanvas API for 11 SkCanvas construction in per-tile texture uploader. 12 13 Tested with manual tests. 14 15 * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp: 16 (WebCore::BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect): 17 (WebCore::BitmapSkPictureCanvasLayerTextureUpdater::Texture::updateRect): 18 * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h: 19 (Texture): 20 1 21 2012-02-07 Jer Noble <jer.noble@apple.com> 2 22 -
trunk/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.cpp
r105314 r106997 34 34 #include "LayerPainterChromium.h" 35 35 #include "SkCanvas.h" 36 #include " skia/ext/platform_canvas.h"36 #include "SkDevice.h" 37 37 38 38 namespace WebCore { … … 46 46 void BitmapSkPictureCanvasLayerTextureUpdater::Texture::prepareRect(const IntRect& sourceRect) 47 47 { 48 size_t bufferSize = TextureManager::memoryUseBytes(sourceRect.size(), texture()->format()); 49 m_pixelData = adoptArrayPtr(new uint8_t[bufferSize]); 50 OwnPtr<SkCanvas> canvas = adoptPtr(new skia::PlatformCanvas(sourceRect.width(), sourceRect.height(), false, m_pixelData.get())); 48 m_device = adoptPtr(new SkDevice(SkBitmap::kARGB_8888_Config, sourceRect.width(), sourceRect.height())); 49 OwnPtr<SkCanvas> canvas = adoptPtr(new SkCanvas(m_device.get())); 51 50 textureUpdater()->paintContentsRect(canvas.get(), sourceRect); 52 51 } … … 55 54 { 56 55 texture()->bindTexture(context, allocator); 57 ASSERT(m_pixelData.get()); 58 textureUpdater()->updateTextureRect(context, texture()->format(), destRect, m_pixelData.get()); 59 m_pixelData.clear(); 56 57 ASSERT(m_device); 58 const SkBitmap* bitmap = &m_device->accessBitmap(false); 59 bitmap->lockPixels(); 60 textureUpdater()->updateTextureRect(context, texture()->format(), destRect, static_cast<uint8_t*>(bitmap->getPixels())); 61 bitmap->unlockPixels(); 62 m_device.clear(); 60 63 } 61 64 -
trunk/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
r105314 r106997 35 35 #include "SkPictureCanvasLayerTextureUpdater.h" 36 36 37 class SkDevice; 38 37 39 namespace WebCore { 38 40 … … 51 53 BitmapSkPictureCanvasLayerTextureUpdater* textureUpdater() { return m_textureUpdater; } 52 54 53 Own ArrayPtr<uint8_t> m_pixelData;55 OwnPtr<SkDevice> m_device; 54 56 BitmapSkPictureCanvasLayerTextureUpdater* m_textureUpdater; 55 57 };
Note: See TracChangeset
for help on using the changeset viewer.