OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkBitmapSource.h" | 9 #include "SkBitmapSource.h" |
10 #include "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 SkASSERT(p.canComputeFastBounds()); | 87 SkASSERT(p.canComputeFastBounds()); |
88 } | 88 } |
89 | 89 |
90 // Create a selection of imagefilter-based paints to test | 90 // Create a selection of imagefilter-based paints to test |
91 static void create_paints(SkImageFilter* source, SkTArray<SkPaint>* paints) { | 91 static void create_paints(SkImageFilter* source, SkTArray<SkPaint>* paints) { |
92 { | 92 { |
93 SkMatrix scale; | 93 SkMatrix scale; |
94 scale.setScale(2.0f, 2.0f); | 94 scale.setScale(2.0f, 2.0f); |
95 | 95 |
96 SkAutoTUnref<SkMatrixImageFilter> scaleMIF( | 96 SkAutoTUnref<SkMatrixImageFilter> scaleMIF( |
97 SkMatrixImageFilter::Create(scale, SkPaint::kLow_FilterLevel, source
)); | 97 SkMatrixImageFilter::Create(scale, kLow_SkFilterQuality, source)); |
98 | 98 |
99 add_paint(scaleMIF, paints); | 99 add_paint(scaleMIF, paints); |
100 } | 100 } |
101 | 101 |
102 { | 102 { |
103 SkMatrix rot; | 103 SkMatrix rot; |
104 rot.setRotate(-33.3f); | 104 rot.setRotate(-33.3f); |
105 | 105 |
106 SkAutoTUnref<SkMatrixImageFilter> rotMIF( | 106 SkAutoTUnref<SkMatrixImageFilter> rotMIF( |
107 SkMatrixImageFilter::Create(rot, SkPaint::kLow_FilterLevel, source))
; | 107 SkMatrixImageFilter::Create(rot, kLow_SkFilterQuality, source)); |
108 | 108 |
109 add_paint(rotMIF, paints); | 109 add_paint(rotMIF, paints); |
110 } | 110 } |
111 | 111 |
112 { | 112 { |
113 static const SkDropShadowImageFilter::ShadowMode kBoth = | 113 static const SkDropShadowImageFilter::ShadowMode kBoth = |
114 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode
; | 114 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode
; |
115 | 115 |
116 SkAutoTUnref<SkDropShadowImageFilter> dsif( | 116 SkAutoTUnref<SkDropShadowImageFilter> dsif( |
117 SkDropShadowImageFilter::Create(10.0f, 10.0f, | 117 SkDropShadowImageFilter::Create(10.0f, 10.0f, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 private: | 319 private: |
320 typedef GM INHERITED; | 320 typedef GM INHERITED; |
321 }; | 321 }; |
322 | 322 |
323 ////////////////////////////////////////////////////////////////////////////// | 323 ////////////////////////////////////////////////////////////////////////////// |
324 | 324 |
325 DEF_GM(return SkNEW(ImageFilterFastBoundGM);) | 325 DEF_GM(return SkNEW(ImageFilterFastBoundGM);) |
326 | 326 |
327 } | 327 } |
OLD | NEW |