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

Side by Side Diff: samplecode/SampleDither.cpp

Issue 171723007: add new copyTo version to SkBitmap, which takes SkColorType (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/SampleApp.cpp ('k') | samplecode/SampleDitherBitmap.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 class DitherView : public SampleView { 112 class DitherView : public SampleView {
113 public: 113 public:
114 SkBitmap fBM, fBMPreDither, fBM16; 114 SkBitmap fBM, fBMPreDither, fBM16;
115 SkScalar fAngle; 115 SkScalar fAngle;
116 116
117 DitherView() { 117 DitherView() {
118 make_bm(&fBM); 118 make_bm(&fBM);
119 make_bm(&fBMPreDither); 119 make_bm(&fBMPreDither);
120 pre_dither(fBMPreDither); 120 pre_dither(fBMPreDither);
121 fBM.copyTo(&fBM16, SkBitmap::kARGB_4444_Config); 121 fBM.copyTo(&fBM16, kARGB_4444_SkColorType);
122 122
123 fAngle = 0; 123 fAngle = 0;
124 124
125 this->setBGColor(0xFF181818); 125 this->setBGColor(0xFF181818);
126 } 126 }
127 127
128 protected: 128 protected:
129 // overrides from SkEventSink 129 // overrides from SkEventSink
130 virtual bool onQuery(SkEvent* evt) { 130 virtual bool onQuery(SkEvent* evt) {
131 if (SampleCode::TitleQ(*evt)) { 131 if (SampleCode::TitleQ(*evt)) {
(...skipping 37 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 DitherView; } 177 static SkView* MyFactory() { return new DitherView; }
178 static SkViewRegister reg(MyFactory); 178 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | samplecode/SampleDitherBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698