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

Side by Side Diff: gm/tilemodes.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/shadertext3.cpp ('k') | include/core/SkBitmap.h » ('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 #include "SkPath.h" 9 #include "SkPath.h"
10 #include "SkRegion.h" 10 #include "SkRegion.h"
(...skipping 29 matching lines...) Expand all
40 paint.setDither(true); 40 paint.setDither(true);
41 paint.setShader(SkGradientShader::CreateLinear(pts, colors, pos, 41 paint.setShader(SkGradientShader::CreateLinear(pts, colors, pos,
42 SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode, um))->unref() ; 42 SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode, um))->unref() ;
43 canvas.drawPaint(paint); 43 canvas.drawPaint(paint);
44 } 44 }
45 45
46 static void setup(SkPaint* paint, const SkBitmap& bm, bool filter, 46 static void setup(SkPaint* paint, const SkBitmap& bm, bool filter,
47 SkShader::TileMode tmx, SkShader::TileMode tmy) { 47 SkShader::TileMode tmx, SkShader::TileMode tmy) {
48 SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy); 48 SkShader* shader = SkShader::CreateBitmapShader(bm, tmx, tmy);
49 paint->setShader(shader)->unref(); 49 paint->setShader(shader)->unref();
50 paint->setFilterBitmap(filter); 50 paint->setFilterLevel(filter ? SkPaint::kLow_FilterLevel : SkPaint::kNone_Fi lterLevel);
51 } 51 }
52 52
53 static const SkBitmap::Config gConfigs[] = { 53 static const SkBitmap::Config gConfigs[] = {
54 SkBitmap::kARGB_8888_Config, 54 SkBitmap::kARGB_8888_Config,
55 SkBitmap::kRGB_565_Config, 55 SkBitmap::kRGB_565_Config,
56 }; 56 };
57 57
58 class TilingGM : public skiagm::GM { 58 class TilingGM : public skiagm::GM {
59 public: 59 public:
60 TilingGM(bool powerOfTwoSize) 60 TilingGM(bool powerOfTwoSize)
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 private: 262 private:
263 typedef skiagm::GM INHERITED; 263 typedef skiagm::GM INHERITED;
264 }; 264 };
265 265
266 ////////////////////////////////////////////////////////////////////////////// 266 //////////////////////////////////////////////////////////////////////////////
267 267
268 DEF_GM( return new TilingGM(true); ) 268 DEF_GM( return new TilingGM(true); )
269 DEF_GM( return new TilingGM(false); ) 269 DEF_GM( return new TilingGM(false); )
270 DEF_GM( return new Tiling2GM(make_bm, "bitmap"); ) 270 DEF_GM( return new Tiling2GM(make_bm, "bitmap"); )
271 DEF_GM( return new Tiling2GM(make_grad, "gradient"); ) 271 DEF_GM( return new Tiling2GM(make_grad, "gradient"); )
OLDNEW
« no previous file with comments | « gm/shadertext3.cpp ('k') | include/core/SkBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698