| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/canvas2d/BaseRenderingContext2D.h" | 5 #include "modules/canvas2d/BaseRenderingContext2D.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionMessages.h" | 7 #include "bindings/core/v8/ExceptionMessages.h" |
| 8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "core/css/cssom/CSSURLImageValue.h" | 10 #include "core/css/cssom/CSSURLImageValue.h" |
| 11 #include "core/css/parser/CSSParser.h" | 11 #include "core/css/parser/CSSParser.h" |
| 12 #include "core/frame/ImageBitmap.h" | 12 #include "core/frame/ImageBitmap.h" |
| 13 #include "core/html/HTMLCanvasElement.h" | 13 #include "core/html/HTMLCanvasElement.h" |
| 14 #include "core/html/HTMLImageElement.h" | 14 #include "core/html/HTMLImageElement.h" |
| 15 #include "core/html/HTMLVideoElement.h" | 15 #include "core/html/HTMLVideoElement.h" |
| 16 #include "core/html/ImageData.h" | 16 #include "core/html/ImageData.h" |
| 17 #include "core/offscreencanvas/OffscreenCanvas.h" | 17 #include "core/offscreencanvas/OffscreenCanvas.h" |
| 18 #include "core/svg/SVGImageElement.h" |
| 18 #include "modules/canvas2d/CanvasGradient.h" | 19 #include "modules/canvas2d/CanvasGradient.h" |
| 19 #include "modules/canvas2d/CanvasPattern.h" | 20 #include "modules/canvas2d/CanvasPattern.h" |
| 20 #include "modules/canvas2d/CanvasStyle.h" | 21 #include "modules/canvas2d/CanvasStyle.h" |
| 21 #include "modules/canvas2d/Path2D.h" | 22 #include "modules/canvas2d/Path2D.h" |
| 22 #include "platform/Histogram.h" | 23 #include "platform/Histogram.h" |
| 23 #include "platform/RuntimeEnabledFeatures.h" | 24 #include "platform/RuntimeEnabledFeatures.h" |
| 24 #include "platform/geometry/FloatQuad.h" | 25 #include "platform/geometry/FloatQuad.h" |
| 25 #include "platform/graphics/Color.h" | 26 #include "platform/graphics/Color.h" |
| 26 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" | 27 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" |
| 27 #include "platform/graphics/Image.h" | 28 #include "platform/graphics/Image.h" |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 exceptionState.throwTypeError("CSSImageValue is not yet supported"); | 907 exceptionState.throwTypeError("CSSImageValue is not yet supported"); |
| 907 return nullptr; | 908 return nullptr; |
| 908 } | 909 } |
| 909 if (value.isHTMLImageElement()) | 910 if (value.isHTMLImageElement()) |
| 910 return value.getAsHTMLImageElement(); | 911 return value.getAsHTMLImageElement(); |
| 911 if (value.isHTMLVideoElement()) { | 912 if (value.isHTMLVideoElement()) { |
| 912 HTMLVideoElement* video = value.getAsHTMLVideoElement(); | 913 HTMLVideoElement* video = value.getAsHTMLVideoElement(); |
| 913 video->videoWillBeDrawnToCanvas(); | 914 video->videoWillBeDrawnToCanvas(); |
| 914 return video; | 915 return video; |
| 915 } | 916 } |
| 917 if (value.isSVGImageElement()) |
| 918 return value.getAsSVGImageElement(); |
| 916 if (value.isHTMLCanvasElement()) | 919 if (value.isHTMLCanvasElement()) |
| 917 return value.getAsHTMLCanvasElement(); | 920 return value.getAsHTMLCanvasElement(); |
| 918 if (value.isImageBitmap()) { | 921 if (value.isImageBitmap()) { |
| 919 if (static_cast<ImageBitmap*>(value.getAsImageBitmap())->isNeutered()) { | 922 if (static_cast<ImageBitmap*>(value.getAsImageBitmap())->isNeutered()) { |
| 920 exceptionState.throwDOMException( | 923 exceptionState.throwDOMException( |
| 921 InvalidStateError, String::format("The image source is detached")); | 924 InvalidStateError, String::format("The image source is detached")); |
| 922 return nullptr; | 925 return nullptr; |
| 923 } | 926 } |
| 924 return value.getAsImageBitmap(); | 927 return value.getAsImageBitmap(); |
| 925 } | 928 } |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] * | 2025 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] * |
| 2023 m_usageCounters.numBlurredShadows + | 2026 m_usageCounters.numBlurredShadows + |
| 2024 ExpensiveCanvasHeuristicParameters:: | 2027 ExpensiveCanvasHeuristicParameters:: |
| 2025 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] * | 2028 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] * |
| 2026 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared; | 2029 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared; |
| 2027 | 2030 |
| 2028 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment; | 2031 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment; |
| 2029 } | 2032 } |
| 2030 | 2033 |
| 2031 } // namespace blink | 2034 } // namespace blink |
| OLD | NEW |