Changeset 38001 in webkit
- Timestamp:
- Oct 30, 2008 7:09:59 AM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r37993 r38001 1 2008-10-30 Dirk Schulze <vbs85@gmx.de> 2 3 Reviewed by Alp Toker. 4 5 https://bugs.webkit.org/show_bug.cgi?id=21883 6 [CAIRO] globalAlpha has to be stored and restored 7 8 Cairo's globalAlpha has to be stored and reloaded on calling 9 save() and restore(). We use the power of GraphicsContextState for this. 10 11 * platform/graphics/GraphicsContextPrivate.h: 12 (WebCore::GraphicsContextState::GraphicsContextState): 13 * platform/graphics/cairo/GraphicsContextCairo.cpp: 14 (WebCore::GraphicsContext::fillPath): 15 (WebCore::GraphicsContext::strokePath): 16 (WebCore::GraphicsContext::setAlpha): 17 (WebCore::GraphicsContext::getAlpha): 18 * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: 19 (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): 20 1 21 2008-10-29 Alexey Proskuryakov <ap@webkit.org> 2 22 -
trunk/WebCore/platform/graphics/GraphicsContextPrivate.h
r37605 r38001 51 51 , strokeStyle(SolidStroke) 52 52 , strokeThickness(0) 53 #if PLATFORM(CAIRO) 54 , globalAlpha(1.0f) 55 #endif 53 56 , strokeColorSpace(SolidColorSpace) 54 57 , strokeColor(Color::black) … … 66 69 StrokeStyle strokeStyle; 67 70 float strokeThickness; 71 #if PLATFORM(CAIRO) 72 float globalAlpha; 73 #endif 68 74 ColorSpace strokeColorSpace; 69 75 Color strokeColor; -
trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r37778 r38001 448 448 setColor(cr, fillColor()); 449 449 cairo_clip(cr); 450 cairo_paint_with_alpha(cr, m_ data->globalAlpha);450 cairo_paint_with_alpha(cr, m_common->state.globalAlpha); 451 451 } 452 452 break; … … 454 454 cairo_set_source(cr, m_common->state.fillPattern.get()->createPlatformPattern(getCTM())); 455 455 cairo_clip(cr); 456 cairo_paint_with_alpha(cr, m_ data->globalAlpha);456 cairo_paint_with_alpha(cr, m_common->state.globalAlpha); 457 457 break; 458 458 case GradientColorSpace: … … 461 461 cairo_set_source(cr, pattern); 462 462 cairo_clip(cr); 463 cairo_paint_with_alpha(cr, m_ data->globalAlpha);463 cairo_paint_with_alpha(cr, m_common->state.globalAlpha); 464 464 break; 465 465 } … … 478 478 if (strokeColor().alpha()) { 479 479 setColor(cr, strokeColor()); 480 if (m_ data->globalAlpha < 1.0f) {480 if (m_common->state.globalAlpha < 1.0f) { 481 481 cairo_push_group(cr); 482 cairo_paint_with_alpha(cr, m_ data->globalAlpha);482 cairo_paint_with_alpha(cr, m_common->state.globalAlpha); 483 483 cairo_pop_group_to_source(cr); 484 484 } … … 488 488 case PatternColorSpace: 489 489 cairo_set_source(cr, m_common->state.strokePattern.get()->createPlatformPattern(getCTM())); 490 if (m_ data->globalAlpha < 1.0f) {490 if (m_common->state.globalAlpha < 1.0f) { 491 491 cairo_push_group(cr); 492 cairo_paint_with_alpha(cr, m_ data->globalAlpha);492 cairo_paint_with_alpha(cr, m_common->state.globalAlpha); 493 493 cairo_pop_group_to_source(cr); 494 494 } … … 499 499 pattern = applySpreadMethod(pattern, spreadMethod()); 500 500 cairo_set_source(cr, pattern); 501 if (m_ data->globalAlpha < 1.0f) {501 if (m_common->state.globalAlpha < 1.0f) { 502 502 cairo_push_group(cr); 503 cairo_paint_with_alpha(cr, m_ data->globalAlpha);503 cairo_paint_with_alpha(cr, m_common->state.globalAlpha); 504 504 cairo_pop_group_to_source(cr); 505 505 } … … 888 888 void GraphicsContext::setAlpha(float alpha) 889 889 { 890 m_ data->globalAlpha = alpha;890 m_common->state.globalAlpha = alpha; 891 891 } 892 892 893 893 float GraphicsContext::getAlpha() 894 894 { 895 return m_ data->globalAlpha;895 return m_common->state.globalAlpha; 896 896 } 897 897 -
trunk/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
r36010 r38001 46 46 GraphicsContextPlatformPrivate() 47 47 : cr(0) 48 , globalAlpha(1.0f)49 48 #if PLATFORM(GTK) 50 49 , expose(0) … … 89 88 90 89 cairo_t* cr; 91 float globalAlpha;92 90 Vector<float> layers; 93 91
Note: See TracChangeset
for help on using the changeset viewer.