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

Side by Side Diff: samplecode/SampleColorFilter.cpp

Issue 17060004: Prototype for build warning as error. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | 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"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 e1 += err1; 78 e1 += err1;
79 e2 += err2; 79 e2 += err2;
80 ae0 += SkAbs32(err0); 80 ae0 += SkAbs32(err0);
81 ae1 += SkAbs32(err1); 81 ae1 += SkAbs32(err1);
82 ae2 += SkAbs32(err2); 82 ae2 += SkAbs32(err2);
83 } 83 }
84 SkDebugf("--- trunc: %d %d round: %d %d new: %d %d\n", e0, ae0, e1, ae1, e2 , ae2); 84 SkDebugf("--- trunc: %d %d round: %d %d new: %d %d\n", e0, ae0, e1, ae1, e2 , ae2);
85 } 85 }
86 86
87 // No longer marked static, since it is externed in SampleUnpremul. 87 // No longer marked static, since it is externed in SampleUnpremul.
88 SkShader* createChecker();
88 SkShader* createChecker() { 89 SkShader* createChecker() {
89 SkBitmap bm; 90 SkBitmap bm;
90 bm.setConfig(SkBitmap::kARGB_8888_Config, 2, 2); 91 bm.setConfig(SkBitmap::kARGB_8888_Config, 2, 2);
91 bm.allocPixels(); 92 bm.allocPixels();
92 bm.lockPixels(); 93 bm.lockPixels();
93 *bm.getAddr32(0, 0) = *bm.getAddr32(1, 1) = SkPreMultiplyColor(0xFFFFFFFF); 94 *bm.getAddr32(0, 0) = *bm.getAddr32(1, 1) = SkPreMultiplyColor(0xFFFFFFFF);
94 *bm.getAddr32(0, 1) = *bm.getAddr32(1, 0) = SkPreMultiplyColor(0xFFCCCCCC); 95 *bm.getAddr32(0, 1) = *bm.getAddr32(1, 0) = SkPreMultiplyColor(0xFFCCCCCC);
95 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, 96 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode,
96 SkShader::kRepeat_TileMode); 97 SkShader::kRepeat_TileMode);
97 98
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 214 }
214 215
215 private: 216 private:
216 typedef SampleView INHERITED; 217 typedef SampleView INHERITED;
217 }; 218 };
218 219
219 ////////////////////////////////////////////////////////////////////////////// 220 //////////////////////////////////////////////////////////////////////////////
220 221
221 static SkView* MyFactory() { return new ColorFilterView; } 222 static SkView* MyFactory() { return new ColorFilterView; }
222 static SkViewRegister reg(MyFactory); 223 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698