diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp')
-rw-r--r-- | WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp b/WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp index 6a84b79..068f73d 100644 --- a/WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp +++ b/WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp @@ -79,9 +79,8 @@ static RetainPtr<CGContextRef> getDifferenceBitmap(CGImageRef testBitmap, CGImag return 0; RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); - static CFMutableDataRef data = CFDataCreateMutable(kCFAllocatorDefault, 0); - CFDataSetLength(data, CGImageGetHeight(testBitmap) * CGImageGetBytesPerRow(testBitmap)); - RetainPtr<CGContextRef> context(AdoptCF, CGBitmapContextCreate(CFDataGetMutableBytePtr(data), CGImageGetWidth(testBitmap), CGImageGetHeight(testBitmap), + unsigned char* data = new unsigned char[CGImageGetHeight(testBitmap) * CGImageGetBytesPerRow(testBitmap)]; + RetainPtr<CGContextRef> context(AdoptCF, CGBitmapContextCreate(data, CGImageGetWidth(testBitmap), CGImageGetHeight(testBitmap), CGImageGetBitsPerComponent(testBitmap), CGImageGetBytesPerRow(testBitmap), colorSpace.get(), kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst)); CGContextSetBlendMode(context.get(), kCGBlendModeNormal); |