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/SamplePictFile.cpp

Issue 784223007: Remove canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « include/core/SkSurface.h ('k') | src/core/SkCanvas.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 7
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkDumpCanvas.h" 9 #include "SkDumpCanvas.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 can->drawBitmap(bm, 0, 0, NULL); 129 can->drawBitmap(bm, 0, 0, NULL);
130 pic.reset(recorder.endRecording()); 130 pic.reset(recorder.endRecording());
131 } else { 131 } else {
132 SkFILEStream stream(path); 132 SkFILEStream stream(path);
133 if (stream.isValid()) { 133 if (stream.isValid()) {
134 pic.reset(SkPicture::CreateFromStream(&stream)); 134 pic.reset(SkPicture::CreateFromStream(&stream));
135 } else { 135 } else {
136 SkDebugf("coun't load picture at \"path\"\n", path); 136 SkDebugf("coun't load picture at \"path\"\n", path);
137 } 137 }
138 138
139 if (false) {
140 SkSurface* surf = SkSurface::NewRasterPMColor(SkScalarCeilToInt( pic->cullRect().width()),
141 SkScalarCeilToInt( pic->cullRect().height()));
142 surf->getCanvas()->drawPicture(pic);
143 surf->unref();
144 }
145 if (false) { // re-record 139 if (false) { // re-record
146 SkPictureRecorder recorder; 140 SkPictureRecorder recorder;
147 pic->playback(recorder.beginRecording(pic->cullRect().width(), 141 pic->playback(recorder.beginRecording(pic->cullRect().width(),
148 pic->cullRect().height(), 142 pic->cullRect().height(),
149 NULL, 0)); 143 NULL, 0));
150 SkAutoTUnref<SkPicture> p2(recorder.endRecording()); 144 SkAutoTUnref<SkPicture> p2(recorder.endRecording());
151 145
152 SkString path2(path); 146 SkString path2(path);
153 path2.append(".new.skp"); 147 path2.append(".new.skp");
154 SkFILEWStream writer(path2.c_str()); 148 SkFILEWStream writer(path2.c_str());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 SampleView* CreateSamplePictFileView(const char filename[]) { 189 SampleView* CreateSamplePictFileView(const char filename[]) {
196 return new PictFileView(filename); 190 return new PictFileView(filename);
197 } 191 }
198 192
199 ////////////////////////////////////////////////////////////////////////////// 193 //////////////////////////////////////////////////////////////////////////////
200 194
201 #if 0 195 #if 0
202 static SkView* MyFactory() { return new PictFileView; } 196 static SkView* MyFactory() { return new PictFileView; }
203 static SkViewRegister reg(MyFactory); 197 static SkViewRegister reg(MyFactory);
204 #endif 198 #endif
OLDNEW
« no previous file with comments | « include/core/SkSurface.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698