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

Side by Side Diff: samplecode/SampleXfermodesBlur.cpp

Issue 253833002: move common blur types into central header (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 7 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/SampleTextureDomain.cpp ('k') | src/animator/SkDrawBlur.h » ('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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 28 matching lines...) Expand all
39 39
40 static uint16_t gBG[] = { 0xFFFF, 0xCCCF, 0xCCCF, 0xFFFF }; 40 static uint16_t gBG[] = { 0xFFFF, 0xCCCF, 0xCCCF, 0xFFFF };
41 41
42 class XfermodesBlurView : public SampleView { 42 class XfermodesBlurView : public SampleView {
43 SkBitmap fBG; 43 SkBitmap fBG;
44 SkBitmap fSrcB, fDstB; 44 SkBitmap fSrcB, fDstB;
45 45
46 void draw_mode(SkCanvas* canvas, SkXfermode* mode, int alpha, 46 void draw_mode(SkCanvas* canvas, SkXfermode* mode, int alpha,
47 SkScalar x, SkScalar y) { 47 SkScalar x, SkScalar y) {
48 SkPaint p; 48 SkPaint p;
49 SkMaskFilter* mf = SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_Bl urStyle, 49 SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
50 SkBlurMask::ConvertRadiusToSigma(SkIntToS calar(5)), 50 SkBlurMask::ConvertRadiusToSigma(SkIntToS calar(5)),
51 SkBlurMaskFilter::kNone_BlurFlag); 51 SkBlurMaskFilter::kNone_BlurFlag);
52 p.setMaskFilter(mf)->unref(); 52 p.setMaskFilter(mf)->unref();
53 53
54 SkScalar ww = SkIntToScalar(W); 54 SkScalar ww = SkIntToScalar(W);
55 SkScalar hh = SkIntToScalar(H); 55 SkScalar hh = SkIntToScalar(H);
56 56
57 // draw a circle covering the upper 57 // draw a circle covering the upper
58 // left three quarters of the canvas 58 // left three quarters of the canvas
59 p.setColor(0xFFCC44FF); 59 p.setColor(0xFFCC44FF);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 204
205 private: 205 private:
206 typedef SampleView INHERITED; 206 typedef SampleView INHERITED;
207 }; 207 };
208 208
209 ////////////////////////////////////////////////////////////////////////////// 209 //////////////////////////////////////////////////////////////////////////////
210 210
211 static SkView* MyFactory() { return new XfermodesBlurView; } 211 static SkView* MyFactory() { return new XfermodesBlurView; }
212 static SkViewRegister reg(MyFactory); 212 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleTextureDomain.cpp ('k') | src/animator/SkDrawBlur.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698