| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 /* Description: | 8 /* Description: |
| 9 * This test defines a series of elementatry test steps that perform | 9 * This test defines a series of elementatry test steps that perform |
| 10 * a single or a small group of canvas API calls. Each test step is | 10 * a single or a small group of canvas API calls. Each test step is |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 | 788 |
| 789 for (int testStep = 0; testStep < testStepArray().count(); testStep++) { | 789 for (int testStep = 0; testStep < testStepArray().count(); testStep++) { |
| 790 TestOverrideStateConsistency(reporter, d, testStepArray()[testStep]); | 790 TestOverrideStateConsistency(reporter, d, testStepArray()[testStep]); |
| 791 if (testStepArray()[testStep]->enablePdfTesting()) { | 791 if (testStepArray()[testStep]->enablePdfTesting()) { |
| 792 TestPdfDevice(reporter, d, testStepArray()[testStep]); | 792 TestPdfDevice(reporter, d, testStepArray()[testStep]); |
| 793 } | 793 } |
| 794 } | 794 } |
| 795 | 795 |
| 796 test_newraster(reporter); | 796 test_newraster(reporter); |
| 797 } | 797 } |
| 798 | |
| 799 // Make sure SkCanvas passes clear() calls down to its devices even when they're
clipped out. | |
| 800 DEF_TEST(Canvas_clear, reporter) { | |
| 801 SkBitmap bm; | |
| 802 bm.allocN32Pixels(1,1); | |
| 803 | |
| 804 SkCanvas canvas(bm); | |
| 805 canvas.clear(SK_ColorRED); | |
| 806 REPORTER_ASSERT(reporter, SK_ColorRED == bm.getColor(0,0)); | |
| 807 | |
| 808 canvas.clipRect(SkRect::MakeEmpty()); | |
| 809 canvas.clear(SK_ColorGREEN); | |
| 810 REPORTER_ASSERT(reporter, SK_ColorGREEN == bm.getColor(0,0)); | |
| 811 } | |
| OLD | NEW |