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

Side by Side Diff: samplecode/SampleAAClip.cpp

Issue 169913003: replace SkBitmap::Config with SkColorType in gms (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 | « include/core/SkBitmap.h ('k') | src/core/SkBitmap.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.installPixels(SkImageInfo::MakeA8(mask.fBounds.width(), 49 bm.installMaskPixels(mask);
50 mask.fBounds.height()),
51 mask.fImage, mask.fRowBytes, NULL, NULL);
52 50
53 SkPaint paint; 51 SkPaint paint;
54 canvas->drawBitmap(bm, 52 canvas->drawBitmap(bm,
55 SK_Scalar1 * mask.fBounds.fLeft, 53 SK_Scalar1 * mask.fBounds.fLeft,
56 SK_Scalar1 * mask.fBounds.fTop, 54 SK_Scalar1 * mask.fBounds.fTop,
57 &paint); 55 &paint);
58 } 56 }
59 57
60 class AAClipView : public SampleView { 58 class AAClipView : public SampleView {
61 public: 59 public:
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 116 }
119 117
120 private: 118 private:
121 typedef SkView INHERITED; 119 typedef SkView INHERITED;
122 }; 120 };
123 121
124 ////////////////////////////////////////////////////////////////////////////// 122 //////////////////////////////////////////////////////////////////////////////
125 123
126 static SkView* MyFactory() { return new AAClipView; } 124 static SkView* MyFactory() { return new AAClipView; }
127 static SkViewRegister reg(MyFactory); 125 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/core/SkBitmap.h ('k') | src/core/SkBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698