OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 fPts[2].set(w, h); | 167 fPts[2].set(w, h); |
168 fPts[3].set(0, h); | 168 fPts[3].set(0, h); |
169 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kClamp_TileMode
, | 169 SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kClamp_TileMode
, |
170 SkShader::kClamp_TileMode); | 170 SkShader::kClamp_TileMode); |
171 paint->setShader(s)->unref(); | 171 paint->setShader(s)->unref(); |
172 | 172 |
173 } | 173 } |
174 | 174 |
175 void draw(SkCanvas* canvas, SkPaint* paint) { | 175 void draw(SkCanvas* canvas, SkPaint* paint) { |
176 canvas->drawVertices(SkCanvas::kTriangleFan_VertexMode, 4, fPts, fPts, | 176 canvas->drawVertices(SkCanvas::kTriangleFan_VertexMode, 4, fPts, fPts, |
177 NULL, NULL, NULL, 0, *paint); | 177 nullptr, nullptr, nullptr, 0, *paint); |
178 } | 178 } |
179 }; | 179 }; |
180 | 180 |
181 #include "SkImageEncoder.h" | 181 #include "SkImageEncoder.h" |
182 static void save_bm(const SkBitmap& bm, const char name[]) { | 182 static void save_bm(const SkBitmap& bm, const char name[]) { |
183 SkImageEncoder::EncodeFile(name, bm, SkImageEncoder::kPNG_Type, 100); | 183 SkImageEncoder::EncodeFile(name, bm, SkImageEncoder::kPNG_Type, 100); |
184 } | 184 } |
185 | 185 |
186 static bool gOnce; | 186 static bool gOnce; |
187 | 187 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 255 } |
256 } | 256 } |
257 } | 257 } |
258 } | 258 } |
259 } | 259 } |
260 | 260 |
261 DEF_TEST(BlitRow, reporter) { | 261 DEF_TEST(BlitRow, reporter) { |
262 test_00_FF(reporter); | 262 test_00_FF(reporter); |
263 test_diagonal(reporter); | 263 test_diagonal(reporter); |
264 } | 264 } |
OLD | NEW |