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

Side by Side Diff: samplecode/SampleAAClip.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 | « no previous file | samplecode/SampleAARectModes.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 28 matching lines...) Expand all
39 } 39 }
40 } 40 }
41 41
42 static void drawClip(SkCanvas* canvas, const SkAAClip& clip) { 42 static void drawClip(SkCanvas* canvas, const SkAAClip& clip) {
43 SkMask mask; 43 SkMask mask;
44 SkBitmap bm; 44 SkBitmap bm;
45 45
46 clip.copyToMask(&mask); 46 clip.copyToMask(&mask);
47 SkAutoMaskFreeImage amfi(mask.fImage); 47 SkAutoMaskFreeImage amfi(mask.fImage);
48 48
49 bm.setConfig(SkBitmap::kA8_Config, mask.fBounds.width(), 49 bm.installPixels(SkImageInfo::MakeA8(mask.fBounds.width(),
50 mask.fBounds.height(), mask.fRowBytes); 50 mask.fBounds.height()),
51 bm.setPixels(mask.fImage); 51 mask.fImage, mask.fRowBytes, NULL, NULL);
52 52
53 SkPaint paint; 53 SkPaint paint;
54 canvas->drawBitmap(bm, 54 canvas->drawBitmap(bm,
55 SK_Scalar1 * mask.fBounds.fLeft, 55 SK_Scalar1 * mask.fBounds.fLeft,
56 SK_Scalar1 * mask.fBounds.fTop, 56 SK_Scalar1 * mask.fBounds.fTop,
57 &paint); 57 &paint);
58 } 58 }
59 59
60 class AAClipView : public SampleView { 60 class AAClipView : public SampleView {
61 public: 61 public:
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 119
120 private: 120 private:
121 typedef SkView INHERITED; 121 typedef SkView INHERITED;
122 }; 122 };
123 123
124 ////////////////////////////////////////////////////////////////////////////// 124 //////////////////////////////////////////////////////////////////////////////
125 125
126 static SkView* MyFactory() { return new AAClipView; } 126 static SkView* MyFactory() { return new AAClipView; }
127 static SkViewRegister reg(MyFactory); 127 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « no previous file | samplecode/SampleAARectModes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698