Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Side by Side Diff: gm/filterfastbounds.cpp

Issue 1390523005: factories should return baseclass, allowing the impl to specialize (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkDropShadowImageFilter.h" 10 #include "SkDropShadowImageFilter.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 SkAutoTUnref<SkImageFilter> rotMIF( 106 SkAutoTUnref<SkImageFilter> rotMIF(
107 SkImageFilter::CreateMatrixFilter(rot, kLow_SkFilterQuality, source) ); 107 SkImageFilter::CreateMatrixFilter(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<SkImageFilter> dsif(
117 SkDropShadowImageFilter::Create(10.0f, 10.0f, 117 SkDropShadowImageFilter::Create(10.0f, 10.0f,
118 3.0f, 3.0f, 118 3.0f, 3.0f,
119 SK_ColorRED, kBoth, 119 SK_ColorRED, kBoth,
120 source, nullptr)); 120 source, nullptr));
121 121
122 add_paint(dsif, paints); 122 add_paint(dsif, paints);
123 } 123 }
124 124
125 { 125 {
126 SkAutoTUnref<SkDropShadowImageFilter> dsif( 126 SkAutoTUnref<SkImageFilter> dsif(
127 SkDropShadowImageFilter::Create(27.0f, 27.0f, 127 SkDropShadowImageFilter::Create(27.0f, 27.0f,
128 3.0f, 3.0f, 128 3.0f, 3.0f,
129 SK_ColorRED, 129 SK_ColorRED,
130 SkDropShadowImageFilter::kDrawShadow Only_ShadowMode, 130 SkDropShadowImageFilter::kDrawShadow Only_ShadowMode,
131 source, nullptr)); 131 source, nullptr));
132 132
133 add_paint(dsif, paints); 133 add_paint(dsif, paints);
134 } 134 }
135 135
136 { 136 {
137 SkAutoTUnref<SkBlurImageFilter> bif(SkBlurImageFilter::Create(3, 3, sour ce)); 137 SkAutoTUnref<SkImageFilter> bif(SkBlurImageFilter::Create(3, 3, source)) ;
138 138
139 add_paint(bif, paints); 139 add_paint(bif, paints);
140 } 140 }
141 141
142 { 142 {
143 SkAutoTUnref<SkOffsetImageFilter> oif(SkOffsetImageFilter::Create(15, 15 , source)); 143 SkAutoTUnref<SkImageFilter> oif(SkOffsetImageFilter::Create(15, 15, sour ce));
144 144
145 add_paint(oif, paints); 145 add_paint(oif, paints);
146 } 146 }
147 } 147 }
148 148
149 // This GM visualizes the fast bounds for various combinations of geometry 149 // This GM visualizes the fast bounds for various combinations of geometry
150 // and image filter 150 // and image filter
151 class ImageFilterFastBoundGM : public GM { 151 class ImageFilterFastBoundGM : public GM {
152 public: 152 public:
153 ImageFilterFastBoundGM() { 153 ImageFilterFastBoundGM() {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
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 new ImageFilterFastBoundGM;) 325 DEF_GM(return new ImageFilterFastBoundGM;)
326 } 326 }
OLDNEW
« no previous file with comments | « no previous file | include/effects/SkBlurImageFilter.h » ('j') | include/effects/SkOffsetImageFilter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698