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

Side by Side Diff: samplecode/SamplePath.cpp

Issue 169063002: use SkColorType instead of SkBitmap::Config in samplecode (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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/SampleOvalTest.cpp ('k') | samplecode/SampleRegion.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 8
9 #include "SampleCode.h" 9 #include "SampleCode.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 SkRect r = path.getBounds(); 66 SkRect r = path.getBounds();
67 SkIRect ir; 67 SkIRect ir;
68 r.round(&ir); 68 r.round(&ir);
69 SkDebugf("[%g %g %g %g] [%x %x %x %x]\n", 69 SkDebugf("[%g %g %g %g] [%x %x %x %x]\n",
70 SkScalarToDouble(r.fLeft), SkScalarToDouble(r.fTop), 70 SkScalarToDouble(r.fLeft), SkScalarToDouble(r.fTop),
71 SkScalarToDouble(r.fRight), SkScalarToDouble(r.fBottom), 71 SkScalarToDouble(r.fRight), SkScalarToDouble(r.fBottom),
72 ir.fLeft, ir.fTop, ir.fRight, ir.fBottom); 72 ir.fLeft, ir.fTop, ir.fRight, ir.fBottom);
73 } 73 }
74 74
75 SkBitmap bitmap; 75 SkBitmap bitmap;
76 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 300, 200); 76 bitmap.allocN32Pixels(300, 200);
77 bitmap.allocPixels();
78 77
79 SkCanvas canvas(bitmap); 78 SkCanvas canvas(bitmap);
80 SkPaint paint; 79 SkPaint paint;
81 paint.setAntiAlias(true); 80 paint.setAntiAlias(true);
82 canvas.drawPath(path, paint); 81 canvas.drawPath(path, paint);
83 } 82 }
84 83
85 class PathView : public SampleView { 84 class PathView : public SampleView {
86 public: 85 public:
87 int fDStroke, fStroke, fMinStroke, fMaxStroke; 86 int fDStroke, fStroke, fMinStroke, fMaxStroke;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 208 }
210 209
211 private: 210 private:
212 typedef SampleView INHERITED; 211 typedef SampleView INHERITED;
213 }; 212 };
214 213
215 ////////////////////////////////////////////////////////////////////////////// 214 //////////////////////////////////////////////////////////////////////////////
216 215
217 static SkView* MyFactory() { return new PathView; } 216 static SkView* MyFactory() { return new PathView; }
218 static SkViewRegister reg(MyFactory); 217 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleOvalTest.cpp ('k') | samplecode/SampleRegion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698