Changeset 51322 in webkit
- Timestamp:
- Nov 23, 2009 2:36:42 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51321 r51322 1 2009-11-23 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 [Cairo] support blurred test-shadow 6 [https://bugs.webkit.org/show_bug.cgi?id=31797] 7 8 Support for blurred text-shadows on Cairo. This patch 9 reuses the code of blurred box-shadows, introduced in 10 bug 26102. For a full textshadow support, a filters enabled 11 build is needed. 12 13 * platform/graphics/cairo/FontCairo.cpp: 14 (WebCore::Font::drawGlyphs): 15 1 16 2009-11-23 Jens Alfke <snej@chromium.org> 2 17 -
trunk/WebCore/platform/graphics/cairo/FontCairo.cpp
r50854 r51322 33 33 #include "Gradient.h" 34 34 #include "GraphicsContext.h" 35 #include "ImageBuffer.h" 35 36 #include "Pattern.h" 36 37 #include "SimpleFontData.h" … … 86 87 cairo_set_source_rgba(cr, red, green, blue, alpha); 87 88 89 #if ENABLE(FILTERS) 90 cairo_text_extents_t extents; 91 cairo_scaled_font_glyph_extents(font->platformData().scaledFont(), glyphs, numGlyphs, &extents); 92 93 FloatRect rect(FloatPoint(), FloatSize(extents.width, extents.height)); 94 IntSize shadowBufferSize; 95 FloatRect shadowRect; 96 float kernelSize = 0.f; 97 GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, kernelSize, rect, shadowSize, shadowBlur); 98 99 // Draw shadow into a new ImageBuffer 100 OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize); 101 GraphicsContext* shadowContext = shadowBuffer->context(); 102 cairo_t* shadowCr = shadowContext->platformContext(); 103 104 cairo_translate(shadowCr, kernelSize, extents.height + kernelSize); 105 106 cairo_set_scaled_font(shadowCr, font->platformData().scaledFont()); 107 cairo_show_glyphs(shadowCr, glyphs, numGlyphs); 108 if (font->syntheticBoldOffset()) { 109 cairo_save(shadowCr); 110 cairo_translate(shadowCr, font->syntheticBoldOffset(), 0); 111 cairo_show_glyphs(shadowCr, glyphs, numGlyphs); 112 cairo_restore(shadowCr); 113 } 114 cairo_translate(cr, 0.0, -extents.height); 115 context->createPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, kernelSize); 116 #else 88 117 cairo_translate(cr, shadowSize.width(), shadowSize.height()); 89 118 cairo_show_glyphs(cr, glyphs, numGlyphs); … … 94 123 cairo_restore(cr); 95 124 } 125 #endif 96 126 97 127 cairo_restore(cr);
Note: See TracChangeset
for help on using the changeset viewer.