Bug #: 4211
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Aug 2005 09:06:33 +0000 (09:06 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Aug 2005 09:06:33 +0000 (09:06 +0000)
Submitted by: eseidel
Reviewed by: darin
        * kcanvas/device/quartz/KCanvasItemQuartz.mm:
        (getSharedContext): moved from QPainter -> CG
        * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
        (CGShadingRefForLinearGradient): removed comment
        (CGShadingRefForRadialGradient): removed comment
        * khtml/ecma/kjs_html.cpp:
        (KJS::KJS::Context2DFunction::call): moved from QPainter -> CG
        (KJS::colorRefFromValue): moved from QPainter -> CG
        (KJS::Gradient::getShading): moved from QPainter -> CG
        * khtml/rendering/render_canvasimage.cpp:
        (RenderCanvasImage::createDrawingContext):moved from QPainter -> CG
        * kwq/KWQColor.mm:
        (CGColorFromNSColor): moved from QPainter -> CG
        * kwq/KWQPainter.h: removed colorspace calls
        * kwq/KWQPainter.mm: removed colorspace calls
        (QPainter::clearFocusRing): moved from QPainter -> CG
        Removed use of WebKitGraphicsBridge Colorspace SPIs, as well
        as corresponding QPainter colorspace "choke-point" methods.
        This fixes colors for WebCore+SVG (since it wasn't linking in
        webkit).  WebKit code removal in separate commit.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=4211

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9993 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kcanvas/device/quartz/KCanvasItemQuartz.mm
WebCore/kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm
WebCore/khtml/ecma/kjs_html.cpp
WebCore/khtml/rendering/render_canvasimage.cpp
WebCore/kwq/KWQColor.mm
WebCore/kwq/KWQPainter.h
WebCore/kwq/KWQPainter.mm

index 8006361f1525f2735aeabe580627b54ac2b6615a..45b70b1923a2035c819cb981c099da2403d9274c 100644 (file)
@@ -1,3 +1,29 @@
+2005-08-01  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by darin.
+
+        * kcanvas/device/quartz/KCanvasItemQuartz.mm:
+        (getSharedContext): moved from QPainter -> CG
+        * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
+        (CGShadingRefForLinearGradient): removed comment
+        (CGShadingRefForRadialGradient): removed comment
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::KJS::Context2DFunction::call): moved from QPainter -> CG
+        (KJS::colorRefFromValue): moved from QPainter -> CG
+        (KJS::Gradient::getShading): moved from QPainter -> CG
+        * khtml/rendering/render_canvasimage.cpp:
+        (RenderCanvasImage::createDrawingContext):moved from QPainter -> CG
+        * kwq/KWQColor.mm:
+        (CGColorFromNSColor): moved from QPainter -> CG
+        * kwq/KWQPainter.h: removed colorspace calls
+        * kwq/KWQPainter.mm: removed colorspace calls
+        (QPainter::clearFocusRing): moved from QPainter -> CG
+        Removed use of WebKitGraphicsBridge Colorspace SPIs, as well
+        as corresponding QPainter colorspace "choke-point" methods.
+        This fixes colors for WebCore+SVG (since it wasn't linking in
+        webkit).  WebKit code removal in separate commit.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=4211
+
 2005-07-31  Darin Adler  <darin@apple.com>
 
         Reviewed by Maciej.
index 4916ebc98da4d9ea46daa7b62a1892f4d088a424..a6cd1ecbe97291eb11cc7a6924eca085aab2604f 100644 (file)
@@ -139,7 +139,7 @@ CGContextRef getSharedContext() {
                CGDataConsumerRef consumer = CGDataConsumerCreateWithCFData(empty);
                sharedContext = CGPDFContextCreate(consumer, NULL, NULL);
                
-       //      CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
+       //      CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
        //      CGContextRef context = CGGLContextCreate(NULL, CGSizeMake(canvas->canvasWidth(), canvas->canvasHeight()), colorspace);
        //      CGColorSpaceRelease(colorspace);
                float black[4] = {0,0,0,1};
index cf8c07eee147c65f076d0b6504b0a37ffb63bbae..5d87f195ef5f6af5e588ef70bd7cb7532f434889 100644 (file)
@@ -170,7 +170,6 @@ static CGShadingRef CGShadingRefForLinearGradient(const KRenderingPaintServerLin
     const KRenderingPaintServerGradientQuartz *castServer = static_cast<const KRenderingPaintServerGradientQuartz *>(server);
     CGFunctionRef shadingFunction = CGFunctionCreate((void *)castServer, 1, domainLimits, 4, rangeLimits, &callbacks);
     
-    //CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
     CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
     CGShadingRef shading = CGShadingCreateAxial(colorSpace, start, end, shadingFunction, true, true);
     CGColorSpaceRelease(colorSpace);
@@ -202,7 +201,6 @@ static CGShadingRef CGShadingRefForRadialGradient(const KRenderingPaintServerRad
     const KRenderingPaintServerGradientQuartz *castServer = static_cast<const KRenderingPaintServerGradientQuartz *>(server);
     CGFunctionRef shadingFunction = CGFunctionCreate((void *)castServer, 1, domainLimits, 4, rangeLimits, &callbacks);
     
-    //CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
     CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
     CGShadingRef shading = CGShadingCreateRadial(colorSpace, focus, 0, center, radius, shadingFunction, true, true);
     CGColorSpaceRelease(colorSpace);
index f4834e9af5d6d80f54d71c137d07ade6529aff15..7791cc266a5a6bc29632386e60b000850579fddc 100644 (file)
@@ -4317,12 +4317,12 @@ Value KJS::Context2DFunction::call(ExecState *exec, Object &thisObj, const List
                             components[1] = qc.green()/255.;
                             components[2] = qc.blue()/255.;
                             components[3] = 1.0f;
-                            colorSpace = QPainter::rgbColorSpace();
+                            colorSpace = CGColorSpaceCreateDeviceRGB();
                         }
                         else {
                             components[0] = (float)args[3].toNumber(exec);
                             components[1] = 1.0f;
-                            colorSpace = QPainter::grayColorSpace();
+                            colorSpace = CGColorSpaceCreateDeviceGray();
                         }
                     }
                     break;
@@ -4335,12 +4335,12 @@ Value KJS::Context2DFunction::call(ExecState *exec, Object &thisObj, const List
                             components[1] = qc.green()/255.;
                             components[2] = qc.blue()/255.;
                             components[3] = a;
-                            colorSpace = QPainter::rgbColorSpace();
+                            colorSpace = CGColorSpaceCreateDeviceRGB();
                         }
                         else {
                             components[0] = (float)args[3].toNumber(exec);
                             components[1] = a;
-                            colorSpace = QPainter::grayColorSpace();
+                            colorSpace = CGColorSpaceCreateDeviceGray();
                         }
                     }
                     break;
@@ -4349,7 +4349,7 @@ Value KJS::Context2DFunction::call(ExecState *exec, Object &thisObj, const List
                         components[1] = (float)args[4].toNumber(exec); // g
                         components[2] = (float)args[5].toNumber(exec); // b
                         components[3] = (float)args[6].toNumber(exec); // a
-                        colorSpace = QPainter::rgbColorSpace();
+                        colorSpace = CGColorSpaceCreateDeviceRGB();
                     }
                     break;
                     case 5: {
@@ -4359,7 +4359,7 @@ Value KJS::Context2DFunction::call(ExecState *exec, Object &thisObj, const List
                         components[3] = (float)args[6].toNumber(exec); // k
                         components[4] = (float)args[7].toNumber(exec); // a
 
-                        colorSpace = QPainter::cmykColorSpace();
+                        colorSpace = CGColorSpaceCreateDeviceCMYK();
                     }
                     break;
                     default: {
@@ -4502,7 +4502,7 @@ Value KJS::Context2DFunction::call(ExecState *exec, Object &thisObj, const List
                     size_t csw = (size_t)sw;
                     size_t csh = (size_t)sh;
                                         
-                    CGColorSpaceRef colorSpace = QPainter::rgbColorSpace();
+                    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
                     size_t numComponents = CGColorSpaceGetNumberOfComponents(colorSpace);
                     size_t bytesPerRow = BYTES_PER_ROW(csw,BITS_PER_COMPONENT,(numComponents+1)); // + 1 for alpha
                     void *_drawingContextData = malloc(csh * bytesPerRow);
@@ -4791,7 +4791,7 @@ CGColorRef colorRefFromValue(ExecState *exec, const Value &value)
         components[1] = qc.green()/255.;
         components[2] = qc.blue()/255.;
         components[3] = qc.alpha();
-        colorSpace = QPainter::rgbColorSpace();
+        colorSpace = CGColorSpaceCreateDeviceRGB();
     }
     else
         return 0;
@@ -5300,7 +5300,7 @@ CGShadingRef Gradient::getShading()
         CGShadingRelease (_shadingRef);
         
     CGFunctionRef _colorFunction = CGFunctionCreate((void *)this, 1, intervalRangeDomin, 4, colorComponentRangeDomains, &gradientCallbacks);
-    CGColorSpaceRef colorSpace = QPainter::rgbColorSpace();
+    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
     
     if (_gradientType == Gradient::Radial) {    
         _shadingRef = CGShadingCreateRadial(colorSpace, CGPointMake(_x0,_y0), _r0, CGPointMake(_x1,_y1), _r1, _colorFunction, true, true);
index 9f304b454adf39dd8f063f5570ae4eeea42bb11b..7320039e7bf1e8fa333bae176d0b6660b3258d8e 100644 (file)
@@ -93,7 +93,7 @@ void RenderCanvasImage::createDrawingContext()
         _drawingContext = 0;
     }
     free (_drawingContextData);
-    CGColorSpaceRef colorSpace = QPainter::rgbColorSpace();
+    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
 
     int cWidth = contentWidth();
     int cHeight = contentHeight();
index 2262da0635cb8a84081b2ac4253c3576cdbd9e04..d205b07931cd1d8f820e4bb5b2e3b498fe18bb68 100644 (file)
@@ -341,7 +341,7 @@ static CGColorRef CGColorFromNSColor(NSColor *color)
     float alpha = [deviceColor alphaComponent];
     const float components[] = { red, green, blue, alpha };
     
-    CGColorSpaceRef colorSpace = QPainter::rgbColorSpace();
+    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
     CGColorRef cgColor = CGColorCreate(colorSpace, components);
     CGColorSpaceRelease(colorSpace);
     return cgColor;
index 1c76cffdd3b4dc160c77cc429968f7f1ee3fdd2f..8e6b84a9e3bb98c897a41ef4427e6bc896615f5f 100644 (file)
@@ -141,10 +141,6 @@ public:
     static void setCompositeOperation (CGContextRef context, QString operation);
     static void setCompositeOperation (CGContextRef context, int operation);
 
-    static CGColorSpaceRef rgbColorSpace();
-    static CGColorSpaceRef grayColorSpace();
-    static CGColorSpaceRef cmykColorSpace();
-
 private:
     // no copying or assignment
     QPainter(const QPainter &);
index c8153da83005a08f6e90bc01caa295f45a002a36..770b83444e5456fa81b03ce6872d2f00d93f3215 100644 (file)
@@ -890,20 +890,3 @@ void QPainter::clearFocusRing()
         data->focusRingPath = nil;
     }
 }
-
-CGColorSpaceRef QPainter::rgbColorSpace()
-{
-    return [[WebCoreGraphicsBridge sharedBridge] createRGBColorSpace];
-}
-
-CGColorSpaceRef QPainter::grayColorSpace()
-{
-    return [[WebCoreGraphicsBridge sharedBridge] createGrayColorSpace];
-}
-
-CGColorSpaceRef QPainter::cmykColorSpace()
-{
-    return [[WebCoreGraphicsBridge sharedBridge] createCMYKColorSpace];
-}
-
-