| 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 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012 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 16 matching lines...) Expand all Loading... |
| 27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 28 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 28 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 */ | 31 */ |
| 32 | 32 |
| 33 #include "config.h" | 33 #include "config.h" |
| 34 #include "core/html/canvas/CanvasRenderingContext2D.h" | 34 #include "core/html/canvas/CanvasRenderingContext2D.h" |
| 35 | 35 |
| 36 #include "CSSPropertyNames.h" | 36 #include "CSSPropertyNames.h" |
| 37 #include "HTMLNames.h" | |
| 38 #include "RuntimeEnabledFeatures.h" | 37 #include "RuntimeEnabledFeatures.h" |
| 39 #include "core/css/CSSFontSelector.h" | 38 #include "core/css/CSSFontSelector.h" |
| 40 #include "core/css/CSSParser.h" | 39 #include "core/css/CSSParser.h" |
| 41 #include "core/css/StylePropertySet.h" | 40 #include "core/css/StylePropertySet.h" |
| 42 #include "core/css/resolver/StyleResolver.h" | 41 #include "core/css/resolver/StyleResolver.h" |
| 43 #include "core/dom/ExceptionCode.h" | 42 #include "core/dom/ExceptionCode.h" |
| 44 #include "core/dom/ExceptionCodePlaceholder.h" | 43 #include "core/dom/ExceptionCodePlaceholder.h" |
| 45 #include "core/html/HTMLCanvasElement.h" | 44 #include "core/html/HTMLCanvasElement.h" |
| 46 #include "core/html/HTMLImageElement.h" | 45 #include "core/html/HTMLImageElement.h" |
| 47 #include "core/html/HTMLMediaElement.h" | 46 #include "core/html/HTMLMediaElement.h" |
| 48 #include "core/html/HTMLVideoElement.h" | 47 #include "core/html/HTMLVideoElement.h" |
| 49 #include "core/html/ImageData.h" | 48 #include "core/html/ImageData.h" |
| 50 #include "core/html/TextMetrics.h" | 49 #include "core/html/TextMetrics.h" |
| 51 #include "core/html/canvas/Canvas2DContextAttributes.h" | 50 #include "core/html/canvas/Canvas2DContextAttributes.h" |
| 52 #include "core/html/canvas/CanvasGradient.h" | 51 #include "core/html/canvas/CanvasGradient.h" |
| 53 #include "core/html/canvas/CanvasPattern.h" | 52 #include "core/html/canvas/CanvasPattern.h" |
| 54 #include "core/html/canvas/CanvasStyle.h" | 53 #include "core/html/canvas/CanvasStyle.h" |
| 55 #include "core/html/canvas/DOMPath.h" | 54 #include "core/html/canvas/DOMPath.h" |
| 56 #include "core/loader/cache/CachedImage.h" | 55 #include "core/loader/cache/CachedImage.h" |
| 57 #include "core/page/Console.h" | |
| 58 #include "core/page/Page.h" | |
| 59 #include "core/page/Settings.h" | |
| 60 #include "core/platform/FloatConversion.h" | |
| 61 #include "core/platform/graphics/DrawLooper.h" | 56 #include "core/platform/graphics/DrawLooper.h" |
| 62 #include "core/platform/graphics/FloatQuad.h" | 57 #include "core/platform/graphics/FloatQuad.h" |
| 63 #include "core/platform/graphics/FontCache.h" | 58 #include "core/platform/graphics/FontCache.h" |
| 64 #include "core/platform/graphics/GraphicsContextStateSaver.h" | 59 #include "core/platform/graphics/GraphicsContextStateSaver.h" |
| 65 #include "core/platform/graphics/TextRun.h" | 60 #include "core/platform/graphics/TextRun.h" |
| 66 #include "core/platform/graphics/transforms/AffineTransform.h" | 61 #include "core/platform/graphics/transforms/AffineTransform.h" |
| 67 #include "core/rendering/RenderHTMLCanvas.h" | |
| 68 #include "core/rendering/RenderLayer.h" | 62 #include "core/rendering/RenderLayer.h" |
| 69 #include "weborigin/KURL.h" | |
| 70 #include "weborigin/SecurityOrigin.h" | 63 #include "weborigin/SecurityOrigin.h" |
| 71 | 64 |
| 72 #include <wtf/CheckedArithmetic.h> | 65 #include "wtf/CheckedArithmetic.h" |
| 73 #include <wtf/MathExtras.h> | 66 #include "wtf/MathExtras.h" |
| 74 #include <wtf/OwnPtr.h> | 67 #include "wtf/OwnPtr.h" |
| 75 #include <wtf/text/StringBuilder.h> | 68 #include "wtf/Uint8ClampedArray.h" |
| 76 #include <wtf/Uint8ClampedArray.h> | 69 #include "wtf/text/StringBuilder.h" |
| 77 #include <wtf/UnusedParam.h> | |
| 78 | 70 |
| 79 using namespace std; | 71 using namespace std; |
| 80 | 72 |
| 81 namespace WebCore { | 73 namespace WebCore { |
| 82 | 74 |
| 83 using namespace HTMLNames; | |
| 84 | |
| 85 static const int defaultFontSize = 10; | 75 static const int defaultFontSize = 10; |
| 86 static const char* const defaultFontFamily = "sans-serif"; | 76 static const char* const defaultFontFamily = "sans-serif"; |
| 87 static const char* const defaultFont = "10px sans-serif"; | 77 static const char* const defaultFont = "10px sans-serif"; |
| 88 | 78 |
| 89 static bool isOriginClean(CachedImage* cachedImage, SecurityOrigin* securityOrig
in) | 79 static bool isOriginClean(CachedImage* cachedImage, SecurityOrigin* securityOrig
in) |
| 90 { | 80 { |
| 91 if (!cachedImage->image()->hasSingleSecurityOrigin()) | 81 if (!cachedImage->image()->hasSingleSecurityOrigin()) |
| 92 return false; | 82 return false; |
| 93 if (cachedImage->passesAccessControlCheck(securityOrigin)) | 83 if (cachedImage->passesAccessControlCheck(securityOrigin)) |
| 94 return true; | 84 return true; |
| (...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 } | 2231 } |
| 2242 | 2232 |
| 2243 PassRefPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttrib
utes() const | 2233 PassRefPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttrib
utes() const |
| 2244 { | 2234 { |
| 2245 RefPtr<Canvas2DContextAttributes> attributes = Canvas2DContextAttributes::cr
eate(); | 2235 RefPtr<Canvas2DContextAttributes> attributes = Canvas2DContextAttributes::cr
eate(); |
| 2246 attributes->setAlpha(m_hasAlpha); | 2236 attributes->setAlpha(m_hasAlpha); |
| 2247 return attributes.release(); | 2237 return attributes.release(); |
| 2248 } | 2238 } |
| 2249 | 2239 |
| 2250 } // namespace WebCore | 2240 } // namespace WebCore |
| OLD | NEW |