Move SkShader::fLocalMatrix into SkShader constructor.
As a first step towards removing SkShader::setLocalMatrix, which will make
SkShader thread-safe, remove calls to setLocalMatrix that happen immediately
after the shader is being created. Instead, pass the matrix into the constructor
or factory method.
BUG=skia:1976
R=scroggo@google.com, reed@google.com, skyostil@google.com, mtklein@google.com
Author: dominikg@chromium.org
Review URL: https://codereview.chromium.org/245963010
git-svn-id: http://skia.googlecode.com/svn/trunk@14401 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleHairModes.cpp b/samplecode/SampleHairModes.cpp
index 4aa8e02..8788577 100644
--- a/samplecode/SampleHairModes.cpp
+++ b/samplecode/SampleHairModes.cpp
@@ -66,14 +66,13 @@
*bm.getAddr32(0, 0) = *bm.getAddr32(1, 1) = 0xFFFFFFFF;
*bm.getAddr32(1, 0) = *bm.getAddr32(0, 1) = SkPackARGB32(0xFF, 0xCC, 0xCC, 0xCC);
- SkShader* s = SkShader::CreateBitmapShader(bm,
- SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode);
-
SkMatrix m;
m.setScale(SkIntToScalar(6), SkIntToScalar(6));
- s->setLocalMatrix(m);
- return s;
+
+ return SkShader::CreateBitmapShader(bm,
+ SkShader::kRepeat_TileMode,
+ SkShader::kRepeat_TileMode,
+ &m);
}
class HairModesView : public SampleView {