| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
| 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
| 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
| 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 10 * | 10 * |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 if (size_t stackSize = m_stateStack.size()) { | 108 if (size_t stackSize = m_stateStack.size()) { |
| 109 if (GraphicsContext* context = canvas()->existingDrawingContext()) { | 109 if (GraphicsContext* context = canvas()->existingDrawingContext()) { |
| 110 while (--stackSize) | 110 while (--stackSize) |
| 111 context->restore(); | 111 context->restore(); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 CanvasRenderingContext2D::~CanvasRenderingContext2D() | 116 CanvasRenderingContext2D::~CanvasRenderingContext2D() |
| 117 { | 117 { |
| 118 #if !ENABLE(OILPAN) |
| 118 #if !ASSERT_DISABLED | 119 #if !ASSERT_DISABLED |
| 119 unwindStateStack(); | 120 unwindStateStack(); |
| 120 #endif | 121 #endif |
| 122 #endif |
| 121 } | 123 } |
| 122 | 124 |
| 123 bool CanvasRenderingContext2D::isAccelerated() const | 125 bool CanvasRenderingContext2D::isAccelerated() const |
| 124 { | 126 { |
| 125 if (!canvas()->hasImageBuffer()) | 127 if (!canvas()->hasImageBuffer()) |
| 126 return false; | 128 return false; |
| 127 GraphicsContext* context = drawingContext(); | 129 GraphicsContext* context = drawingContext(); |
| 128 return context && context->isAccelerated(); | 130 return context && context->isAccelerated(); |
| 129 } | 131 } |
| 130 | 132 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 153 if (contextLostRestoredEventsEnabled()) { | 155 if (contextLostRestoredEventsEnabled()) { |
| 154 m_dispatchContextRestoredEventTimer.startOneShot(0, FROM_HERE); | 156 m_dispatchContextRestoredEventTimer.startOneShot(0, FROM_HERE); |
| 155 } else { | 157 } else { |
| 156 // legacy synchronous context restoration. | 158 // legacy synchronous context restoration. |
| 157 reset(); | 159 reset(); |
| 158 m_isContextLost = false; | 160 m_isContextLost = false; |
| 159 } | 161 } |
| 160 } | 162 } |
| 161 } | 163 } |
| 162 | 164 |
| 165 void CanvasRenderingContext2D::trace(Visitor* visitor) |
| 166 { |
| 167 #if ENABLE(OILPAN) |
| 168 visitor->trace(m_stateStack); |
| 169 #endif |
| 170 visitor->trace(m_fetchedFonts); |
| 171 CanvasRenderingContext::trace(visitor); |
| 172 } |
| 173 |
| 163 void CanvasRenderingContext2D::dispatchContextLostEvent(Timer<CanvasRenderingCon
text2D>*) | 174 void CanvasRenderingContext2D::dispatchContextLostEvent(Timer<CanvasRenderingCon
text2D>*) |
| 164 { | 175 { |
| 165 if (contextLostRestoredEventsEnabled()) { | 176 if (contextLostRestoredEventsEnabled()) { |
| 166 RefPtrWillBeRawPtr<Event> event = Event::createCancelable(EventTypeNames
::contextlost); | 177 RefPtrWillBeRawPtr<Event> event = Event::createCancelable(EventTypeNames
::contextlost); |
| 167 canvas()->dispatchEvent(event); | 178 canvas()->dispatchEvent(event); |
| 168 if (event->defaultPrevented()) { | 179 if (event->defaultPrevented()) { |
| 169 m_contextRestorable = false; | 180 m_contextRestorable = false; |
| 170 } | 181 } |
| 171 } | 182 } |
| 172 | 183 |
| (...skipping 2261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2434 c->setAlphaAsFloat(1.0); | 2445 c->setAlphaAsFloat(1.0); |
| 2435 c->clearShadow(); | 2446 c->clearShadow(); |
| 2436 c->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal); | 2447 c->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal); |
| 2437 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); | 2448 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); |
| 2438 c->restore(); | 2449 c->restore(); |
| 2439 | 2450 |
| 2440 didDraw(dirtyRect); | 2451 didDraw(dirtyRect); |
| 2441 } | 2452 } |
| 2442 | 2453 |
| 2443 } // namespace WebCore | 2454 } // namespace WebCore |
| OLD | NEW |