- Timestamp:
- 04/26/07 22:11:50 (21 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r21041 r21134 66 66 67 67 cairo_t* context; 68 cairo_user_data_key_t opacityKey;68 Vector<float> layers; 69 69 }; 70 70 … … 575 575 return; 576 576 577 ASSERT(opacity >= 0 && opacity <= 1);578 579 577 cairo_t* context = m_data->context; 580 578 cairo_save(context); 581 579 cairo_push_group(context); 582 // We insert the opacity into a Cairo surface data slot. 583 // Rather than passing a pointer, we store the opacity value directly. 584 void* odata = reinterpret_cast<void*>(static_cast<unsigned int>(opacity * UINT_MAX)); 585 cairo_surface_set_user_data(cairo_get_target(context), &m_data->opacityKey, odata, NULL); 580 m_data->layers.append(opacity); 586 581 } 587 582 … … 592 587 593 588 cairo_t* context = m_data->context; 594 void* odata = cairo_surface_get_user_data(cairo_get_target(context), &m_data->opacityKey);595 float opacity = static_cast<float>(reinterpret_cast<unsigned int>(odata)) / UINT_MAX;596 597 ASSERT(opacity >= 0 && opacity <= 1);598 589 599 590 cairo_pop_group_to_source(context); 600 cairo_paint_with_alpha(context, opacity); 591 cairo_paint_with_alpha(context, m_data->layers.last()); 592 m_data->layers.removeLast(); 601 593 cairo_restore(context); 602 594 }