summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/cg
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/cg')
-rw-r--r--WebCore/platform/graphics/cg/ColorCG.cpp1
-rw-r--r--WebCore/platform/graphics/cg/FontPlatformData.h2
-rw-r--r--WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp30
-rw-r--r--WebCore/platform/graphics/cg/ImageSourceCG.h3
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);