OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 #if SK_SUPPORT_GPU | 39 #if SK_SUPPORT_GPU |
40 virtual bool canFilterMaskGPU(const SkRect& devBounds, | 40 virtual bool canFilterMaskGPU(const SkRect& devBounds, |
41 const SkIRect& clipBounds, | 41 const SkIRect& clipBounds, |
42 const SkMatrix& ctm, | 42 const SkMatrix& ctm, |
43 SkRect* maskRect) const SK_OVERRIDE; | 43 SkRect* maskRect) const SK_OVERRIDE; |
44 virtual bool directFilterMaskGPU(GrContext* context, | 44 virtual bool directFilterMaskGPU(GrContext* context, |
45 GrPaint* grp, | 45 GrPaint* grp, |
46 const SkStrokeRec& strokeRec, | 46 const SkStrokeRec& strokeRec, |
47 const SkPath& path) const SK_OVERRIDE; | 47 const SkPath& path) const SK_OVERRIDE; |
| 48 virtual bool directFilterRRectMaskGPU(GrContext* context, |
| 49 GrPaint* grp, |
| 50 const SkStrokeRec& strokeRec, |
| 51 const SkRRect& rrect) const SK_OVERRID
E; |
48 | 52 |
49 virtual bool filterMaskGPU(GrTexture* src, | 53 virtual bool filterMaskGPU(GrTexture* src, |
50 const SkMatrix& ctm, | 54 const SkMatrix& ctm, |
51 const SkRect& maskRect, | 55 const SkRect& maskRect, |
52 GrTexture** result, | 56 GrTexture** result, |
53 bool canOverwriteSrc) const SK_OVERRIDE; | 57 bool canOverwriteSrc) const SK_OVERRIDE; |
54 #endif | 58 #endif |
55 | 59 |
56 virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; | 60 virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; |
57 | 61 |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 return false; | 816 return false; |
813 } | 817 } |
814 | 818 |
815 | 819 |
816 grp->addCoverageEffect(effect); | 820 grp->addCoverageEffect(effect); |
817 | 821 |
818 context->drawRect(*grp, rect); | 822 context->drawRect(*grp, rect); |
819 return true; | 823 return true; |
820 } | 824 } |
821 | 825 |
| 826 bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context, |
| 827 GrPaint* grp, |
| 828 const SkStrokeRec& strokeRec
, |
| 829 const SkRRect& rrect) const
{ |
| 830 return false; |
| 831 } |
| 832 |
822 bool SkBlurMaskFilterImpl::canFilterMaskGPU(const SkRect& srcBounds, | 833 bool SkBlurMaskFilterImpl::canFilterMaskGPU(const SkRect& srcBounds, |
823 const SkIRect& clipBounds, | 834 const SkIRect& clipBounds, |
824 const SkMatrix& ctm, | 835 const SkMatrix& ctm, |
825 SkRect* maskRect) const { | 836 SkRect* maskRect) const { |
826 SkScalar xformedSigma = this->computeXformedSigma(ctm); | 837 SkScalar xformedSigma = this->computeXformedSigma(ctm); |
827 if (xformedSigma <= 0) { | 838 if (xformedSigma <= 0) { |
828 return false; | 839 return false; |
829 } | 840 } |
830 | 841 |
831 static const SkScalar kMIN_GPU_BLUR_SIZE = SkIntToScalar(64); | 842 static const SkScalar kMIN_GPU_BLUR_SIZE = SkIntToScalar(64); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 } else { | 944 } else { |
934 str->append("None"); | 945 str->append("None"); |
935 } | 946 } |
936 str->append("))"); | 947 str->append("))"); |
937 } | 948 } |
938 #endif | 949 #endif |
939 | 950 |
940 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 951 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
941 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 952 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
942 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 953 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |