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

Side by Side Diff: gm/shadertext2.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/ninepatchstretch.cpp ('k') | gm/shadertext3.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "gm.h" 7 #include "gm.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkGradientShader.h" 9 #include "SkGradientShader.h"
10 #include "SkUnitMappers.h" 10 #include "SkUnitMappers.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (bmp.isNull()) { 95 if (bmp.isNull()) {
96 makebm(&bmp, SkBitmap::kARGB_8888_Config, kPointSize / 2, kPointSize / 2); 96 makebm(&bmp, SkBitmap::kARGB_8888_Config, kPointSize / 2, kPointSize / 2);
97 } 97 }
98 98
99 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(bmp, 99 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(bmp,
100 SkShader::kMi rror_TileMode, 100 SkShader::kMi rror_TileMode,
101 SkShader::kRe peat_TileMode)); 101 SkShader::kRe peat_TileMode));
102 SkPaint fillPaint; 102 SkPaint fillPaint;
103 fillPaint.setAntiAlias(true); 103 fillPaint.setAntiAlias(true);
104 fillPaint.setTextSize(SkIntToScalar(kPointSize)); 104 fillPaint.setTextSize(SkIntToScalar(kPointSize));
105 fillPaint.setFilterBitmap(true); 105 fillPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
106 fillPaint.setShader(shader); 106 fillPaint.setShader(shader);
107 107
108 SkPaint outlinePaint; 108 SkPaint outlinePaint;
109 outlinePaint.setAntiAlias(true); 109 outlinePaint.setAntiAlias(true);
110 outlinePaint.setTextSize(SkIntToScalar(kPointSize)); 110 outlinePaint.setTextSize(SkIntToScalar(kPointSize));
111 outlinePaint.setStyle(SkPaint::kStroke_Style); 111 outlinePaint.setStyle(SkPaint::kStroke_Style);
112 outlinePaint.setStrokeWidth(0.f); 112 outlinePaint.setStrokeWidth(0.f);
113 113
114 SkScalar w = fillPaint.measureText(kText, kTextLen); 114 SkScalar w = fillPaint.measureText(kText, kTextLen);
115 static SkScalar kPadY = 0.5f * kPointSize; 115 static SkScalar kPadY = 0.5f * kPointSize;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 typedef GM INHERITED; 213 typedef GM INHERITED;
214 }; 214 };
215 215
216 /////////////////////////////////////////////////////////////////////////////// 216 ///////////////////////////////////////////////////////////////////////////////
217 217
218 #ifndef SK_BUILD_FOR_ANDROID 218 #ifndef SK_BUILD_FOR_ANDROID
219 static GM* MyFactory(void*) { return new ShaderText2GM; } 219 static GM* MyFactory(void*) { return new ShaderText2GM; }
220 static GMRegistry reg(MyFactory); 220 static GMRegistry reg(MyFactory);
221 #endif 221 #endif
222 } 222 }
OLDNEW
« no previous file with comments | « gm/ninepatchstretch.cpp ('k') | gm/shadertext3.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698