| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 5 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
| 8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
| 10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "modules/canvas2d/CanvasRenderingContext2D.h" | 34 #include "modules/canvas2d/CanvasRenderingContext2D.h" |
| 35 | 35 |
| 36 #include "bindings/core/v8/ExceptionMessages.h" | 36 #include "bindings/core/v8/ExceptionMessages.h" |
| 37 #include "bindings/core/v8/ExceptionState.h" | 37 #include "bindings/core/v8/ExceptionState.h" |
| 38 #include "bindings/modules/v8/RenderingContext.h" | 38 #include "bindings/modules/v8/RenderingContext.h" |
| 39 #include "core/CSSPropertyNames.h" | 39 #include "core/CSSPropertyNames.h" |
| 40 #include "core/css/StylePropertySet.h" | 40 #include "core/css/StylePropertySet.h" |
| 41 #include "core/css/resolver/StyleResolver.h" | 41 #include "core/css/resolver/StyleResolver.h" |
| 42 #include "core/dom/AXObjectCache.h" | 42 #include "core/dom/AXObjectCache.h" |
| 43 #include "core/dom/StyleEngine.h" | 43 #include "core/dom/StyleEngine.h" |
| 44 #include "core/dom/TaskRunnerHelper.h" |
| 44 #include "core/events/Event.h" | 45 #include "core/events/Event.h" |
| 45 #include "core/events/MouseEvent.h" | 46 #include "core/events/MouseEvent.h" |
| 46 #include "core/frame/Settings.h" | 47 #include "core/frame/Settings.h" |
| 47 #include "core/html/TextMetrics.h" | 48 #include "core/html/TextMetrics.h" |
| 48 #include "core/html/canvas/CanvasFontCache.h" | 49 #include "core/html/canvas/CanvasFontCache.h" |
| 49 #include "core/layout/HitTestCanvasResult.h" | 50 #include "core/layout/HitTestCanvasResult.h" |
| 50 #include "core/layout/LayoutBox.h" | 51 #include "core/layout/LayoutBox.h" |
| 51 #include "core/layout/LayoutTheme.h" | 52 #include "core/layout/LayoutTheme.h" |
| 52 #include "modules/canvas2d/CanvasStyle.h" | 53 #include "modules/canvas2d/CanvasStyle.h" |
| 53 #include "modules/canvas2d/HitRegion.h" | 54 #include "modules/canvas2d/HitRegion.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 112 |
| 112 CanvasRenderingContext2D::CanvasRenderingContext2D( | 113 CanvasRenderingContext2D::CanvasRenderingContext2D( |
| 113 HTMLCanvasElement* canvas, | 114 HTMLCanvasElement* canvas, |
| 114 const CanvasContextCreationAttributes& attrs, | 115 const CanvasContextCreationAttributes& attrs, |
| 115 Document& document) | 116 Document& document) |
| 116 : CanvasRenderingContext(canvas, nullptr, attrs), | 117 : CanvasRenderingContext(canvas, nullptr, attrs), |
| 117 m_contextLostMode(NotLostContext), | 118 m_contextLostMode(NotLostContext), |
| 118 m_contextRestorable(true), | 119 m_contextRestorable(true), |
| 119 m_tryRestoreContextAttemptCount(0), | 120 m_tryRestoreContextAttemptCount(0), |
| 120 m_dispatchContextLostEventTimer( | 121 m_dispatchContextLostEventTimer( |
| 122 TaskRunnerHelper::get(TaskType::MiscPlatformAPI, |
| 123 canvas->document().frame()), |
| 121 this, | 124 this, |
| 122 &CanvasRenderingContext2D::dispatchContextLostEvent), | 125 &CanvasRenderingContext2D::dispatchContextLostEvent), |
| 123 m_dispatchContextRestoredEventTimer( | 126 m_dispatchContextRestoredEventTimer( |
| 127 TaskRunnerHelper::get(TaskType::MiscPlatformAPI, |
| 128 canvas->document().frame()), |
| 124 this, | 129 this, |
| 125 &CanvasRenderingContext2D::dispatchContextRestoredEvent), | 130 &CanvasRenderingContext2D::dispatchContextRestoredEvent), |
| 126 m_tryRestoreContextEventTimer( | 131 m_tryRestoreContextEventTimer( |
| 132 TaskRunnerHelper::get(TaskType::MiscPlatformAPI, |
| 133 canvas->document().frame()), |
| 127 this, | 134 this, |
| 128 &CanvasRenderingContext2D::tryRestoreContextEvent), | 135 &CanvasRenderingContext2D::tryRestoreContextEvent), |
| 129 m_pruneLocalFontCacheScheduled(false) { | 136 m_pruneLocalFontCacheScheduled(false) { |
| 130 if (document.settings() && | 137 if (document.settings() && |
| 131 document.settings()->getAntialiasedClips2dCanvasEnabled()) | 138 document.settings()->getAntialiasedClips2dCanvasEnabled()) |
| 132 m_clipAntialiasing = AntiAliased; | 139 m_clipAntialiasing = AntiAliased; |
| 133 setShouldAntialias(true); | 140 setShouldAntialias(true); |
| 134 validateStateStack(); | 141 validateStateStack(); |
| 135 } | 142 } |
| 136 | 143 |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 } | 1172 } |
| 1166 return true; | 1173 return true; |
| 1167 } | 1174 } |
| 1168 | 1175 |
| 1169 void CanvasRenderingContext2D::resetUsageTracking() { | 1176 void CanvasRenderingContext2D::resetUsageTracking() { |
| 1170 UsageCounters newCounters; | 1177 UsageCounters newCounters; |
| 1171 m_usageCounters = newCounters; | 1178 m_usageCounters = newCounters; |
| 1172 } | 1179 } |
| 1173 | 1180 |
| 1174 } // namespace blink | 1181 } // namespace blink |
| OLD | NEW |