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

Side by Side Diff: samplecode/SampleTiling.cpp

Issue 238273012: Staged removal of SkPicture-derived classes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: have SkPicture only friend SkPictureRecorder once Created 6 years, 8 months 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/SamplePicture.cpp ('k') | src/core/SkPicture.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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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);
OLDNEW
« no previous file with comments | « samplecode/SamplePicture.cpp ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698