OLD | NEW |
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 static const SkShader::TileMode gModes[] = { SkShader::kClamp_TileMode,
SkShader::kRepeat_TileMode, SkShader::kMirror_TileMode }; | 100 static const SkShader::TileMode gModes[] = { SkShader::kClamp_TileMode,
SkShader::kRepeat_TileMode, SkShader::kMirror_TileMode }; |
101 static const char* gModeNames[] = { "C",
"R", "M" }; | 101 static const char* gModeNames[] = { "C",
"R", "M" }; |
102 | 102 |
103 SkScalar y = SkIntToScalar(24); | 103 SkScalar y = SkIntToScalar(24); |
104 SkScalar x = SkIntToScalar(10); | 104 SkScalar x = SkIntToScalar(10); |
105 | 105 |
106 SkPictureRecorder recorder; | 106 SkPictureRecorder recorder; |
107 SkCanvas* textCanvas = NULL; | 107 SkCanvas* textCanvas = NULL; |
108 if (NULL == fTextPicture) { | 108 if (NULL == fTextPicture) { |
109 textCanvas = recorder.beginRecording(1000, 1000); | 109 textCanvas = recorder.beginRecording(1000, 1000, NULL, 0); |
110 } | 110 } |
111 | 111 |
112 if (NULL != textCanvas) { | 112 if (NULL != textCanvas) { |
113 for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) { | 113 for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) { |
114 for (size_t ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) { | 114 for (size_t ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) { |
115 SkPaint p; | 115 SkPaint p; |
116 SkString str; | 116 SkString str; |
117 p.setAntiAlias(true); | 117 p.setAntiAlias(true); |
118 p.setDither(true); | 118 p.setDither(true); |
119 p.setLooper(fLooper); | 119 p.setLooper(fLooper); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 | 170 |
171 private: | 171 private: |
172 typedef SampleView INHERITED; | 172 typedef SampleView INHERITED; |
173 }; | 173 }; |
174 | 174 |
175 ////////////////////////////////////////////////////////////////////////////// | 175 ////////////////////////////////////////////////////////////////////////////// |
176 | 176 |
177 static SkView* MyFactory() { return new TilingView; } | 177 static SkView* MyFactory() { return new TilingView; } |
178 static SkViewRegister reg(MyFactory); | 178 static SkViewRegister reg(MyFactory); |
OLD | NEW |