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

Side by Side Diff: gm/bitmapfilters.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 | « gm/bigmatrix.cpp ('k') | gm/bitmapmatrix.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 "gm.h" 8 #include "gm.h"
9 9
10 namespace skiagm { 10 namespace skiagm {
(...skipping 21 matching lines...) Expand all
32 32
33 static SkScalar draw_bm(SkCanvas* canvas, const SkBitmap& bm, 33 static SkScalar draw_bm(SkCanvas* canvas, const SkBitmap& bm,
34 SkScalar x, SkScalar y, SkPaint* paint) { 34 SkScalar x, SkScalar y, SkPaint* paint) {
35 canvas->drawBitmap(bm, x, y, paint); 35 canvas->drawBitmap(bm, x, y, paint);
36 return SkIntToScalar(bm.width()) * 5/4; 36 return SkIntToScalar(bm.width()) * 5/4;
37 } 37 }
38 38
39 static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x, 39 static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x,
40 SkPaint* p) { 40 SkPaint* p) {
41 x += draw_bm(c, bm, x, 0, p); 41 x += draw_bm(c, bm, x, 0, p);
42 p->setFilterBitmap(true); 42 p->setFilterLevel(SkPaint::kLow_FilterLevel);
43 x += draw_bm(c, bm, x, 0, p); 43 x += draw_bm(c, bm, x, 0, p);
44 p->setDither(true); 44 p->setDither(true);
45 return x + draw_bm(c, bm, x, 0, p); 45 return x + draw_bm(c, bm, x, 0, p);
46 } 46 }
47 47
48 static const char* gConfigNames[] = { 48 static const char* gConfigNames[] = {
49 "unknown config", 49 "unknown config",
50 "A1", 50 "A1",
51 "A8", 51 "A8",
52 "Index8", 52 "Index8",
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 private: 124 private:
125 typedef GM INHERITED; 125 typedef GM INHERITED;
126 }; 126 };
127 127
128 ////////////////////////////////////////////////////////////////////////////// 128 //////////////////////////////////////////////////////////////////////////////
129 129
130 static GM* MyFactory(void*) { return new FilterGM; } 130 static GM* MyFactory(void*) { return new FilterGM; }
131 static GMRegistry reg(MyFactory); 131 static GMRegistry reg(MyFactory);
132 132
133 } 133 }
OLDNEW
« no previous file with comments | « gm/bigmatrix.cpp ('k') | gm/bitmapmatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698