Changeset 84631 in webkit
- Timestamp:
- Apr 22, 2011 8:51:24 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r84630 r84631 1 2011-04-21 Simon Fraser <simon.fraser@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Extra GraphicsContext::save() in InlineTextBox::paintDecoration() 6 https://bugs.webkit.org/show_bug.cgi?id=59109 7 8 Testcase that exercises the fixed InlineTextBox::paintDecoration() code. 9 10 * fast/text/multiple-text-shadow-alpha-expected.txt: Added. 11 * fast/text/multiple-text-shadow-alpha.html: Added. 12 1 13 2011-04-22 Jessie Berlin <jberlin@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r84629 r84631 1 2011-04-21 Simon Fraser <simon.fraser@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Extra GraphicsContext::save() in InlineTextBox::paintDecoration() 6 https://bugs.webkit.org/show_bug.cgi?id=59109 7 8 Remove an extraneous GraphicsContext::save() in InlineTextBox::paintDecoration(). 9 10 Add an assertion that fires when a GraphicsContext() is destroyed with a non- 11 empty state stack. Fix canvas to avoid this assertion, since bad content might 12 trigger it. 13 14 Also add an assertion that fires for mismatched begin/endTransparencyLayers. 15 16 Test: fast/text/multiple-text-shadow-alpha.html 17 18 * html/HTMLCanvasElement.cpp: 19 (WebCore::HTMLCanvasElement::~HTMLCanvasElement): 20 Make sure that the CanvasRenderingContext goes away before the ImageBuffer, 21 so that CanvasRenderingContext2D has a chance to unwind the state stack in 22 the ImageBuffer's GraphicsContext. 23 24 * html/canvas/CanvasRenderingContext2D.cpp: 25 (WebCore::CanvasRenderingContext2D::~CanvasRenderingContext2D): 26 Balance unmatched state saves in the canvas context. 27 28 * platform/graphics/GraphicsContext.cpp: 29 (WebCore::GraphicsContext::~GraphicsContext): 30 Assert that the stack is empty. 31 32 * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h: 33 (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): 34 (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): 35 (WebCore::GraphicsContextPlatformPrivate::beginTransparencyLayer): 36 (WebCore::GraphicsContextPlatformPrivate::endTransparencyLayer): 37 Changes to allow for asserting for unmatched transparency layer begin/ends. 38 39 * rendering/InlineTextBox.cpp: 40 (WebCore::InlineTextBox::paintDecoration): 41 Remove an unbalanced save(). 42 1 43 2011-04-22 Pavel Feldman <pfeldman@google.com> 2 44 -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r84101 r84631 102 102 for (HashSet<CanvasObserver*>::iterator it = m_observers.begin(); it != end; ++it) 103 103 (*it)->canvasDestroyed(this); 104 105 m_context.clear(); // Ensure this goes away before the ImageBuffer. 104 106 } 105 107 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r84512 r84631 146 146 CanvasRenderingContext2D::~CanvasRenderingContext2D() 147 147 { 148 #if !ASSERT_DISABLED 149 // Ensure that the state stack in the ImageBuffer's context 150 // is cleared before destruction, to avoid assertions in the 151 // GraphicsContext dtor. 152 if (size_t stackSize = m_stateStack.size()) { 153 if (GraphicsContext* context = drawingContext()) { 154 while (--stackSize) 155 context->restore(); 156 } 157 } 158 #endif 148 159 } 149 160 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r84273 r84631 85 85 GraphicsContext::~GraphicsContext() 86 86 { 87 ASSERT(m_stack.isEmpty()); 87 88 platformDestroy(); 88 89 } -
trunk/Source/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h
r81161 r84631 45 45 #if PLATFORM(WIN) 46 46 , m_hdc(0) 47 , m_shouldIncludeChildWindows(false) 48 #endif 49 #if PLATFORM(WIN) || !ASSERT_DISABLED 47 50 , m_transparencyCount(0) 48 , m_shouldIncludeChildWindows(false)49 51 #endif 50 52 , m_userToDeviceTransformKnownToBeIdentity(false) … … 55 57 ~GraphicsContextPlatformPrivate() 56 58 { 59 ASSERT(!m_transparencyCount); 57 60 } 58 61 … … 69 72 void concatCTM(const AffineTransform&) {} 70 73 void setCTM(const AffineTransform&) {} 71 void beginTransparencyLayer() {}72 void endTransparencyLayer() {}73 74 #endif 74 75 … … 85 86 void concatCTM(const AffineTransform&); 86 87 void setCTM(const AffineTransform&); 87 void beginTransparencyLayer() { m_transparencyCount++; }88 void endTransparencyLayer() { m_transparencyCount--; }89 88 90 89 HDC m_hdc; 91 unsigned m_transparencyCount;92 90 bool m_shouldIncludeChildWindows; 93 91 #endif 94 92 93 void beginTransparencyLayer() 94 { 95 #if PLATFORM(WIN) || !ASSERT_DISABLED 96 m_transparencyCount++; 97 #endif 98 } 99 void endTransparencyLayer() 100 { 101 #if PLATFORM(WIN) || !ASSERT_DISABLED 102 ASSERT(m_transparencyCount > 0); 103 m_transparencyCount--; 104 #endif 105 } 106 95 107 RetainPtr<CGContextRef> m_cgContext; 108 #if PLATFORM(WIN) || !ASSERT_DISABLED 109 int m_transparencyCount; 110 #endif 96 111 bool m_userToDeviceTransformKnownToBeIdentity; 97 112 GraphicsContextCGFlags m_contextFlags; -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r84504 r84631 896 896 int extraOffset = 0; 897 897 if (!linesAreOpaque && shadow && shadow->next()) { 898 context->save(); // FIXME: where is the balancing restore()?899 898 FloatRect clipRect(localOrigin, FloatSize(width, baseline + 2)); 900 899 for (const ShadowData* s = shadow; s; s = s->next()) {
Note: See TracChangeset
for help on using the changeset viewer.