| 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 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
| 10 #include "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 timer.end(); | 647 timer.end(); |
| 648 | 648 |
| 649 #if SK_SUPPORT_GPU | 649 #if SK_SUPPORT_GPU |
| 650 // currently we only setup the frame interval for the GPU | 650 // currently we only setup the frame interval for the GPU |
| 651 if (!frameIntervalComputed && NULL != glContext) { | 651 if (!frameIntervalComputed && NULL != glContext) { |
| 652 frameIntervalTime += timer.fWall; | 652 frameIntervalTime += timer.fWall; |
| 653 frameIntervalTotalLoops += loopsPerIter; | 653 frameIntervalTotalLoops += loopsPerIter; |
| 654 if (frameIntervalTime >= FLAGS_minMs) { | 654 if (frameIntervalTime >= FLAGS_minMs) { |
| 655 frameIntervalComputed = true; | 655 frameIntervalComputed = true; |
| 656 loopsPerFrame = | 656 loopsPerFrame = |
| 657 ((double)frameIntervalTotalLoops / frameIntervalTime
) * FLAGS_minMs; | 657 (int)(((double)frameIntervalTotalLoops / frameInterval
Time) * FLAGS_minMs); |
| 658 if (loopsPerFrame < 1) { | 658 if (loopsPerFrame < 1) { |
| 659 loopsPerFrame = 1; | 659 loopsPerFrame = 1; |
| 660 } | 660 } |
| 661 // SkDebugf(" %s has %d loops in %f ms (normalized to %d
)\n", | 661 // SkDebugf(" %s has %d loops in %f ms (normalized to %d
)\n", |
| 662 // bench->getName(), frameIntervalTotalLoops, | 662 // bench->getName(), frameIntervalTotalLoops, |
| 663 // timer.fWall, loopsPerFrame); | 663 // timer.fWall, loopsPerFrame); |
| 664 } | 664 } |
| 665 } | 665 } |
| 666 #endif | 666 #endif |
| 667 const double current = timer.fWall / loopsPerIter; | 667 const double current = timer.fWall / loopsPerIter; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 gContextFactory.destroyContexts(); | 712 gContextFactory.destroyContexts(); |
| 713 #endif | 713 #endif |
| 714 return 0; | 714 return 0; |
| 715 } | 715 } |
| 716 | 716 |
| 717 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 717 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 718 int main(int argc, char * const argv[]) { | 718 int main(int argc, char * const argv[]) { |
| 719 return tool_main(argc, (char**) argv); | 719 return tool_main(argc, (char**) argv); |
| 720 } | 720 } |
| 721 #endif | 721 #endif |
| OLD | NEW |