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

Side by Side Diff: samplecode/SampleFilter.cpp

Issue 51033004: add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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/SampleBitmapRect.cpp ('k') | samplecode/SampleFilter2.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"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 SkShader::kRepeat_TileMode); 52 SkShader::kRepeat_TileMode);
53 paint->setShader(s)->unref(); 53 paint->setShader(s)->unref();
54 canvas->drawRect(SkRect::MakeWH(w, h), *paint); 54 canvas->drawRect(SkRect::MakeWH(w, h), *paint);
55 paint->setShader(NULL); 55 paint->setShader(NULL);
56 return w * 5/4; 56 return w * 5/4;
57 #endif 57 #endif
58 } 58 }
59 59
60 static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, SkPaint* p ) { 60 static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, SkPaint* p ) {
61 x += draw_bm(c, bm, x, 0, p); 61 x += draw_bm(c, bm, x, 0, p);
62 p->setFilterBitmap(true); 62 p->setFilterLevel(SkPaint::kLow_FilterLevel);
63 x += draw_bm(c, bm, x, 0, p); 63 x += draw_bm(c, bm, x, 0, p);
64 p->setDither(true); 64 p->setDither(true);
65 return x + draw_bm(c, bm, x, 0, p); 65 return x + draw_bm(c, bm, x, 0, p);
66 } 66 }
67 67
68 static const char* gConfigNames[] = { 68 static const char* gConfigNames[] = {
69 "unknown config", 69 "unknown config",
70 "A1", 70 "A1",
71 "A8", 71 "A8",
72 "Index8", 72 "Index8",
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 private: 137 private:
138 typedef SampleView INHERITED; 138 typedef SampleView INHERITED;
139 }; 139 };
140 140
141 ////////////////////////////////////////////////////////////////////////////// 141 //////////////////////////////////////////////////////////////////////////////
142 142
143 static SkView* MyFactory() { return new FilterView; } 143 static SkView* MyFactory() { return new FilterView; }
144 static SkViewRegister reg(MyFactory); 144 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleBitmapRect.cpp ('k') | samplecode/SampleFilter2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698