OLD | NEW |
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 "Test.h" | 8 #include "Test.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 } | 160 } |
161 } | 161 } |
162 } | 162 } |
163 } | 163 } |
164 | 164 |
165 /////////////////////////////////////////////////////////////////////////////// | 165 /////////////////////////////////////////////////////////////////////////////// |
166 | 166 |
167 struct Mesh { | 167 struct Mesh { |
168 SkPoint fPts[4]; | 168 SkPoint fPts[4]; |
169 uint16_t fIndices[6]; | |
170 | 169 |
171 Mesh(const SkBitmap& bm, SkPaint* paint) { | 170 Mesh(const SkBitmap& bm, SkPaint* paint) { |
172 const SkScalar w = SkIntToScalar(bm.width()); | 171 const SkScalar w = SkIntToScalar(bm.width()); |
173 const SkScalar h = SkIntToScalar(bm.height()); | 172 const SkScalar h = SkIntToScalar(bm.height()); |
174 fPts[0].set(0, 0); | 173 fPts[0].set(0, 0); |
175 fPts[1].set(w, 0); | 174 fPts[1].set(w, 0); |
176 fPts[2].set(w, h); | 175 fPts[2].set(w, h); |
177 fPts[3].set(0, h); | 176 fPts[3].set(0, h); |
178 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kClamp_TileMode
, | 177 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kClamp_TileMode
, |
179 SkShader::kClamp_TileMode); | 178 SkShader::kClamp_TileMode); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 266 } |
268 } | 267 } |
269 | 268 |
270 static void TestBlitRow(skiatest::Reporter* reporter) { | 269 static void TestBlitRow(skiatest::Reporter* reporter) { |
271 test_00_FF(reporter); | 270 test_00_FF(reporter); |
272 test_diagonal(reporter); | 271 test_diagonal(reporter); |
273 } | 272 } |
274 | 273 |
275 #include "TestClassDef.h" | 274 #include "TestClassDef.h" |
276 DEFINE_TESTCLASS("BlitRow", TestBlitRowClass, TestBlitRow) | 275 DEFINE_TESTCLASS("BlitRow", TestBlitRowClass, TestBlitRow) |
OLD | NEW |