Changeset 90831 in webkit
- Timestamp:
- Jul 12, 2011 11:31:53 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90830 r90831 1 2011-07-12 Mike Reed <reed@google.com> 2 3 [skia] optimize getImageData to avoid a copy when not needed. lockPixels() now does the right thing. 4 https://bugs.webkit.org/show_bug.cgi?id=64302 5 6 Reviewed by Stephen White. 7 8 No new tests. Just an optimization for getImageData(), existing <canvas> tests apply 9 10 * platform/graphics/skia/ImageBufferSkia.cpp: 11 (WebCore::getImageData): 12 (WebCore::putImageData): 13 1 14 2011-07-12 Pavel Feldman <pfeldman@google.com> 2 15 -
trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
r90645 r90831 224 224 225 225 SkBitmap srcBitmap; 226 srcDevice.readPixels(SkIRect::MakeXYWH(originX, originY, numColumns, numRows), &srcBitmap); 226 SkIRect srcRect = SkIRect::MakeXYWH(originX, originY, numColumns, numRows); 227 if (!srcDevice.accessBitmap(false).extractSubset(&srcBitmap, srcRect)) 228 return result.release(); 229 SkAutoLockPixels alp(srcBitmap); 227 230 228 231 unsigned char* destRow = data + destY * destBytesPerRow + destX * 4; … … 299 302 unsigned srcBytesPerRow = 4 * sourceSize.width(); 300 303 301 SkBitmap deviceBitmap = dstDevice->accessBitmap(true); 302 303 // If the device's bitmap doesn't have pixels we will make a temp and call writePixels on the device. 304 bool temporaryBitmap = !!deviceBitmap.getTexture(); 304 const SkBitmap& deviceBitmap = dstDevice->accessBitmap(true); 305 bool temporaryBitmap = !deviceBitmap.lockPixelsAreWritable(); 305 306 SkBitmap destBitmap; 306 307
Note: See TracChangeset
for help on using the changeset viewer.