| 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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 | 680 |
| 681 public: | 681 public: |
| 682 | 682 |
| 683 static void TestPictureFlattenedObjectReuse(skiatest::Reporter* reporter, | 683 static void TestPictureFlattenedObjectReuse(skiatest::Reporter* reporter, |
| 684 CanvasTestStep* testStep, | 684 CanvasTestStep* testStep, |
| 685 uint32_t recordFlags) { | 685 uint32_t recordFlags) { |
| 686 // Verify that when a test step is executed twice, no extra resources | 686 // Verify that when a test step is executed twice, no extra resources |
| 687 // are flattened during the second execution | 687 // are flattened during the second execution |
| 688 testStep->setAssertMessageFormat(kPictureDrawAssertMessageFormat); | 688 testStep->setAssertMessageFormat(kPictureDrawAssertMessageFormat); |
| 689 SkPictureRecorder referenceRecorder; | 689 SkPictureRecorder referenceRecorder; |
| 690 SkCanvas* referenceCanvas = referenceRecorder.beginRecording(kWidth, kHe
ight, | 690 SkCanvas* referenceCanvas = |
| 691 NULL, recor
dFlags); | 691 referenceRecorder.DEPRECATED_beginRecording(kWidth, kHeight, NULL, r
ecordFlags); |
| 692 testStep->draw(referenceCanvas, reporter); | 692 testStep->draw(referenceCanvas, reporter); |
| 693 | 693 |
| 694 SkPictureRecorder testRecorder; | 694 SkPictureRecorder testRecorder; |
| 695 SkCanvas* testCanvas = testRecorder.beginRecording(kWidth, kHeight, | 695 SkCanvas* testCanvas = |
| 696 NULL, recordFlags); | 696 testRecorder.DEPRECATED_beginRecording(kWidth, kHeight, NULL, record
Flags); |
| 697 testStep->draw(testCanvas, reporter); | 697 testStep->draw(testCanvas, reporter); |
| 698 testStep->setAssertMessageFormat(kPictureSecondDrawAssertMessageFormat); | 698 testStep->setAssertMessageFormat(kPictureSecondDrawAssertMessageFormat); |
| 699 testStep->draw(testCanvas, reporter); | 699 testStep->draw(testCanvas, reporter); |
| 700 | 700 |
| 701 SkPictureRecord* referenceRecord = static_cast<SkPictureRecord*>(referen
ceCanvas); | 701 SkPictureRecord* referenceRecord = static_cast<SkPictureRecord*>(referen
ceCanvas); |
| 702 SkPictureRecord* testRecord = static_cast<SkPictureRecord*>(testCanvas); | 702 SkPictureRecord* testRecord = static_cast<SkPictureRecord*>(testCanvas); |
| 703 testStep->setAssertMessageFormat(kPictureResourceReuseMessageFormat); | 703 testStep->setAssertMessageFormat(kPictureResourceReuseMessageFormat); |
| 704 AssertFlattenedObjectsEqual(referenceRecord, testRecord, | 704 AssertFlattenedObjectsEqual(referenceRecord, testRecord, |
| 705 reporter, testStep); | 705 reporter, testStep); |
| 706 } | 706 } |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 if (testStepArray()[testStep]->enablePdfTesting()) { | 910 if (testStepArray()[testStep]->enablePdfTesting()) { |
| 911 TestPdfDevice(reporter, testStepArray()[testStep]); | 911 TestPdfDevice(reporter, testStepArray()[testStep]); |
| 912 } | 912 } |
| 913 } | 913 } |
| 914 | 914 |
| 915 // Explicitly call reset(), so we don't leak the pixels (since kTestBitmap i
s a global) | 915 // Explicitly call reset(), so we don't leak the pixels (since kTestBitmap i
s a global) |
| 916 kTestBitmap.reset(); | 916 kTestBitmap.reset(); |
| 917 | 917 |
| 918 test_newraster(reporter); | 918 test_newraster(reporter); |
| 919 } | 919 } |
| OLD | NEW |