OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 tiles[i].offsetY * kPictureSize); | 114 tiles[i].offsetY * kPictureSize); |
115 localMatrix.postScale(kFillSize / (2 * kPictureSize), | 115 localMatrix.postScale(kFillSize / (2 * kPictureSize), |
116 kFillSize / (2 * kPictureSize)); | 116 kFillSize / (2 * kPictureSize)); |
117 | 117 |
118 SkPicture* picturePtr = picture.get(); | 118 SkPicture* picturePtr = picture.get(); |
119 SkRect* tilePtr = &tile; | 119 SkRect* tilePtr = &tile; |
120 | 120 |
121 if (tile == SkRect::MakeWH(kPictureSize, kPictureSize)) { | 121 if (tile == SkRect::MakeWH(kPictureSize, kPictureSize)) { |
122 // When the tile == picture bounds, exercise the picture + offse
t path. | 122 // When the tile == picture bounds, exercise the picture + offse
t path. |
123 picturePtr = offsetPicture.get(); | 123 picturePtr = offsetPicture.get(); |
124 tilePtr = NULL; | 124 tilePtr = nullptr; |
125 } | 125 } |
126 | 126 |
127 fShaders[i].reset(SkShader::CreatePictureShader(picturePtr, | 127 fShaders[i].reset(SkShader::CreatePictureShader(picturePtr, |
128 SkShader::kRepeat_Ti
leMode, | 128 SkShader::kRepeat_Ti
leMode, |
129 SkShader::kRepeat_Ti
leMode, | 129 SkShader::kRepeat_Ti
leMode, |
130 &localMatrix, | 130 &localMatrix, |
131 tilePtr)); | 131 tilePtr)); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
(...skipping 14 matching lines...) Expand all Loading... |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 private: | 152 private: |
153 SkAutoTUnref<SkShader> fShaders[SK_ARRAY_COUNT(tiles)]; | 153 SkAutoTUnref<SkShader> fShaders[SK_ARRAY_COUNT(tiles)]; |
154 | 154 |
155 typedef GM INHERITED; | 155 typedef GM INHERITED; |
156 }; | 156 }; |
157 | 157 |
158 DEF_GM(return new PictureShaderTileGM;) | 158 DEF_GM(return new PictureShaderTileGM;) |
OLD | NEW |