OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/CanvasRenderingContext2DState.h" | 5 #include "modules/canvas2d/CanvasRenderingContext2DState.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "core/css/CSSFontSelector.h" | 8 #include "core/css/CSSFontSelector.h" |
8 #include "core/css/resolver/FilterOperationResolver.h" | 9 #include "core/css/resolver/FilterOperationResolver.h" |
9 #include "core/css/resolver/StyleBuilder.h" | 10 #include "core/css/resolver/StyleBuilder.h" |
10 #include "core/css/resolver/StyleResolverState.h" | 11 #include "core/css/resolver/StyleResolverState.h" |
11 #include "core/html/HTMLCanvasElement.h" | 12 #include "core/html/HTMLCanvasElement.h" |
12 #include "core/paint/FilterEffectBuilder.h" | 13 #include "core/paint/FilterEffectBuilder.h" |
13 #include "core/style/ComputedStyle.h" | 14 #include "core/style/ComputedStyle.h" |
14 #include "core/style/FilterOperation.h" | 15 #include "core/style/FilterOperation.h" |
15 #include "core/svg/SVGFilterElement.h" | 16 #include "core/svg/SVGFilterElement.h" |
16 #include "modules/canvas2d/CanvasGradient.h" | 17 #include "modules/canvas2d/CanvasGradient.h" |
17 #include "modules/canvas2d/CanvasPattern.h" | 18 #include "modules/canvas2d/CanvasPattern.h" |
18 #include "modules/canvas2d/CanvasRenderingContext2D.h" | 19 #include "modules/canvas2d/CanvasRenderingContext2D.h" |
19 #include "modules/canvas2d/CanvasStyle.h" | 20 #include "modules/canvas2d/CanvasStyle.h" |
20 #include "platform/graphics/DrawLooperBuilder.h" | 21 #include "platform/graphics/DrawLooperBuilder.h" |
21 #include "platform/graphics/filters/FilterEffect.h" | 22 #include "platform/graphics/filters/FilterEffect.h" |
22 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" | 23 #include "platform/graphics/filters/SkiaImageFilterBuilder.h" |
23 #include "platform/graphics/paint/PaintCanvas.h" | 24 #include "platform/graphics/paint/PaintCanvas.h" |
24 #include "platform/graphics/paint/PaintFlags.h" | 25 #include "platform/graphics/paint/PaintFlags.h" |
25 #include "platform/graphics/skia/SkiaUtils.h" | 26 #include "platform/graphics/skia/SkiaUtils.h" |
26 #include "third_party/skia/include/effects/SkDashPathEffect.h" | 27 #include "third_party/skia/include/effects/SkDashPathEffect.h" |
27 #include "third_party/skia/include/effects/SkDropShadowImageFilter.h" | 28 #include "third_party/skia/include/effects/SkDropShadowImageFilter.h" |
28 #include <memory> | |
29 | 29 |
30 static const char defaultFont[] = "10px sans-serif"; | 30 static const char defaultFont[] = "10px sans-serif"; |
31 static const char defaultFilter[] = "none"; | 31 static const char defaultFilter[] = "none"; |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 CanvasRenderingContext2DState::CanvasRenderingContext2DState() | 35 CanvasRenderingContext2DState::CanvasRenderingContext2DState() |
36 : m_unrealizedSaveCount(0), | 36 : m_unrealizedSaveCount(0), |
37 m_strokeStyle(CanvasStyle::createFromRGBA(SK_ColorBLACK)), | 37 m_strokeStyle(CanvasStyle::createFromRGBA(SK_ColorBLACK)), |
38 m_fillStyle(CanvasStyle::createFromRGBA(SK_ColorBLACK)), | 38 m_fillStyle(CanvasStyle::createFromRGBA(SK_ColorBLACK)), |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 flags->setLooper(0); | 592 flags->setLooper(0); |
593 flags->setImageFilter(shadowAndForegroundImageFilter()); | 593 flags->setImageFilter(shadowAndForegroundImageFilter()); |
594 return flags; | 594 return flags; |
595 } | 595 } |
596 flags->setLooper(sk_ref_sp(shadowAndForegroundDrawLooper())); | 596 flags->setLooper(sk_ref_sp(shadowAndForegroundDrawLooper())); |
597 flags->setImageFilter(0); | 597 flags->setImageFilter(0); |
598 return flags; | 598 return flags; |
599 } | 599 } |
600 | 600 |
601 } // namespace blink | 601 } // namespace blink |
OLD | NEW |