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

Side by Side Diff: samplecode/SampleDash.cpp

Issue 245963010: Move SkShader::fLocalMatrix into SkShader constructor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 6 years, 7 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/SampleColorFilter.cpp ('k') | samplecode/SampleFatBits.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 10 matching lines...) Expand all
21 bm.lockPixels(); 21 bm.lockPixels();
22 *bm.getAddr32(0, 0) = SkPreMultiplyARGB(0xFF, SkColorGetR(c), 22 *bm.getAddr32(0, 0) = SkPreMultiplyARGB(0xFF, SkColorGetR(c),
23 SkColorGetG(c), SkColorGetB(c)); 23 SkColorGetG(c), SkColorGetB(c));
24 *bm.getAddr32(1, 0) = 0; 24 *bm.getAddr32(1, 0) = 0;
25 bm.unlockPixels(); 25 bm.unlockPixels();
26 26
27 SkMatrix matrix; 27 SkMatrix matrix;
28 matrix.setScale(SkIntToScalar(width), SK_Scalar1); 28 matrix.setScale(SkIntToScalar(width), SK_Scalar1);
29 29
30 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, 30 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode,
31 SkShader::kClamp_TileMode); 31 SkShader::kClamp_TileMode, &matri x);
32 s->setLocalMatrix(matrix);
33 32
34 paint->setShader(s)->unref(); 33 paint->setShader(s)->unref();
35 } 34 }
36 35
37 class DashView : public SampleView { 36 class DashView : public SampleView {
38 public: 37 public:
39 DashView() { 38 DashView() {
40 this->setBGColor(0xFFDDDDDD); 39 this->setBGColor(0xFFDDDDDD);
41 } 40 }
42 41
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 83 }
85 84
86 private: 85 private:
87 typedef SampleView INHERITED; 86 typedef SampleView INHERITED;
88 }; 87 };
89 88
90 ////////////////////////////////////////////////////////////////////////////// 89 //////////////////////////////////////////////////////////////////////////////
91 90
92 static SkView* MyFactory() { return new DashView; } 91 static SkView* MyFactory() { return new DashView; }
93 static SkViewRegister reg(MyFactory); 92 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleColorFilter.cpp ('k') | samplecode/SampleFatBits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698