| 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" |
| (...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 if (!imageSmoothingEnabled() && | 1077 if (!imageSmoothingEnabled() && |
| 1078 isDrawScalingDown(srcRect, dstRect, state().transform().xScaleSquared(), | 1078 isDrawScalingDown(srcRect, dstRect, state().transform().xScaleSquared(), |
| 1079 state().transform().yScaleSquared())) | 1079 state().transform().yScaleSquared())) |
| 1080 imageFlags.setFilterQuality(kLow_SkFilterQuality); | 1080 imageFlags.setFilterQuality(kLow_SkFilterQuality); |
| 1081 | 1081 |
| 1082 if (!imageSource->isVideoElement()) { | 1082 if (!imageSource->isVideoElement()) { |
| 1083 imageFlags.setAntiAlias(shouldDrawImageAntialiased(dstRect)); | 1083 imageFlags.setAntiAlias(shouldDrawImageAntialiased(dstRect)); |
| 1084 image->draw(c, imageFlags, dstRect, srcRect, DoNotRespectImageOrientation, | 1084 image->draw(c, imageFlags, dstRect, srcRect, DoNotRespectImageOrientation, |
| 1085 Image::DoNotClampImageToSourceRect, drawImageColorBehavior()); | 1085 Image::DoNotClampImageToSourceRect); |
| 1086 } else { | 1086 } else { |
| 1087 c->save(); | 1087 c->save(); |
| 1088 c->clipRect(dstRect); | 1088 c->clipRect(dstRect); |
| 1089 c->translate(dstRect.x(), dstRect.y()); | 1089 c->translate(dstRect.x(), dstRect.y()); |
| 1090 c->scale(dstRect.width() / srcRect.width(), | 1090 c->scale(dstRect.width() / srcRect.width(), |
| 1091 dstRect.height() / srcRect.height()); | 1091 dstRect.height() / srcRect.height()); |
| 1092 c->translate(-srcRect.x(), -srcRect.y()); | 1092 c->translate(-srcRect.x(), -srcRect.y()); |
| 1093 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(imageSource); | 1093 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(imageSource); |
| 1094 video->paintCurrentFrame( | 1094 video->paintCurrentFrame( |
| 1095 c, | 1095 c, |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] * | 2022 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] * |
| 2023 m_usageCounters.numBlurredShadows + | 2023 m_usageCounters.numBlurredShadows + |
| 2024 ExpensiveCanvasHeuristicParameters:: | 2024 ExpensiveCanvasHeuristicParameters:: |
| 2025 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] * | 2025 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] * |
| 2026 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared; | 2026 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared; |
| 2027 | 2027 |
| 2028 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment; | 2028 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment; |
| 2029 } | 2029 } |
| 2030 | 2030 |
| 2031 } // namespace blink | 2031 } // namespace blink |
| OLD | NEW |