diff options
author | Ben Murdoch <benm@google.com> | 2010-08-11 14:44:44 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-08-12 19:15:41 +0100 |
commit | dd8bb3de4f353a81954234999f1fea748aee2ea9 (patch) | |
tree | 729b52bf09294f0d6c67cd5ea80aee1b727b7bd8 /WebCore/platform/graphics/cg | |
parent | f3d41ba51d86bf719c7a65ab5297aea3c17e2d98 (diff) | |
download | external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.zip external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.tar.gz external_webkit-dd8bb3de4f353a81954234999f1fea748aee2ea9.tar.bz2 |
Merge WebKit at r65072 : Initial merge by git.
Change-Id: Ibcf418498376b2660aacb7f8d46ea7085ef91585
Diffstat (limited to 'WebCore/platform/graphics/cg')
-rw-r--r-- | WebCore/platform/graphics/cg/ColorCG.cpp | 1 | ||||
-rw-r--r-- | WebCore/platform/graphics/cg/FontPlatformData.h | 2 | ||||
-rw-r--r-- | WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp | 30 | ||||
-rw-r--r-- | WebCore/platform/graphics/cg/ImageSourceCG.h | 3 |
4 files changed, 11 insertions, 25 deletions
diff --git a/WebCore/platform/graphics/cg/ColorCG.cpp b/WebCore/platform/graphics/cg/ColorCG.cpp index 9257642..6f05c38 100644 --- a/WebCore/platform/graphics/cg/ColorCG.cpp +++ b/WebCore/platform/graphics/cg/ColorCG.cpp @@ -66,6 +66,7 @@ Color::Color(CGColorRef color) } m_color = makeRGBA(r * 255, g * 255, b * 255, a * 255); + m_valid = true; } #if OS(WINDOWS) diff --git a/WebCore/platform/graphics/cg/FontPlatformData.h b/WebCore/platform/graphics/cg/FontPlatformData.h index 1da8916..b261f87 100644 --- a/WebCore/platform/graphics/cg/FontPlatformData.h +++ b/WebCore/platform/graphics/cg/FontPlatformData.h @@ -26,6 +26,7 @@ #include "RefCountedGDIHandle.h" #include "StringImpl.h" +#include <wtf/Forward.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/RetainPtr.h> @@ -36,7 +37,6 @@ typedef struct CGFont* CGFontRef; namespace WebCore { class FontDescription; -class String; class FontPlatformData { public: diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp index 8af3d0e..df14f9d 100644 --- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp +++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp @@ -111,34 +111,20 @@ void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imag if (!imagePixels || imageWidth <= 0 || imageHeight <= 0 || canvasWidth <= 0 || canvasHeight <= 0 || !context) return; int rowBytes = imageWidth * 4; - RetainPtr<CGDataProviderRef> dataProvider = CGDataProviderCreateWithData(0, imagePixels, rowBytes * imageHeight, 0); - RetainPtr<CGColorSpaceRef> colorSpace = CGColorSpaceCreateDeviceRGB(); - RetainPtr<CGImageRef> cgImage = CGImageCreate(imageWidth, - imageHeight, - 8, - 32, - rowBytes, - colorSpace.get(), - kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, - dataProvider.get(), - 0, - false, - kCGRenderingIntentDefault); + RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithData(0, imagePixels, rowBytes * imageHeight, 0)); + RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); + RetainPtr<CGImageRef> cgImage(AdoptCF, CGImageCreate(imageWidth, imageHeight, 8, 32, rowBytes, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, + dataProvider.get(), 0, false, kCGRenderingIntentDefault)); // CSS styling may cause the canvas's content to be resized on // the page. Go back to the Canvas to figure out the correct // width and height to draw. - CGRect rect = CGRectMake(0, 0, - canvasWidth, - canvasHeight); + CGRect rect = CGRectMake(0, 0, canvasWidth, canvasHeight); // We want to completely overwrite the previous frame's // rendering results. CGContextSaveGState(context); - CGContextSetBlendMode(context, - kCGBlendModeCopy); - CGContextSetInterpolationQuality(context, - kCGInterpolationNone); - CGContextDrawImage(context, - rect, cgImage.get()); + CGContextSetBlendMode(context, kCGBlendModeCopy); + CGContextSetInterpolationQuality(context, kCGInterpolationNone); + CGContextDrawImage(context, rect, cgImage.get()); CGContextRestoreGState(context); } diff --git a/WebCore/platform/graphics/cg/ImageSourceCG.h b/WebCore/platform/graphics/cg/ImageSourceCG.h index 76b4160..bff8162 100644 --- a/WebCore/platform/graphics/cg/ImageSourceCG.h +++ b/WebCore/platform/graphics/cg/ImageSourceCG.h @@ -27,11 +27,10 @@ #define ImageSourceCG_h #include "ImageSource.h" +#include <wtf/Forward.h> namespace WebCore { -class String; - String preferredExtensionForImageSourceType(const String& type); String MIMETypeForImageSourceType(const String& type); |