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

Side by Side Diff: samplecode/ClockFaceView.cpp

Issue 822953003: Revert of remove unused SkAvoidXfermode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « include/effects/SkAvoidXfermode.h ('k') | samplecode/SampleAll.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 "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkReadBuffer.h" 11 #include "SkReadBuffer.h"
12 #include "SkWriteBuffer.h" 12 #include "SkWriteBuffer.h"
13 #include "SkGradientShader.h" 13 #include "SkGradientShader.h"
14 #include "SkPath.h" 14 #include "SkPath.h"
15 #include "SkRegion.h" 15 #include "SkRegion.h"
16 #include "SkShader.h" 16 #include "SkShader.h"
17 #include "SkUtils.h" 17 #include "SkUtils.h"
18 #include "SkColorPriv.h" 18 #include "SkColorPriv.h"
19 #include "SkColorFilter.h" 19 #include "SkColorFilter.h"
20 #include "SkTypeface.h" 20 #include "SkTypeface.h"
21 #include "SkAvoidXfermode.h"
21 22
22 static inline SkPMColor rgb2gray(SkPMColor c) { 23 static inline SkPMColor rgb2gray(SkPMColor c) {
23 unsigned r = SkGetPackedR32(c); 24 unsigned r = SkGetPackedR32(c);
24 unsigned g = SkGetPackedG32(c); 25 unsigned g = SkGetPackedG32(c);
25 unsigned b = SkGetPackedB32(c); 26 unsigned b = SkGetPackedB32(c);
26 27
27 unsigned x = (r * 5 + g * 7 + b * 4) >> 4; 28 unsigned x = (r * 5 + g * 7 + b * 4) >> 4;
28 29
29 return SkPackARGB32(0, x, x, x) | (c & (SK_A32_MASK << SK_A32_SHIFT)); 30 return SkPackARGB32(0, x, x, x) | (c & (SK_A32_MASK << SK_A32_SHIFT));
30 } 31 }
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 246 }
246 247
247 private: 248 private:
248 typedef SkView INHERITED; 249 typedef SkView INHERITED;
249 }; 250 };
250 251
251 ////////////////////////////////////////////////////////////////////////////// 252 //////////////////////////////////////////////////////////////////////////////
252 253
253 static SkView* MyFactory() { return new ClockFaceView; } 254 static SkView* MyFactory() { return new ClockFaceView; }
254 static SkViewRegister reg(MyFactory); 255 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/effects/SkAvoidXfermode.h ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698