| 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 | 8 |
| 9 | 9 |
| 10 #include "BenchTimer.h" | 10 #include "BenchTimer.h" |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 device = make_device(outConfig, dim, backend, sampleCount, conte
xt); | 785 device = make_device(outConfig, dim, backend, sampleCount, conte
xt); |
| 786 if (NULL == device) { | 786 if (NULL == device) { |
| 787 SkString error; | 787 SkString error; |
| 788 error.printf("Device creation failure for config %s. Will sk
ip.\n", configName); | 788 error.printf("Device creation failure for config %s. Will sk
ip.\n", configName); |
| 789 logger.logError(error.c_str()); | 789 logger.logError(error.c_str()); |
| 790 setupFailed = true; | 790 setupFailed = true; |
| 791 } else { | 791 } else { |
| 792 switch(benchMode) { | 792 switch(benchMode) { |
| 793 case kDeferredSilent_benchModes: | 793 case kDeferredSilent_benchModes: |
| 794 case kDeferred_benchModes: | 794 case kDeferred_benchModes: |
| 795 canvas = | 795 canvas = SkDeferredCanvas::Create(device); |
| 796 #if SK_DEFERRED_CANVAS_USES_FACTORIES | |
| 797 SkDeferredCanvas::Create(device); | |
| 798 #else | |
| 799 SkNEW_ARGS(SkDeferredCanvas, (device)); | |
| 800 #endif | |
| 801 break; | 796 break; |
| 802 case kRecord_benchModes: | 797 case kRecord_benchModes: |
| 803 canvas = pictureRecordTo.beginRecording(dim.fX, dim.
fY, | 798 canvas = pictureRecordTo.beginRecording(dim.fX, dim.
fY, |
| 804 SkPicture::kUsePathBoundsForClip_RecordingFlag); | 799 SkPicture::kUsePathBoundsForClip_RecordingFlag); |
| 805 canvas->ref(); | 800 canvas->ref(); |
| 806 break; | 801 break; |
| 807 case kPictureRecord_benchModes: { | 802 case kPictureRecord_benchModes: { |
| 808 // This sets up picture-to-picture recording. | 803 // This sets up picture-to-picture recording. |
| 809 // The C++ drawing calls for the benchmark are recor
ded into | 804 // The C++ drawing calls for the benchmark are recor
ded into |
| 810 // pictureRecordFrom. As the benchmark, we will time
how | 805 // pictureRecordFrom. As the benchmark, we will time
how |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 } | 966 } |
| 972 | 967 |
| 973 return 0; | 968 return 0; |
| 974 } | 969 } |
| 975 | 970 |
| 976 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 971 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 977 int main(int argc, char * const argv[]) { | 972 int main(int argc, char * const argv[]) { |
| 978 return tool_main(argc, (char**) argv); | 973 return tool_main(argc, (char**) argv); |
| 979 } | 974 } |
| 980 #endif | 975 #endif |
| OLD | NEW |