Changeset 76415 in webkit
- Timestamp:
- Jan 21, 2011 5:45:14 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r76414 r76415 1 2011-01-21 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Always set composition mode through GraphicsContext 6 https://bugs.webkit.org/show_bug.cgi?id=52940 7 8 GraphicsContext tracks the current composition mode so we should 9 never call through to the QPainter directly. 10 11 * platform/graphics/GraphicsContext.h: 12 * platform/graphics/qt/GraphicsContextQt.cpp: 13 (WebCore::toQtCompositionMode): Changed this method to a static inline 14 since it's only used by GraphicsContextQt.cpp now. 15 16 * platform/graphics/qt/ImageQt.cpp: 17 (WebCore::Image::drawPattern): 18 (WebCore::BitmapImage::draw): 19 1 20 2011-01-21 Dan Bernstein <mitz@apple.com> 2 21 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r76248 r76415 466 466 void pushTransparencyLayerInternal(const QRect &rect, qreal opacity, QPixmap& alphaMask); 467 467 void takeOwnershipOfPlatformContext(); 468 static QPainter::CompositionMode toQtCompositionMode(CompositeOperator op);469 468 #endif 470 469 -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r76405 r76415 70 70 namespace WebCore { 71 71 72 QPainter::CompositionMode GraphicsContext::toQtCompositionMode(CompositeOperator op)72 static inline QPainter::CompositionMode toQtCompositionMode(CompositeOperator op) 73 73 { 74 74 switch (op) { -
trunk/Source/WebCore/platform/graphics/qt/ImageQt.cpp
r75926 r76415 121 121 CompositeOperator previousOperator = ctxt->compositeOperation(); 122 122 123 ctxt->setCompositeOperation(op); 123 ctxt->setCompositeOperation(!pixmap.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op); 124 124 125 QPainter* p = ctxt->platformContext(); 125 if (!pixmap.hasAlpha() && p->compositionMode() == QPainter::CompositionMode_SourceOver)126 p->setCompositionMode(QPainter::CompositionMode_Source);127 128 126 QTransform transform(patternTransform); 129 127 … … 224 222 } 225 223 226 QPainter* painter(ctxt->platformContext()); 227 228 QPainter::CompositionMode compositionMode = GraphicsContext::toQtCompositionMode(op); 229 230 if (!image->hasAlpha() && painter->compositionMode() == QPainter::CompositionMode_SourceOver) 231 compositionMode = QPainter::CompositionMode_Source; 232 233 QPainter::CompositionMode lastCompositionMode = painter->compositionMode(); 234 painter->setCompositionMode(compositionMode); 224 CompositeOperator previousOperator = ctxt->compositeOperation(); 225 ctxt->setCompositeOperation(!image->hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op); 235 226 236 227 ContextShadow* shadow = ctxt->contextShadow(); … … 244 235 } 245 236 246 // Test using example site at 247 // http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html 248 painter->drawPixmap(normalizedDst, *image, normalizedSrc); 249 250 painter->setCompositionMode(lastCompositionMode); 237 ctxt->platformContext()->drawPixmap(normalizedDst, *image, normalizedSrc); 238 239 ctxt->setCompositeOperation(previousOperator); 251 240 252 241 if (imageObserver())
Note: See TracChangeset
for help on using the changeset viewer.