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 "Test.h" | 8 #include "Test.h" |
9 #include "RecordTestUtils.h" | 9 #include "RecordTestUtils.h" |
10 | 10 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 SkCanvasMock(int width, int height) : SkCanvas(width, height) { | 288 SkCanvasMock(int width, int height) : SkCanvas(width, height) { |
289 this->resetTestValues(); | 289 this->resetTestValues(); |
290 } | 290 } |
291 | 291 |
292 void onDrawImage(const SkImage* image, SkScalar left, SkScalar top, | 292 void onDrawImage(const SkImage* image, SkScalar left, SkScalar top, |
293 const SkPaint* paint) override { | 293 const SkPaint* paint) override { |
294 fDrawImageCalled = true; | 294 fDrawImageCalled = true; |
295 } | 295 } |
296 | 296 |
297 void onDrawImageRect(const SkImage* image, const SkRect* src, const SkRe
ct& dst, | 297 void onDrawImageRect(const SkImage* image, const SkRect* src, const SkRe
ct& dst, |
298 const SkPaint* paint) override { | 298 const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(cons
traint)) override { |
299 fDrawImageRectCalled = true; | 299 fDrawImageRectCalled = true; |
300 } | 300 } |
301 | 301 |
302 void resetTestValues() { | 302 void resetTestValues() { |
303 fDrawImageCalled = fDrawImageRectCalled = false; | 303 fDrawImageCalled = fDrawImageRectCalled = false; |
304 } | 304 } |
305 | 305 |
306 bool fDrawImageCalled; | 306 bool fDrawImageCalled; |
307 bool fDrawImageRectCalled; | 307 bool fDrawImageRectCalled; |
308 }; | 308 }; |
(...skipping 15 matching lines...) Expand all Loading... |
324 | 324 |
325 { | 325 { |
326 SkRecord record; | 326 SkRecord record; |
327 SkRecorder recorder(&record, 10, 10); | 327 SkRecorder recorder(&record, 10, 10); |
328 recorder.drawImageRect(image, 0, SkRect::MakeWH(10, 10)); | 328 recorder.drawImageRect(image, 0, SkRect::MakeWH(10, 10)); |
329 SkRecordDraw(record, &canvas, NULL, NULL, 0, NULL, 0); | 329 SkRecordDraw(record, &canvas, NULL, NULL, 0, NULL, 0); |
330 } | 330 } |
331 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled); | 331 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled); |
332 | 332 |
333 } | 333 } |
OLD | NEW |