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

Side by Side Diff: samplecode/SampleSlides.cpp

Issue 23701006: Push sigma-based blur interface into our GMs/benches/tests/samplecode (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: cleaned up Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « samplecode/SampleFuzz.cpp ('k') | samplecode/SampleStrokePath.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h"
10 #include "SkCanvas.h" 11 #include "SkCanvas.h"
11 #include "SkDevice.h" 12 #include "SkDevice.h"
12 #include "SkFlattenableBuffers.h" 13 #include "SkFlattenableBuffers.h"
14 #include "SkGradientShader.h"
15 #include "SkLayerRasterizer.h"
13 #include "SkPaint.h" 16 #include "SkPaint.h"
17 #include "SkView.h"
14 18
15 #define BG_COLOR 0xFFDDDDDD 19 #define BG_COLOR 0xFFDDDDDD
16 20
17 typedef void (*SlideProc)(SkCanvas*); 21 typedef void (*SlideProc)(SkCanvas*);
18 22
19 /////////////////////////////////////////////////////////////////////////////// 23 ///////////////////////////////////////////////////////////////////////////////
20 24
21 #include "Sk1DPathEffect.h" 25 #include "Sk1DPathEffect.h"
22 #include "Sk2DPathEffect.h" 26 #include "Sk2DPathEffect.h"
23 #include "SkCornerPathEffect.h" 27 #include "SkCornerPathEffect.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 fRecs[i].fVerts, fRecs[i].fTexs, 468 fRecs[i].fVerts, fRecs[i].fTexs,
465 NULL, NULL, NULL, 0, paint); 469 NULL, NULL, NULL, 0, paint);
466 canvas->restore(); 470 canvas->restore();
467 471
468 canvas->translate(0, SkIntToScalar(250)); 472 canvas->translate(0, SkIntToScalar(250));
469 } 473 }
470 } 474 }
471 475
472 /////////////////////////////////////////////////////////////////////////////// 476 ///////////////////////////////////////////////////////////////////////////////
473 477
474 #include "SkGradientShader.h"
475 #include "SkLayerRasterizer.h"
476 #include "SkBlurMaskFilter.h"
477
478 static void r0(SkLayerRasterizer* rast, SkPaint& p) 478 static void r0(SkLayerRasterizer* rast, SkPaint& p)
479 { 479 {
480 p.setMaskFilter(SkBlurMaskFilter::Create(SkIntToScalar(3), 480 p.setMaskFilter(SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_BlurStyle ,
481 SkBlurMaskFilter::kNormal_BlurStyle ))->unref(); 481 SkBlurMask::ConvertRadiusToSigma(Sk IntToScalar(3))))->unref();
482 rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3)); 482 rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3));
483 483
484 p.setMaskFilter(NULL); 484 p.setMaskFilter(NULL);
485 p.setStyle(SkPaint::kStroke_Style); 485 p.setStyle(SkPaint::kStroke_Style);
486 p.setStrokeWidth(SK_Scalar1); 486 p.setStrokeWidth(SK_Scalar1);
487 rast->addLayer(p); 487 rast->addLayer(p);
488 488
489 p.setAlpha(0x11); 489 p.setAlpha(0x11);
490 p.setStyle(SkPaint::kFill_Style); 490 p.setStyle(SkPaint::kFill_Style);
491 p.setXfermodeMode(SkXfermode::kSrc_Mode); 491 p.setXfermodeMode(SkXfermode::kSrc_Mode);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 } 725 }
726 726
727 private: 727 private:
728 typedef SampleView INHERITED; 728 typedef SampleView INHERITED;
729 }; 729 };
730 730
731 ////////////////////////////////////////////////////////////////////////////// 731 //////////////////////////////////////////////////////////////////////////////
732 732
733 static SkView* MyFactory() { return new SlideView; } 733 static SkView* MyFactory() { return new SlideView; }
734 static SkViewRegister reg(MyFactory); 734 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleFuzz.cpp ('k') | samplecode/SampleStrokePath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698