Changeset 21134 in webkit
- Timestamp:
- Apr 26, 2007 10:11:50 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r21132 r21134 1 2007-04-26 Alp Toker <alp@atoker.com> 2 3 Reviewed by Maciej. 4 5 http://bugs.webkit.org/show_bug.cgi?id=13505 6 Cast loses precision on x86_64 7 8 * platform/graphics/cairo/GraphicsContextCairo.cpp: 9 (WebCore::GraphicsContext::beginTransparencyLayer): 10 (WebCore::GraphicsContext::endTransparencyLayer): 11 Use a stack of opacity values instead of Cairo user data. 12 1 13 2007-04-26 Mitz Pettel <mitz@webkit.org> 2 14 -
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 }
Note: See TracChangeset
for help on using the changeset viewer.