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 "core/css/CSSFontSelector.h" | 7 #include "core/css/CSSFontSelector.h" |
8 #include "core/css/resolver/FilterOperationResolver.h" | 8 #include "core/css/resolver/FilterOperationResolver.h" |
9 #include "core/css/resolver/StyleBuilder.h" | 9 #include "core/css/resolver/StyleBuilder.h" |
10 #include "core/css/resolver/StyleResolverState.h" | 10 #include "core/css/resolver/StyleResolverState.h" |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 | 536 |
537 if (!shouldDrawShadows() && shadowMode == DrawShadowOnly) { | 537 if (!shouldDrawShadows() && shadowMode == DrawShadowOnly) { |
538 paint->setLooper(sk_ref_sp(emptyDrawLooper())); // draw nothing | 538 paint->setLooper(sk_ref_sp(emptyDrawLooper())); // draw nothing |
539 paint->setImageFilter(0); | 539 paint->setImageFilter(0); |
540 return paint; | 540 return paint; |
541 } | 541 } |
542 | 542 |
543 if (shadowMode == DrawShadowOnly) { | 543 if (shadowMode == DrawShadowOnly) { |
544 if (imageType == NonOpaqueImage || m_filterValue) { | 544 if (imageType == NonOpaqueImage || m_filterValue) { |
545 paint->setLooper(0); | 545 paint->setLooper(0); |
546 paint->setImageFilter(shadowOnlyImageFilter()); | 546 paint->setImageFilter(sk_ref_sp(shadowOnlyImageFilter())); |
547 return paint; | 547 return paint; |
548 } | 548 } |
549 paint->setLooper(sk_ref_sp(shadowOnlyDrawLooper())); | 549 paint->setLooper(sk_ref_sp(shadowOnlyDrawLooper())); |
550 paint->setImageFilter(0); | 550 paint->setImageFilter(0); |
551 return paint; | 551 return paint; |
552 } | 552 } |
553 | 553 |
554 ASSERT(shadowMode == DrawShadowAndForeground); | 554 ASSERT(shadowMode == DrawShadowAndForeground); |
555 if (imageType == NonOpaqueImage) { | 555 if (imageType == NonOpaqueImage) { |
556 paint->setLooper(0); | 556 paint->setLooper(0); |
557 paint->setImageFilter(shadowAndForegroundImageFilter()); | 557 paint->setImageFilter(sk_ref_sp(shadowAndForegroundImageFilter())); |
558 return paint; | 558 return paint; |
559 } | 559 } |
560 paint->setLooper(sk_ref_sp(shadowAndForegroundDrawLooper())); | 560 paint->setLooper(sk_ref_sp(shadowAndForegroundDrawLooper())); |
561 paint->setImageFilter(0); | 561 paint->setImageFilter(0); |
562 return paint; | 562 return paint; |
563 } | 563 } |
564 | 564 |
565 } // namespace blink | 565 } // namespace blink |
OLD | NEW |