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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 validateStateStack(); | 74 validateStateStack(); |
75 if (state().hasUnrealizedSaves()) { | 75 if (state().hasUnrealizedSaves()) { |
76 // We never realized the save, so just record that it was unnecessary. | 76 // We never realized the save, so just record that it was unnecessary. |
77 m_stateStack.last()->restore(); | 77 m_stateStack.last()->restore(); |
78 return; | 78 return; |
79 } | 79 } |
80 ASSERT(m_stateStack.size() >= 1); | 80 ASSERT(m_stateStack.size() >= 1); |
81 if (m_stateStack.size() <= 1) | 81 if (m_stateStack.size() <= 1) |
82 return; | 82 return; |
83 m_path.transform(state().transform()); | 83 m_path.transform(state().transform()); |
84 m_stateStack.removeLast(); | 84 m_stateStack.pop_back(); |
85 m_stateStack.last()->clearResolvedFilter(); | 85 m_stateStack.last()->clearResolvedFilter(); |
86 m_path.transform(state().transform().inverse()); | 86 m_path.transform(state().transform().inverse()); |
87 SkCanvas* c = drawingCanvas(); | 87 SkCanvas* c = drawingCanvas(); |
88 if (c) | 88 if (c) |
89 c->restore(); | 89 c->restore(); |
90 | 90 |
91 validateStateStack(); | 91 validateStateStack(); |
92 } | 92 } |
93 | 93 |
94 void BaseRenderingContext2D::restoreMatrixClipStack(SkCanvas* c) const { | 94 void BaseRenderingContext2D::restoreMatrixClipStack(SkCanvas* c) const { |
(...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1983 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] * | 1983 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] * |
1984 m_usageCounters.numBlurredShadows + | 1984 m_usageCounters.numBlurredShadows + |
1985 ExpensiveCanvasHeuristicParameters:: | 1985 ExpensiveCanvasHeuristicParameters:: |
1986 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] * | 1986 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] * |
1987 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared; | 1987 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared; |
1988 | 1988 |
1989 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment; | 1989 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment; |
1990 } | 1990 } |
1991 | 1991 |
1992 } // namespace blink | 1992 } // namespace blink |
OLD | NEW |