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

Side by Side Diff: gm/imagefiltersbase.cpp

Issue 646213004: Adding an option to render only the shadow in SkDropShadowImageFilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added dropshadowimagefilter to ignored-tests Created 6 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
« no previous file with comments | « gm/dropshadowimagefilter.cpp ('k') | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 }; 224 };
225 225
226 SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorRED, 226 SkColorFilter* cf = SkColorFilter::CreateModeFilter(SK_ColorRED,
227 SkXfermode::kSrcIn_Mode); 227 SkXfermode::kSrcIn_Mode);
228 SkImageFilter* filters[] = { 228 SkImageFilter* filters[] = {
229 NULL, 229 NULL,
230 IdentityImageFilter::Create(), 230 IdentityImageFilter::Create(),
231 FailImageFilter::Create(), 231 FailImageFilter::Create(),
232 SkColorFilterImageFilter::Create(cf), 232 SkColorFilterImageFilter::Create(cf),
233 SkBlurImageFilter::Create(12.0f, 0.0f), 233 SkBlurImageFilter::Create(12.0f, 0.0f),
234 SkDropShadowImageFilter::Create(10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLU E), 234 SkDropShadowImageFilter::Create(10.0f, 5.0f, 3.0f, 3.0f, SK_ColorBLU E,
235 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode),
235 }; 236 };
236 cf->unref(); 237 cf->unref();
237 238
238 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); 239 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
239 SkScalar MARGIN = SkIntToScalar(16); 240 SkScalar MARGIN = SkIntToScalar(16);
240 SkScalar DX = r.width() + MARGIN; 241 SkScalar DX = r.width() + MARGIN;
241 SkScalar DY = r.height() + MARGIN; 242 SkScalar DY = r.height() + MARGIN;
242 243
243 canvas->translate(MARGIN, MARGIN); 244 canvas->translate(MARGIN, MARGIN);
244 for (size_t i = 0; i < SK_ARRAY_COUNT(drawProc); ++i) { 245 for (size_t i = 0; i < SK_ARRAY_COUNT(drawProc); ++i) {
(...skipping 14 matching lines...) Expand all
259 } 260 }
260 261
261 private: 262 private:
262 typedef GM INHERITED; 263 typedef GM INHERITED;
263 }; 264 };
264 265
265 /////////////////////////////////////////////////////////////////////////////// 266 ///////////////////////////////////////////////////////////////////////////////
266 267
267 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } 268 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; }
268 static skiagm::GMRegistry reg(MyFactory); 269 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/dropshadowimagefilter.cpp ('k') | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698