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

Side by Side Diff: samplecode/SampleSlides.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/SampleShaders.cpp ('k') | samplecode/SampleSubpixelTranslate.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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 canvas->drawTextOnPath(text, len, path, &matrix, paint); 297 canvas->drawTextOnPath(text, len, path, &matrix, paint);
298 298
299 paint.setColor(0xFF008800); 299 paint.setColor(0xFF008800);
300 matrix.setScale(-SK_Scalar1, -SK_Scalar1); 300 matrix.setScale(-SK_Scalar1, -SK_Scalar1);
301 matrix.postTranslate(pathLen, 0); 301 matrix.postTranslate(pathLen, 0);
302 canvas->drawTextOnPath(text, len, path, &matrix, paint); 302 canvas->drawTextOnPath(text, len, path, &matrix, paint);
303 } 303 }
304 304
305 /////////////////////////////////////////////////////////////////////////////// 305 ///////////////////////////////////////////////////////////////////////////////
306 306
307 #include "SkImageDecoder.h" 307 #include "DecodeFile.h"
308 #include "SkOSFile.h" 308 #include "SkOSFile.h"
309 #include "SkRandom.h" 309 #include "SkRandom.h"
310 #include "SkStream.h" 310 #include "SkStream.h"
311 311
312 static sk_sp<SkShader> make_shader0(SkIPoint* size) { 312 static sk_sp<SkShader> make_shader0(SkIPoint* size) {
313 SkBitmap bm; 313 SkBitmap bm;
314 314
315 SkImageDecoder::DecodeFile("/skimages/logo.gif", &bm); 315 decode_file("/skimages/logo.gif", &bm);
316 size->set(bm.width(), bm.height()); 316 size->set(bm.width(), bm.height());
317 return SkShader::MakeBitmapShader(bm, SkShader::kClamp_TileMode, 317 return SkShader::MakeBitmapShader(bm, SkShader::kClamp_TileMode,
318 SkShader::kClamp_TileMode); 318 SkShader::kClamp_TileMode);
319 } 319 }
320 320
321 static sk_sp<SkShader> make_shader1(const SkIPoint& size) { 321 static sk_sp<SkShader> make_shader1(const SkIPoint& size) {
322 SkPoint pts[] = { { 0, 0 }, 322 SkPoint pts[] = { { 0, 0 },
323 { SkIntToScalar(size.fX), SkIntToScalar(size.fY) } }; 323 { SkIntToScalar(size.fX), SkIntToScalar(size.fY) } };
324 SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED } ; 324 SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED } ;
325 return SkGradientShader::MakeLinear(pts, colors, nullptr, 325 return SkGradientShader::MakeLinear(pts, colors, nullptr,
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 } 710 }
711 711
712 private: 712 private:
713 typedef SampleView INHERITED; 713 typedef SampleView INHERITED;
714 }; 714 };
715 715
716 ////////////////////////////////////////////////////////////////////////////// 716 //////////////////////////////////////////////////////////////////////////////
717 717
718 static SkView* MyFactory() { return new SlideView; } 718 static SkView* MyFactory() { return new SlideView; }
719 static SkViewRegister reg(MyFactory); 719 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleShaders.cpp ('k') | samplecode/SampleSubpixelTranslate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698