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

Side by Side Diff: samplecode/SampleSubpixelTranslate.cpp

Issue 334793002: hide Config in SkImageDecoder -- use SkColorType instead (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix warning Created 6 years, 6 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
« no previous file with comments | « samplecode/SampleFilter2.cpp ('k') | samplecode/SampleUnpremul.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 2014 Google Inc. 3 * Copyright 2014 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 "gm.h" 9 #include "gm.h"
10 #include "SampleCode.h" 10 #include "SampleCode.h"
(...skipping 19 matching lines...) Expand all
30 path.append("/"); 30 path.append("/");
31 path.append(fFilename); 31 path.append(fFilename);
32 32
33 SkImageDecoder *codec = NULL; 33 SkImageDecoder *codec = NULL;
34 SkFILEStream stream(path.c_str()); 34 SkFILEStream stream(path.c_str());
35 if (stream.isValid()) { 35 if (stream.isValid()) {
36 codec = SkImageDecoder::Factory(&stream); 36 codec = SkImageDecoder::Factory(&stream);
37 } 37 }
38 if (codec) { 38 if (codec) {
39 stream.rewind(); 39 stream.rewind();
40 codec->decode(&stream, &fBM, SkBitmap::kARGB_8888_Config, 40 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecode Pixels_Mode);
41 SkImageDecoder::kDecodePixels_Mode);
42 SkDELETE(codec); 41 SkDELETE(codec);
43 } else { 42 } else {
44 fBM.allocN32Pixels(1, 1); 43 fBM.allocN32Pixels(1, 1);
45 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad 44 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
46 } 45 }
47 fCurPos = SkPoint::Make(0,0); 46 fCurPos = SkPoint::Make(0,0);
48 fSize = 200; 47 fSize = 200;
49 } 48 }
50 49
51 protected: 50 protected:
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 116 }
118 117
119 private: 118 private:
120 typedef SampleView INHERITED; 119 typedef SampleView INHERITED;
121 }; 120 };
122 121
123 ////////////////////////////////////////////////////////////////////////////// 122 //////////////////////////////////////////////////////////////////////////////
124 123
125 static SkView* MyFactory() { return new SubpixelTranslateView("mandrill_256.png" , .05f, .05f); } 124 static SkView* MyFactory() { return new SubpixelTranslateView("mandrill_256.png" , .05f, .05f); }
126 static SkViewRegister reg(MyFactory); 125 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleFilter2.cpp ('k') | samplecode/SampleUnpremul.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698