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/ExceptionStatePlaceholder.h" | 9 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
10 #include "core/css/cssom/CSSURLImageValue.h" | 10 #include "core/css/cssom/CSSURLImageValue.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 while (--stackSize) | 114 while (--stackSize) |
115 skCanvas->restore(); | 115 skCanvas->restore(); |
116 } | 116 } |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 void BaseRenderingContext2D::reset() { | 120 void BaseRenderingContext2D::reset() { |
121 validateStateStack(); | 121 validateStateStack(); |
122 unwindStateStack(); | 122 unwindStateStack(); |
123 m_stateStack.resize(1); | 123 m_stateStack.resize(1); |
124 m_stateStack.first() = CanvasRenderingContext2DState::create(); | 124 m_stateStack.front() = CanvasRenderingContext2DState::create(); |
125 m_path.clear(); | 125 m_path.clear(); |
126 if (SkCanvas* c = existingDrawingCanvas()) { | 126 if (SkCanvas* c = existingDrawingCanvas()) { |
127 // The canvas should always have an initial/unbalanced save frame, which | 127 // The canvas should always have an initial/unbalanced save frame, which |
128 // we use to reset the top level matrix and clip here. | 128 // we use to reset the top level matrix and clip here. |
129 DCHECK_EQ(c->getSaveCount(), 2); | 129 DCHECK_EQ(c->getSaveCount(), 2); |
130 c->restore(); | 130 c->restore(); |
131 c->save(); | 131 c->save(); |
132 DCHECK(c->getTotalMatrix().isIdentity()); | 132 DCHECK(c->getTotalMatrix().isIdentity()); |
133 #if DCHECK_IS_ON() | 133 #if DCHECK_IS_ON() |
134 SkIRect clipBounds; | 134 SkIRect clipBounds; |
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] * | 2014 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] * |
2015 m_usageCounters.numBlurredShadows + | 2015 m_usageCounters.numBlurredShadows + |
2016 ExpensiveCanvasHeuristicParameters:: | 2016 ExpensiveCanvasHeuristicParameters:: |
2017 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] * | 2017 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] * |
2018 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared; | 2018 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared; |
2019 | 2019 |
2020 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment; | 2020 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment; |
2021 } | 2021 } |
2022 | 2022 |
2023 } // namespace blink | 2023 } // namespace blink |
OLD | NEW |