Changeset 51212 in webkit
- Timestamp:
- Nov 19, 2009 3:36:58 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r51210 r51212 1 2009-11-19 Beth Dakin <bdakin@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Tests for https://bugs.webkit.org/show_bug.cgi?id=31321 Make 6 -webkit-color-correction work with untagged images 7 8 * fast/css/color-correction-on-background-image.html: Added. 9 * fast/css/color-correction-untagged-images.html: Added. 10 * fast/css/resources/purple-noprofile.png: Added. 11 * platform/mac/fast/css/color-correction-on-background-image-expected.checksum: Added. 12 * platform/mac/fast/css/color-correction-on-background-image-expected.png: Added. 13 * platform/mac/fast/css/color-correction-on-background-image-expected.txt: Added. 14 * platform/mac/fast/css/color-correction-untagged-images-expected.checksum: Added. 15 * platform/mac/fast/css/color-correction-untagged-images-expected.png: Added. 16 * platform/mac/fast/css/color-correction-untagged-images-expected.txt: Added. 17 1 18 2009-11-19 Michelangelo De Simone <michelangelo@webkit.org> 2 19 -
trunk/WebCore/ChangeLog
r51207 r51212 1 2009-11-19 Beth Dakin <bdakin@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Fix for https://bugs.webkit.org/show_bug.cgi?id=31321 Make -webkit- 6 color-correction work with untagged images 7 8 Image's draw(), drawPattern(), and fillWithSolidColor() functions 9 now take a ColorSpace. A bunch of classes inherit from Image, so 10 draw() and drawPattern() functions there must also take a 11 ColorSpace. 12 * platform/graphics/Image.cpp: 13 (WebCore::Image::fillWithSolidColor): 14 (WebCore::Image::drawTiled): 15 * platform/graphics/Image.h: 16 * platform/graphics/BitmapImage.h: 17 * platform/graphics/GeneratedImage.cpp: 18 (WebCore::GeneratedImage::draw): 19 (WebCore::GeneratedImage::drawPattern): 20 * platform/graphics/GeneratedImage.h: 21 * platform/graphics/cg/PDFDocumentImage.cpp: 22 (WebCore::PDFDocumentImage::draw): 23 * platform/graphics/cg/PDFDocumentImage.h: 24 * svg/graphics/SVGImage.cpp: 25 (WebCore::SVGImage::draw): 26 * svg/graphics/SVGImage.h: 27 28 All of the drawImage() functions and drawTiled() functions of 29 GraphicsContext now take a ColorSpace. 30 * platform/graphics/GraphicsContext.cpp: 31 (WebCore::GraphicsContext::drawImage): 32 (WebCore::GraphicsContext::drawTiledImage): 33 * platform/graphics/GraphicsContext.h: 34 35 This is where the actual work is done. 36 * platform/graphics/cg/ImageCG.cpp: 37 (WebCore::imageWithColorSpace): New static function that returns a 38 copy of the given image in the given ColorSpace *IF* we should use 39 the given ColorSpace. We will ignore the color space if the image 40 is tagged and return 0. 41 (WebCore::BitmapImage::draw): Now takes a ColorSpace and uses it to 42 call imageWithColorSpace(). 43 (WebCore::Image::drawPattern): Same. 44 45 Attempt to keep all ports building. 46 * platform/graphics/cairo/ImageCairo.cpp: 47 (WebCore::BitmapImage::draw): 48 (WebCore::Image::drawPattern): 49 * platform/graphics/haiku/ImageHaiku.cpp: 50 (WebCore::BitmapImage::draw): 51 (WebCore::Image::drawPattern): 52 * platform/graphics/qt/ImageQt.cpp: 53 (WebCore::Image::drawPattern): 54 (WebCore::BitmapImage::draw): 55 * platform/graphics/skia/BitmapImageSingleFrameSkia.h: 56 * platform/graphics/skia/ImageSkia.cpp: 57 (WebCore::Image::drawPattern): 58 (WebCore::BitmapImage::draw): 59 (WebCore::BitmapImageSingleFrameSkia::draw): 60 * platform/graphics/wx/ImageWx.cpp: 61 (WebCore::BitmapImage::draw): 62 (WebCore::BitmapImage::drawPattern): 63 64 Callers of GraphicsContext's drawImage() and drawTiled() functions 65 now need to send a ColorSpace. 66 * html/HTMLCanvasElement.cpp: 67 (WebCore::HTMLCanvasElement::paint): 68 * html/canvas/CanvasRenderingContext2D.cpp: 69 (WebCore::CanvasRenderingContext2D::drawImage): 70 (WebCore::CanvasRenderingContext2D::drawImageFromRect): 71 * platform/ScrollView.cpp: 72 (WebCore::ScrollView::wheelEvent): 73 * platform/graphics/filters/FEColorMatrix.cpp: 74 (WebCore::FEColorMatrix::apply): 75 * platform/graphics/filters/FEComposite.cpp: 76 (WebCore::FEComposite::apply): 77 * platform/graphics/filters/SourceGraphic.cpp: 78 (WebCore::SourceGraphic::apply): 79 * platform/mac/ScrollbarThemeMac.mm: 80 (WebCore::ScrollbarThemeMac::paint): 81 * rendering/RenderBoxModelObject.cpp: 82 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 83 (WebCore::RenderBoxModelObject::paintNinePieceImage): 84 * rendering/RenderImage.cpp: 85 (WebCore::RenderImage::paintReplaced): 86 * rendering/RenderLayer.cpp: 87 (WebCore::RenderLayer::paintResizer): 88 * rendering/RenderListMarker.cpp: 89 (WebCore::RenderListMarker::paint): 90 * rendering/RenderSVGImage.cpp: 91 (WebCore::RenderSVGImage::paint): 92 * rendering/RenderWidget.cpp: 93 (WebCore::RenderWidget::paint): 94 * svg/graphics/SVGPaintServerPattern.cpp: 95 (WebCore::SVGPaintServerPattern::setup): 96 * svg/graphics/SVGResourceFilter.cpp: 97 (WebCore::SVGResourceFilter::applyFilter): 98 * svg/graphics/filters/SVGFEMerge.cpp: 99 (WebCore::FEMerge::apply): 100 * svg/graphics/filters/SVGFEOffset.cpp: 101 (WebCore::FEOffset::apply): 102 * svg/graphics/filters/SVGFETile.cpp: 103 (WebCore::FETile::apply): 104 1 105 2009-11-19 Avi Drissman <avi@chromium.org> 2 106 -
trunk/WebCore/html/HTMLCanvasElement.cpp
r50725 r51212 260 260 Image* image = m_imageBuffer->image(); 261 261 if (image) 262 context->drawImage(image, r);262 context->drawImage(image, DeviceColorSpace, r); 263 263 } 264 264 -
trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r50910 r51212 1003 1003 FloatRect destRect = c->roundToDevicePixels(dstRect); 1004 1004 willDraw(destRect); 1005 c->drawImage(cachedImage->image(), destRect, sourceRect, state().m_globalComposite);1005 c->drawImage(cachedImage->image(), DeviceColorSpace, destRect, sourceRect, state().m_globalComposite); 1006 1006 } 1007 1007 … … 1053 1053 canvas()->setOriginTainted(); 1054 1054 1055 c->drawImage(buffer->image(), destRect, sourceRect, state().m_globalComposite);1055 c->drawImage(buffer->image(), DeviceColorSpace, destRect, sourceRect, state().m_globalComposite); 1056 1056 willDraw(destRect); // This call comes after drawImage, since the buffer we draw into may be our own, and we need to make sure it is dirty. 1057 1057 // FIXME: Arguably willDraw should become didDraw and occur after drawing calls and not before them to avoid problems like this. … … 1147 1147 FloatRect destRect = FloatRect(dx, dy, dw, dh); 1148 1148 willDraw(destRect); 1149 c->drawImage(cachedImage->image(), destRect, FloatRect(sx, sy, sw, sh), op);1149 c->drawImage(cachedImage->image(), DeviceColorSpace, destRect, FloatRect(sx, sy, sw, sh), op); 1150 1150 } 1151 1151 -
trunk/WebCore/platform/ScrollView.cpp
r49804 r51212 765 765 { 766 766 DEFINE_STATIC_LOCAL(Image*, panScrollIcon, (Image::loadPlatformResource("panIcon").releaseRef())); 767 context->drawImage(panScrollIcon, m_panScrollIconPoint);767 context->drawImage(panScrollIcon, DeviceColorSpace, m_panScrollIconPoint); 768 768 } 769 769 -
trunk/WebCore/platform/graphics/BitmapImage.h
r50416 r51212 166 166 167 167 #if PLATFORM(WIN) 168 virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, Co mpositeOperator);169 #endif 170 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, Co mpositeOperator);168 virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator); 169 #endif 170 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator); 171 171 172 172 #if PLATFORM(WX) || (PLATFORM(WINCE) && !PLATFORM(QT)) 173 173 virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const TransformationMatrix& patternTransform, 174 const FloatPoint& phase, Co mpositeOperator, const FloatRect& destRect);174 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect); 175 175 #endif 176 176 -
trunk/WebCore/platform/graphics/GeneratedImage.cpp
r46956 r51212 35 35 namespace WebCore { 36 36 37 void GeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, Co mpositeOperator compositeOp)37 void GeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp) 38 38 { 39 39 context->save(); … … 49 49 50 50 void GeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const TransformationMatrix& patternTransform, 51 const FloatPoint& phase, Co mpositeOperator compositeOp, const FloatRect& destRect)51 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& destRect) 52 52 { 53 53 // Create a BitmapImage and call drawPattern on it. … … 63 63 64 64 // Now just call drawTiled on that image. 65 bitmap->drawPattern(context, srcRect, patternTransform, phase, compositeOp, destRect);65 bitmap->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, compositeOp, destRect); 66 66 } 67 67 -
trunk/WebCore/platform/graphics/GeneratedImage.h
r39635 r51212 58 58 59 59 protected: 60 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, Co mpositeOperator);60 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator); 61 61 virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const TransformationMatrix& patternTransform, 62 const FloatPoint& phase, Co mpositeOperator, const FloatRect& destRect);62 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect); 63 63 64 64 GeneratedImage(PassRefPtr<Generator> generator, const IntSize& size) -
trunk/WebCore/platform/graphics/GraphicsContext.cpp
r51161 r51212 309 309 } 310 310 311 void GraphicsContext::drawImage(Image* image, const IntPoint& p, CompositeOperator op)312 { 313 drawImage(image, p, IntRect(0, 0, -1, -1), op);314 } 315 316 void GraphicsContext::drawImage(Image* image, const IntRect& r, CompositeOperator op, bool useLowQualityScale)317 { 318 drawImage(image, r, IntRect(0, 0, -1, -1), op, useLowQualityScale);319 } 320 321 void GraphicsContext::drawImage(Image* image, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op)322 { 323 drawImage(image, IntRect(dest, srcRect.size()), srcRect, op);324 } 325 326 void GraphicsContext::drawImage(Image* image, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, bool useLowQualityScale)327 { 328 drawImage(image, FloatRect(dest), srcRect, op, useLowQualityScale);311 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& p, CompositeOperator op) 312 { 313 drawImage(image, styleColorSpace, p, IntRect(0, 0, -1, -1), op); 314 } 315 316 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntRect& r, CompositeOperator op, bool useLowQualityScale) 317 { 318 drawImage(image, styleColorSpace, r, IntRect(0, 0, -1, -1), op, useLowQualityScale); 319 } 320 321 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op) 322 { 323 drawImage(image, styleColorSpace, IntRect(dest, srcRect.size()), srcRect, op); 324 } 325 326 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, bool useLowQualityScale) 327 { 328 drawImage(image, styleColorSpace, FloatRect(dest), srcRect, op, useLowQualityScale); 329 329 } 330 330 … … 432 432 } 433 433 434 void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, bool useLowQualityScale)434 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, bool useLowQualityScale) 435 435 { 436 436 if (paintingDisabled() || !image) … … 456 456 setImageInterpolationQuality(InterpolationNone); 457 457 } 458 image->draw(this, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), op);458 image->draw(this, FloatRect(dest.location(), FloatSize(tw, th)), FloatRect(src.location(), FloatSize(tsw, tsh)), styleColorSpace, op); 459 459 if (useLowQualityScale) 460 460 restore(); 461 461 } 462 462 463 void GraphicsContext::drawTiledImage(Image* image, const IntRect& rect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op)463 void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, const IntRect& rect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op) 464 464 { 465 465 if (paintingDisabled() || !image) 466 466 return; 467 467 468 image->drawTiled(this, rect, srcPoint, tileSize, op);469 } 470 471 void GraphicsContext::drawTiledImage(Image* image, const IntRect& dest, const IntRect& srcRect, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op)468 image->drawTiled(this, rect, srcPoint, tileSize, styleColorSpace, op); 469 } 470 471 void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, const IntRect& dest, const IntRect& srcRect, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op) 472 472 { 473 473 if (paintingDisabled() || !image) … … 476 476 if (hRule == Image::StretchTile && vRule == Image::StretchTile) 477 477 // Just do a scale. 478 return drawImage(image, dest, srcRect, op);479 480 image->drawTiled(this, dest, srcRect, hRule, vRule, op);478 return drawImage(image, styleColorSpace, dest, srcRect, op); 479 480 image->drawTiled(this, dest, srcRect, hRule, vRule, styleColorSpace, op); 481 481 } 482 482 -
trunk/WebCore/platform/graphics/GraphicsContext.h
r51143 r51212 214 214 void strokeRect(const FloatRect&, float lineWidth); 215 215 216 void drawImage(Image*, const IntPoint&, CompositeOperator = CompositeSourceOver);217 void drawImage(Image*, const IntRect&, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);218 void drawImage(Image*, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver);219 void drawImage(Image*, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);220 void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1),216 void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint&, CompositeOperator = CompositeSourceOver); 217 void drawImage(Image*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 218 void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver); 219 void drawImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 220 void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), 221 221 CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false); 222 void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize,222 void drawTiledImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize, 223 223 CompositeOperator = CompositeSourceOver); 224 void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect,224 void drawTiledImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect, 225 225 Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile, 226 226 CompositeOperator = CompositeSourceOver); -
trunk/WebCore/platform/graphics/Image.cpp
r50760 r51212 76 76 } 77 77 78 void Image::fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, const Color& color, Co mpositeOperator op)78 void Image::fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, const Color& color, ColorSpace styleColorSpace, CompositeOperator op) 79 79 { 80 80 if (color.alpha() <= 0) … … 83 83 ctxt->save(); 84 84 ctxt->setCompositeOperation(!color.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op); 85 ctxt->fillRect(dstRect, color, DeviceColorSpace);85 ctxt->fillRect(dstRect, color, styleColorSpace); 86 86 ctxt->restore(); 87 87 } … … 105 105 106 106 107 void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, Co mpositeOperator op)107 void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, ColorSpace styleColorSpace, CompositeOperator op) 108 108 { 109 109 if (mayFillWithSolidColor()) { 110 fillWithSolidColor(ctxt, destRect, solidColor(), op);110 fillWithSolidColor(ctxt, destRect, solidColor(), styleColorSpace, op); 111 111 return; 112 112 } … … 133 133 visibleSrcRect.setWidth(destRect.width() / scale.width()); 134 134 visibleSrcRect.setHeight(destRect.height() / scale.height()); 135 draw(ctxt, destRect, visibleSrcRect, op);135 draw(ctxt, destRect, visibleSrcRect, styleColorSpace, op); 136 136 return; 137 137 } … … 139 139 TransformationMatrix patternTransform = TransformationMatrix().scaleNonUniform(scale.width(), scale.height()); 140 140 FloatRect tileRect(FloatPoint(), intrinsicTileSize); 141 drawPattern(ctxt, tileRect, patternTransform, oneTileRect.location(), op, destRect);141 drawPattern(ctxt, tileRect, patternTransform, oneTileRect.location(), styleColorSpace, op, destRect); 142 142 143 143 startAnimation(); … … 145 145 146 146 // FIXME: Merge with the other drawTiled eventually, since we need a combination of both for some things. 147 void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, TileRule hRule, TileRule vRule, Co mpositeOperator op)147 void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator op) 148 148 { 149 149 if (mayFillWithSolidColor()) { 150 fillWithSolidColor(ctxt, dstRect, solidColor(), op);150 fillWithSolidColor(ctxt, dstRect, solidColor(), styleColorSpace, op); 151 151 return; 152 152 } … … 171 171 FloatPoint patternPhase(dstRect.x() - hPhase, dstRect.y() - vPhase); 172 172 173 drawPattern(ctxt, srcRect, patternTransform, patternPhase, op, dstRect);173 drawPattern(ctxt, srcRect, patternTransform, patternPhase, styleColorSpace, op, dstRect); 174 174 175 175 startAnimation(); -
trunk/WebCore/platform/graphics/Image.h
r45780 r51212 29 29 30 30 #include "Color.h" 31 #include "ColorSpace.h" 31 32 #include "GraphicsTypes.h" 32 33 #include "ImageSource.h" … … 155 156 Image(ImageObserver* = 0); 156 157 157 static void fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, const Color& color, CompositeOperator op);158 static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, const Color&, ColorSpace styleColorSpace, CompositeOperator); 158 159 160 // The ColorSpace parameter will only be used for untagged images. 159 161 #if PLATFORM(WIN) 160 virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, Co mpositeOperator) { }162 virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) { } 161 163 #endif 162 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, Co mpositeOperator) = 0;163 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, Co mpositeOperator);164 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, TileRule hRule, TileRule vRule, Co mpositeOperator);164 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator) = 0; 165 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, ColorSpace styleColorSpace, CompositeOperator); 166 void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator); 165 167 166 168 // Supporting tiled drawing … … 169 171 170 172 virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const TransformationMatrix& patternTransform, 171 const FloatPoint& phase, Co mpositeOperator, const FloatRect& destRect);173 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect); 172 174 173 175 private: -
trunk/WebCore/platform/graphics/cairo/ImageCairo.cpp
r50920 r51212 90 90 } 91 91 92 void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, Co mpositeOperator op)92 void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op) 93 93 { 94 94 FloatRect srcRect(src); … … 106 106 107 107 if (mayFillWithSolidColor()) { 108 fillWithSolidColor(context, dstRect, solidColor(), op);108 fillWithSolidColor(context, dstRect, solidColor(), styleColorSpace, op); 109 109 return; 110 110 } … … 172 172 173 173 void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, const TransformationMatrix& patternTransform, 174 const FloatPoint& phase, Co mpositeOperator op, const FloatRect& destRect)174 const FloatPoint& phase, ColorSpace, CompositeOperator op, const FloatRect& destRect) 175 175 { 176 176 cairo_surface_t* image = nativeImageForCurrentFrame(); -
trunk/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r51161 r51212 62 62 namespace WebCore { 63 63 64 static CGColorSpaceRef deviceRGBColorSpaceRef()65 {66 static CGColorSpaceRef deviceSpace = CGColorSpaceCreateDeviceRGB();67 return deviceSpace;68 }69 70 static CGColorSpaceRef sRGBColorSpaceRef()71 {72 // FIXME: Windows should be able to use kCGColorSpaceSRGB, this is tracked by http://webkit.org/b/31363.73 #if PLATFORM(WIN) || defined(BUILDING_ON_TIGER)74 return deviceRGBColorSpaceRef();75 #else76 static CGColorSpaceRef sRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);77 return sRGBSpace;78 #endif79 }80 81 64 static CGColorRef createCGColorWithColorSpace(const Color& color, ColorSpace colorSpace) 82 65 { -
trunk/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h
r47585 r51212 27 27 28 28 namespace WebCore { 29 30 // FIXME: This would be in GraphicsContextCG.h if that existed. 31 inline CGColorSpaceRef deviceRGBColorSpaceRef() 32 { 33 static CGColorSpaceRef deviceSpace = CGColorSpaceCreateDeviceRGB(); 34 return deviceSpace; 35 } 36 37 // FIXME: This would be in GraphicsContextCG.h if that existed. 38 inline CGColorSpaceRef sRGBColorSpaceRef() 39 { 40 // FIXME: Windows should be able to use kCGColorSpaceSRGB, this is tracked by http://webkit.org/b/31363. 41 #if PLATFORM(WIN) || defined(BUILDING_ON_TIGER) 42 return deviceRGBColorSpaceRef(); 43 #else 44 static CGColorSpaceRef sRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); 45 return sRGBSpace; 46 #endif 47 } 29 48 30 49 class GraphicsContextPlatformPrivate { -
trunk/WebCore/platform/graphics/cg/ImageCG.cpp
r47585 r51212 33 33 #include "FloatRect.h" 34 34 #include "GraphicsContext.h" 35 #include "GraphicsContextPlatformPrivateCG.h" 35 36 #include "ImageObserver.h" 36 37 #include "PDFDocumentImage.h" … … 128 129 } 129 130 131 static RetainPtr<CGImageRef> imageWithColorSpace(CGImageRef originalImage, ColorSpace colorSpace) 132 { 133 CGColorSpaceRef originalColorSpace = CGImageGetColorSpace(originalImage); 134 135 // If the image already has a (non-device) color space, we don't want to 136 // override it, so return. 137 if (!originalColorSpace || !CFEqual(originalColorSpace, deviceRGBColorSpaceRef())) 138 return originalImage; 139 140 switch (colorSpace) { 141 case DeviceColorSpace: 142 return originalImage; 143 case sRGBColorSpace: 144 return RetainPtr<CGImageRef>(AdoptCF, CGImageCreateCopyWithColorSpace(originalImage, 145 sRGBColorSpaceRef())); 146 } 147 148 ASSERT_NOT_REACHED(); 149 return originalImage; 150 } 151 130 152 CGImageRef BitmapImage::getCGImageRef() 131 153 { … … 133 155 } 134 156 135 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& destRect, const FloatRect& srcRect, Co mpositeOperator compositeOp)157 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp) 136 158 { 137 159 startAnimation(); 138 160 139 CGImageRefimage = frameAtIndex(m_currentFrame);161 RetainPtr<CGImageRef> image = frameAtIndex(m_currentFrame); 140 162 if (!image) // If it's too early we won't have an image yet. 141 163 return; 142 164 143 165 if (mayFillWithSolidColor()) { 144 fillWithSolidColor(ctxt, destRect, solidColor(), compositeOp);145 return; 146 } 147 148 float currHeight = CGImageGetHeight(image );166 fillWithSolidColor(ctxt, destRect, solidColor(), styleColorSpace, compositeOp); 167 return; 168 } 169 170 float currHeight = CGImageGetHeight(image.get()); 149 171 if (currHeight <= srcRect.y()) 150 172 return; … … 182 204 adjustedDestRect.setHeight(subimageRect.height() / yScale); 183 205 184 image = CGImageCreateWithImageInRect(image , subimageRect);206 image = CGImageCreateWithImageInRect(image.get(), subimageRect); 185 207 if (currHeight < srcRect.bottom()) { 186 ASSERT(CGImageGetHeight(image ) == currHeight - CGRectIntegral(srcRect).origin.y);187 adjustedDestRect.setHeight(CGImageGetHeight(image ) / yScale);208 ASSERT(CGImageGetHeight(image.get()) == currHeight - CGRectIntegral(srcRect).origin.y); 209 adjustedDestRect.setHeight(CGImageGetHeight(image.get()) / yScale); 188 210 } 189 211 } else { … … 205 227 adjustedDestRect.setY(-adjustedDestRect.bottom()); 206 228 229 // Adjust the color space. 230 image = imageWithColorSpace(image.get(), styleColorSpace); 231 207 232 // Draw the image. 208 CGContextDrawImage(context, adjustedDestRect, image); 209 210 if (shouldUseSubimage) 211 CGImageRelease(image); 233 CGContextDrawImage(context, adjustedDestRect, image.get()); 212 234 213 235 ctxt->restore(); … … 224 246 225 247 void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const TransformationMatrix& patternTransform, 226 const FloatPoint& phase, Co mpositeOperator op, const FloatRect& destRect)248 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect) 227 249 { 228 250 if (!nativeImageForCurrentFrame()) … … 261 283 subImage.adoptCF(CGImageCreateWithImageInRect(tileImage, tileRect)); 262 284 } 285 286 // Adjust the color space. 287 subImage = imageWithColorSpace(subImage.get(), styleColorSpace); 263 288 264 289 #ifndef BUILDING_ON_TIGER -
trunk/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
r51207 r51212 146 146 } 147 147 148 void PDFDocumentImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, Co mpositeOperator op)148 void PDFDocumentImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator op) 149 149 { 150 150 if (!m_document || m_currentPage == -1) -
trunk/WebCore/platform/graphics/cg/PDFDocumentImage.h
r39601 r51212 59 59 60 60 PDFDocumentImage(); 61 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, Co mpositeOperator);61 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator); 62 62 63 63 void setCurrentPage(int); -
trunk/WebCore/platform/graphics/filters/FEColorMatrix.cpp
r50118 r51212 165 165 return; 166 166 167 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()) );167 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), DeviceColorSpace); 168 168 169 169 IntRect imageRect(IntPoint(), resultImage()->size()); -
trunk/WebCore/platform/graphics/filters/FEComposite.cpp
r49303 r51212 134 134 switch (m_type) { 135 135 case FECOMPOSITE_OPERATOR_OVER: 136 filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion()) );137 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()) );136 filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion()), DeviceColorSpace); 137 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), DeviceColorSpace); 138 138 break; 139 139 case FECOMPOSITE_OPERATOR_IN: 140 140 filterContext->save(); 141 141 filterContext->clipToImageBuffer(calculateDrawingRect(m_in2->subRegion()), m_in2->resultImage()); 142 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()) );142 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), DeviceColorSpace); 143 143 filterContext->restore(); 144 144 break; 145 145 case FECOMPOSITE_OPERATOR_OUT: 146 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()) );147 filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion()), srcRect, CompositeDestinationOut );146 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), DeviceColorSpace); 147 filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion()), srcRect, CompositeDestinationOut, DeviceColorSpace); 148 148 break; 149 149 case FECOMPOSITE_OPERATOR_ATOP: 150 filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion()) );151 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), srcRect, CompositeSourceAtop );150 filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion()), DeviceColorSpace); 151 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), srcRect, CompositeSourceAtop, DeviceColorSpace); 152 152 break; 153 153 case FECOMPOSITE_OPERATOR_XOR: 154 filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion()) );155 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), srcRect, CompositeXOR );154 filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion()), DeviceColorSpace); 155 filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), srcRect, CompositeXOR, DeviceColorSpace); 156 156 break; 157 157 case FECOMPOSITE_OPERATOR_ARITHMETIC: { -
trunk/WebCore/platform/graphics/filters/SourceGraphic.cpp
r44810 r51212 59 59 return; 60 60 61 filterContext->drawImage(filter->sourceImage()->image(), IntPoint() );61 filterContext->drawImage(filter->sourceImage()->image(), IntPoint(), DeviceColorSpace); 62 62 } 63 63 -
trunk/WebCore/platform/graphics/haiku/ImageHaiku.cpp
r47463 r51212 84 84 85 85 // Drawing Routines 86 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst, const FloatRect& src, Co mpositeOperator op)86 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op) 87 87 { 88 88 startAnimation(); … … 93 93 94 94 if (mayFillWithSolidColor()) { 95 fillWithSolidColor(ctxt, dst, solidColor(), op);95 fillWithSolidColor(ctxt, dst, solidColor(), styleColorSpace, op); 96 96 return; 97 97 } … … 110 110 } 111 111 112 void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, const TransformationMatrix& patternTransform, const FloatPoint& srcPoint, Co mpositeOperator op, const FloatRect& dstRect)112 void Image::drawPattern(GraphicsContext* context, const FloatRect& tileRect, const TransformationMatrix& patternTransform, const FloatPoint& srcPoint, ColorSpace, CompositeOperator op, const FloatRect& dstRect) 113 113 { 114 114 // FIXME: finish this to support also phased position (srcPoint) -
trunk/WebCore/platform/graphics/qt/ImageQt.cpp
r51174 r51212 95 95 96 96 void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const TransformationMatrix& patternTransform, 97 const FloatPoint& phase, Co mpositeOperator op, const FloatRect& destRect)97 const FloatPoint& phase, ColorSpace, CompositeOperator op, const FloatRect& destRect) 98 98 { 99 99 QPixmap* framePixmap = nativeImageForCurrentFrame(); … … 163 163 // Drawing Routines 164 164 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst, 165 const FloatRect& src, Co mpositeOperator op)165 const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op) 166 166 { 167 167 startAnimation(); … … 172 172 173 173 if (mayFillWithSolidColor()) { 174 fillWithSolidColor(ctxt, dst, solidColor(), op);174 fillWithSolidColor(ctxt, dst, solidColor(), styleColorSpace, op); 175 175 return; 176 176 } -
trunk/WebCore/platform/graphics/skia/BitmapImageSingleFrameSkia.h
r39713 r51212 73 73 74 74 protected: 75 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, Co mpositeOperator);75 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator); 76 76 77 77 private: -
trunk/WebCore/platform/graphics/skia/ImageSkia.cpp
r48684 r51212 303 303 const TransformationMatrix& patternTransform, 304 304 const FloatPoint& phase, 305 ColorSpace styleColorSpace, 305 306 CompositeOperator compositeOp, 306 307 const FloatRect& destRect) … … 406 407 407 408 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, 408 const FloatRect& srcRect, Co mpositeOperator compositeOp)409 const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp) 409 410 { 410 411 if (!m_source.initialized()) … … 438 439 const FloatRect& dstRect, 439 440 const FloatRect& srcRect, 441 ColorSpace styleColorSpace, 440 442 CompositeOperator compositeOp) 441 443 { -
trunk/WebCore/platform/graphics/win/ImageCGWin.cpp
r49060 r51212 78 78 IntSize imageSize = BitmapImage::size(); 79 79 if (size) 80 drawFrameMatchingSourceSize(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), CompositeCopy);80 drawFrameMatchingSourceSize(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), DeviceColorSpace, CompositeCopy); 81 81 else 82 82 draw(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), CompositeCopy); … … 89 89 } 90 90 91 void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext* ctxt, const FloatRect& dstRect, const IntSize& srcSize, Co mpositeOperator compositeOp)91 void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext* ctxt, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator compositeOp) 92 92 { 93 93 size_t frames = frameCount(); -
trunk/WebCore/platform/graphics/win/ImageCairoWin.cpp
r49260 r51212 83 83 IntSize imageSize = BitmapImage::size(); 84 84 if (size) 85 drawFrameMatchingSourceSize(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), CompositeCopy);85 drawFrameMatchingSourceSize(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), DeviceColorSpace, CompositeCopy); 86 86 else 87 87 draw(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), CompositeCopy); … … 93 93 } 94 94 95 void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext* ctxt, const FloatRect& dstRect, const IntSize& srcSize, Co mpositeOperator compositeOp)95 void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext* ctxt, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator compositeOp) 96 96 { 97 97 size_t frames = frameCount(); -
trunk/WebCore/platform/graphics/wx/ImageWx.cpp
r48213 r51212 87 87 // Drawing Routines 88 88 89 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst, const FloatRect& src, Co mpositeOperator op)89 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op) 90 90 { 91 91 if (!m_source.initialized()) … … 93 93 94 94 if (mayFillWithSolidColor()) { 95 fillWithSolidColor(ctxt, dst, solidColor(), op);95 fillWithSolidColor(ctxt, dst, solidColor(), styleColorSpace, op); 96 96 return; 97 97 } … … 177 177 } 178 178 179 void BitmapImage::drawPattern(GraphicsContext* ctxt, const FloatRect& srcRect, const TransformationMatrix& patternTransform, const FloatPoint& phase, Co mpositeOperator, const FloatRect& dstRect)179 void BitmapImage::drawPattern(GraphicsContext* ctxt, const FloatRect& srcRect, const TransformationMatrix& patternTransform, const FloatPoint& phase, ColorSpace, CompositeOperator, const FloatRect& dstRect) 180 180 { 181 181 if (!m_source.initialized()) -
trunk/WebCore/platform/mac/ScrollbarThemeMac.mm
r46956 r51212 397 397 398 398 HIThemeDrawTrack(&trackInfo, 0, imageBuffer->context()->platformContext(), kHIThemeOrientationNormal); 399 context->drawImage(imageBuffer->image(), scrollbar->frameRect().location());399 context->drawImage(imageBuffer->image(), DeviceColorSpace, scrollbar->frameRect().location()); 400 400 } 401 401 -
trunk/WebCore/rendering/RenderBoxModelObject.cpp
r50852 r51212 478 478 } 479 479 } 480 context->drawTiledImage(bg->image(clientForBackgroundImage, tileSize), destRect, phase, tileSize, compositeOp);480 context->drawTiledImage(bg->image(clientForBackgroundImage, tileSize), style()->colorSpace(), destRect, phase, tileSize, compositeOp); 481 481 } 482 482 } … … 707 707 708 708 Image* image = styleImage->image(this, imageSize); 709 ColorSpace colorSpace = style->colorSpace(); 709 710 710 711 if (drawLeft) { … … 714 715 // The rect to use from within the image is obtained from our slice, and is (0, 0, leftSlice, topSlice) 715 716 if (drawTop) 716 graphicsContext->drawImage(image, IntRect(tx, ty, leftWidth, topWidth),717 graphicsContext->drawImage(image, colorSpace, IntRect(tx, ty, leftWidth, topWidth), 717 718 IntRect(0, 0, leftSlice, topSlice), op); 718 719 … … 720 721 // The rect to use from within the image is (0, imageHeight - bottomSlice, leftSlice, botomSlice) 721 722 if (drawBottom) 722 graphicsContext->drawImage(image, IntRect(tx, ty + h - bottomWidth, leftWidth, bottomWidth),723 graphicsContext->drawImage(image, colorSpace, IntRect(tx, ty + h - bottomWidth, leftWidth, bottomWidth), 723 724 IntRect(0, imageHeight - bottomSlice, leftSlice, bottomSlice), op); 724 725 725 726 // Paint the left edge. 726 727 // Have to scale and tile into the border rect. 727 graphicsContext->drawTiledImage(image, IntRect(tx, ty + topWidth, leftWidth,728 graphicsContext->drawTiledImage(image, colorSpace, IntRect(tx, ty + topWidth, leftWidth, 728 729 h - topWidth - bottomWidth), 729 730 IntRect(0, topSlice, leftSlice, imageHeight - topSlice - bottomSlice), … … 736 737 // The rect to use from within the image is obtained from our slice, and is (imageWidth - rightSlice, 0, rightSlice, topSlice) 737 738 if (drawTop) 738 graphicsContext->drawImage(image, IntRect(tx + w - rightWidth, ty, rightWidth, topWidth),739 graphicsContext->drawImage(image, colorSpace, IntRect(tx + w - rightWidth, ty, rightWidth, topWidth), 739 740 IntRect(imageWidth - rightSlice, 0, rightSlice, topSlice), op); 740 741 … … 742 743 // The rect to use from within the image is (imageWidth - rightSlice, imageHeight - bottomSlice, rightSlice, bottomSlice) 743 744 if (drawBottom) 744 graphicsContext->drawImage(image, IntRect(tx + w - rightWidth, ty + h - bottomWidth, rightWidth, bottomWidth),745 graphicsContext->drawImage(image, colorSpace, IntRect(tx + w - rightWidth, ty + h - bottomWidth, rightWidth, bottomWidth), 745 746 IntRect(imageWidth - rightSlice, imageHeight - bottomSlice, rightSlice, bottomSlice), op); 746 747 747 748 // Paint the right edge. 748 graphicsContext->drawTiledImage(image, IntRect(tx + w - rightWidth, ty + topWidth, rightWidth,749 graphicsContext->drawTiledImage(image, colorSpace, IntRect(tx + w - rightWidth, ty + topWidth, rightWidth, 749 750 h - topWidth - bottomWidth), 750 751 IntRect(imageWidth - rightSlice, topSlice, rightSlice, imageHeight - topSlice - bottomSlice), … … 754 755 // Paint the top edge. 755 756 if (drawTop) 756 graphicsContext->drawTiledImage(image, IntRect(tx + leftWidth, ty, w - leftWidth - rightWidth, topWidth),757 graphicsContext->drawTiledImage(image, colorSpace, IntRect(tx + leftWidth, ty, w - leftWidth - rightWidth, topWidth), 757 758 IntRect(leftSlice, 0, imageWidth - rightSlice - leftSlice, topSlice), 758 759 (Image::TileRule)hRule, Image::StretchTile, op); … … 760 761 // Paint the bottom edge. 761 762 if (drawBottom) 762 graphicsContext->drawTiledImage(image, IntRect(tx + leftWidth, ty + h - bottomWidth,763 graphicsContext->drawTiledImage(image, colorSpace, IntRect(tx + leftWidth, ty + h - bottomWidth, 763 764 w - leftWidth - rightWidth, bottomWidth), 764 765 IntRect(leftSlice, imageHeight - bottomSlice, imageWidth - rightSlice - leftSlice, bottomSlice), … … 767 768 // Paint the middle. 768 769 if (drawMiddle) 769 graphicsContext->drawTiledImage(image, IntRect(tx + leftWidth, ty + topWidth, w - leftWidth - rightWidth,770 graphicsContext->drawTiledImage(image, colorSpace, IntRect(tx + leftWidth, ty + topWidth, w - leftWidth - rightWidth, 770 771 h - topWidth - bottomWidth), 771 772 IntRect(leftSlice, topSlice, imageWidth - rightSlice - leftSlice, imageHeight - topSlice - bottomSlice), -
trunk/WebCore/rendering/RenderImage.cpp
r50760 r51212 387 387 imageX = leftBorder + leftPad + centerX + 1; 388 388 imageY = topBorder + topPad + centerY + 1; 389 context->drawImage(image(), IntPoint(tx + imageX, ty + imageY));389 context->drawImage(image(), style()->colorSpace(), IntPoint(tx + imageX, ty + imageY)); 390 390 errorPictureDrawn = true; 391 391 } … … 425 425 HTMLImageElement* imageElt = (node() && node()->hasTagName(imgTag)) ? static_cast<HTMLImageElement*>(node()) : 0; 426 426 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver; 427 context->drawImage(image(cWidth, cHeight), rect, compositeOperator, useLowQualityScaling);427 context->drawImage(image(cWidth, cHeight), style()->colorSpace(), rect, compositeOperator, useLowQualityScaling); 428 428 } 429 429 } -
trunk/WebCore/rendering/RenderLayer.cpp
r51175 r51212 1965 1965 DEFINE_STATIC_LOCAL(RefPtr<Image>, resizeCornerImage, (Image::loadPlatformResource("textAreaResizeCorner"))); 1966 1966 IntPoint imagePoint(absRect.right() - resizeCornerImage->width(), absRect.bottom() - resizeCornerImage->height()); 1967 context->drawImage(resizeCornerImage.get(), imagePoint);1967 context->drawImage(resizeCornerImage.get(), box->style()->colorSpace(), imagePoint); 1968 1968 1969 1969 // Draw a frame around the resizer (1px grey line) if there are any scrollbars present. -
trunk/WebCore/rendering/RenderListMarker.cpp
r51201 r51212 546 546 paintCustomHighlight(tx, ty, style()->highlight(), true); 547 547 #endif 548 context->drawImage(m_image->image(this, marker.size()), marker.location());548 context->drawImage(m_image->image(this, marker.size()), style()->colorSpace(), marker.location()); 549 549 if (selectionState() != SelectionNone) { 550 550 // FIXME: selectionRect() is in absolute, not painting coordinates. -
trunk/WebCore/rendering/RenderSVGImage.cpp
r46815 r51212 167 167 adjustRectsForAspectRatio(destRect, srcRect, imageElt->preserveAspectRatio()); 168 168 169 paintInfo.context->drawImage(image(), destRect, srcRect);169 paintInfo.context->drawImage(image(), DeviceColorSpace, destRect, srcRect); 170 170 finishRenderSVGContent(this, paintInfo, filter, savedInfo.context); 171 171 } -
trunk/WebCore/rendering/RenderWidget.cpp
r50760 r51212 261 261 // to paint itself. That way it will composite properly with z-indexed layers. 262 262 if (m_substituteImage) 263 paintInfo.context->drawImage(m_substituteImage.get(), m_widget->frameRect());263 paintInfo.context->drawImage(m_substituteImage.get(), style()->colorSpace(), m_widget->frameRect()); 264 264 else 265 265 m_widget->paint(paintInfo.context, paintInfo.rect); -
trunk/WebCore/svg/graphics/SVGImage.cpp
r49685 r51212 174 174 } 175 175 176 void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, Co mpositeOperator compositeOp)176 void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp) 177 177 { 178 178 if (!m_page) -
trunk/WebCore/svg/graphics/SVGImage.h
r44379 r51212 65 65 66 66 SVGImage(ImageObserver*); 67 virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, Co mpositeOperator);67 virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, ColorSpace styleColorSpace, CompositeOperator); 68 68 69 69 virtual NativeImagePtr nativeImageForCurrentFrame(); -
trunk/WebCore/svg/graphics/SVGPaintServerPattern.cpp
r46956 r51212 132 132 for (int j = numX; j > 0; j--) { 133 133 tileImageContext->translate(patternBoundaries().width(), 0); 134 tileImageContext->drawImage(tile()->image(), tileRect, tileRect);134 tileImageContext->drawImage(tile()->image(), object->style()->colorSpace(), tileRect, tileRect); 135 135 } 136 136 tileImageContext->translate(-patternBoundaries().width() * numX, 0); -
trunk/WebCore/svg/graphics/SVGResourceFilter.cpp
r49582 r51212 92 92 } 93 93 94 void SVGResourceFilter::applyFilter(GraphicsContext*& context, const RenderObject* )94 void SVGResourceFilter::applyFilter(GraphicsContext*& context, const RenderObject* object) 95 95 { 96 96 if (!m_savedContext) … … 114 114 resultImage->transformColorSpace(LinearRGB, DeviceRGB); 115 115 #endif 116 context->drawImage(resultImage->image(), lastEffect->subRegion()); 116 ColorSpace colorSpace = DeviceColorSpace; 117 if (object) 118 colorSpace = object->style()->colorSpace(); 119 context->drawImage(resultImage->image(), lastEffect->subRegion(), colorSpace); 117 120 } 118 121 } -
trunk/WebCore/svg/graphics/filters/SVGFEMerge.cpp
r44839 r51212 80 80 for (unsigned i = 0; i < m_mergeInputs.size(); i++) { 81 81 FloatRect destRect = calculateDrawingRect(m_mergeInputs[i]->subRegion()); 82 filterContext->drawImage(m_mergeInputs[i]->resultImage()->image(), destRect );82 filterContext->drawImage(m_mergeInputs[i]->resultImage()->image(), destRect, DeviceColorSpace); 83 83 } 84 84 } -
trunk/WebCore/svg/graphics/filters/SVGFEOffset.cpp
r44841 r51212 85 85 m_in->subRegion().height()); 86 86 87 filterContext->drawImage(m_in->resultImage()->image(), dstRect );87 filterContext->drawImage(m_in->resultImage()->image(), dstRect, DeviceColorSpace); 88 88 } 89 89 -
trunk/WebCore/svg/graphics/filters/SVGFETile.cpp
r46956 r51212 68 68 OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(tileRect.size()); 69 69 GraphicsContext* tileImageContext = tileImage->context(); 70 tileImageContext->drawImage(m_in->resultImage()->image(), IntPoint() );70 tileImageContext->drawImage(m_in->resultImage()->image(), IntPoint(), DeviceColorSpace); 71 71 RefPtr<Pattern> pattern = Pattern::create(tileImage->image(), true, true); 72 72
Note: See TracChangeset
for help on using the changeset viewer.