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

Side by Side Diff: samplecode/SamplePatch.cpp

Issue 1812323003: Remove uses of SkImageDecoder from samplecode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/SampleLines.cpp ('k') | samplecode/SamplePath.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "DecodeFile.h"
8 #include "SampleCode.h" 9 #include "SampleCode.h"
9 #include "SkAnimTimer.h" 10 #include "SkAnimTimer.h"
10 #include "SkView.h" 11 #include "SkView.h"
11 #include "SkCanvas.h" 12 #include "SkCanvas.h"
12 #include "SkGradientShader.h" 13 #include "SkGradientShader.h"
13 #include "SkGraphics.h" 14 #include "SkGraphics.h"
14 #include "SkImageDecoder.h"
15 #include "SkPath.h" 15 #include "SkPath.h"
16 #include "SkRandom.h" 16 #include "SkRandom.h"
17 #include "SkRegion.h" 17 #include "SkRegion.h"
18 #include "SkShader.h" 18 #include "SkShader.h"
19 #include "SkUtils.h" 19 #include "SkUtils.h"
20 #include "SkXfermode.h" 20 #include "SkXfermode.h"
21 #include "SkColorPriv.h" 21 #include "SkColorPriv.h"
22 #include "SkColorFilter.h" 22 #include "SkColorFilter.h"
23 #include "SkTime.h" 23 #include "SkTime.h"
24 #include "SkTypeface.h" 24 #include "SkTypeface.h"
25 25
26 #include "SkOSFile.h" 26 #include "SkOSFile.h"
27 #include "SkStream.h" 27 #include "SkStream.h"
28 28
29 #include "SkGeometry.h" // private include :( 29 #include "SkGeometry.h" // private include :(
30 30
31 static sk_sp<SkShader> make_shader0(SkIPoint* size) { 31 static sk_sp<SkShader> make_shader0(SkIPoint* size) {
32 SkBitmap bm; 32 SkBitmap bm;
33 33
34 // SkImageDecoder::DecodeFile("/skimages/progressivejpg.jpg", &bm); 34 // decode_file("/skimages/progressivejpg.jpg", &bm);
35 SkImageDecoder::DecodeFile("/skimages/logo.png", &bm); 35 decode_file("/skimages/logo.png", &bm);
36 size->set(bm.width(), bm.height()); 36 size->set(bm.width(), bm.height());
37 return SkShader::MakeBitmapShader(bm, SkShader::kClamp_TileMode, 37 return SkShader::MakeBitmapShader(bm, SkShader::kClamp_TileMode,
38 SkShader::kClamp_TileMode); 38 SkShader::kClamp_TileMode);
39 } 39 }
40 40
41 static sk_sp<SkShader> make_shader1(const SkIPoint& size) { 41 static sk_sp<SkShader> make_shader1(const SkIPoint& size) {
42 SkPoint pts[] = { { 0, 0, }, 42 SkPoint pts[] = { { 0, 0, },
43 { SkIntToScalar(size.fX), SkIntToScalar(size.fY) } }; 43 { SkIntToScalar(size.fX), SkIntToScalar(size.fY) } };
44 SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED } ; 44 SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED } ;
45 return SkGradientShader::MakeLinear(pts, colors, nullptr, 45 return SkGradientShader::MakeLinear(pts, colors, nullptr,
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 333 }
334 334
335 private: 335 private:
336 typedef SampleView INHERITED; 336 typedef SampleView INHERITED;
337 }; 337 };
338 338
339 ////////////////////////////////////////////////////////////////////////////// 339 //////////////////////////////////////////////////////////////////////////////
340 340
341 static SkView* MyFactory() { return new PatchView; } 341 static SkView* MyFactory() { return new PatchView; }
342 static SkViewRegister reg(MyFactory); 342 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleLines.cpp ('k') | samplecode/SamplePath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698