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

Side by Side Diff: samplecode/SampleTiling.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/SampleTextureDomain.cpp ('k') | samplecode/SampleVertices.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 paint.setDither(true); 45 paint.setDither(true);
46 paint.setShader(SkGradientShader::CreateLinear(pts, colors, pos, 46 paint.setShader(SkGradientShader::CreateLinear(pts, colors, pos,
47 SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode, um))->unref() ; 47 SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode, um))->unref() ;
48 canvas.drawPaint(paint); 48 canvas.drawPaint(paint);
49 } 49 }
50 50
51 static void setup(SkPaint* paint, const SkBitmap& bm, bool filter, 51 static void setup(SkPaint* paint, const SkBitmap& bm, bool filter,
52 SkShader::TileMode tmx, SkShader::TileMode tmy) { 52 SkShader::TileMode tmx, SkShader::TileMode tmy) {
53 SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy); 53 SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy);
54 paint->setShader(shader)->unref(); 54 paint->setShader(shader)->unref();
55 paint->setFilterBitmap(filter); 55 paint->setFilterLevel(filter ? SkPaint::kLow_FilterLevel : SkPaint::kNone_Fi lterLevel);
56 } 56 }
57 57
58 static const SkBitmap::Config gConfigs[] = { 58 static const SkBitmap::Config gConfigs[] = {
59 SkBitmap::kARGB_8888_Config, 59 SkBitmap::kARGB_8888_Config,
60 SkBitmap::kRGB_565_Config, 60 SkBitmap::kRGB_565_Config,
61 }; 61 };
62 static const int gWidth = 32; 62 static const int gWidth = 32;
63 static const int gHeight = 32; 63 static const int gHeight = 32;
64 64
65 class TilingView : public SampleView { 65 class TilingView : public SampleView {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 166
167 private: 167 private:
168 typedef SampleView INHERITED; 168 typedef SampleView INHERITED;
169 }; 169 };
170 170
171 ////////////////////////////////////////////////////////////////////////////// 171 //////////////////////////////////////////////////////////////////////////////
172 172
173 static SkView* MyFactory() { return new TilingView; } 173 static SkView* MyFactory() { return new TilingView; }
174 static SkViewRegister reg(MyFactory); 174 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleTextureDomain.cpp ('k') | samplecode/SampleVertices.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698