Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: bench/benchmain.cpp

Issue 16040002: Changing SkDeferredCanvas to use factories for creation (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bench/DeferredSurfaceCopyBench.cpp ('k') | gm/gmmain.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 SkCanvas* canvas = NULL; 813 SkCanvas* canvas = NULL;
814 SkPicture pictureRecordFrom; 814 SkPicture pictureRecordFrom;
815 SkPicture pictureRecordTo; 815 SkPicture pictureRecordTo;
816 816
817 if (kNonRendering_Backend != backend) { 817 if (kNonRendering_Backend != backend) {
818 device = make_device(outConfig, dim, backend, sampleCount, conte xt); 818 device = make_device(outConfig, dim, backend, sampleCount, conte xt);
819 819
820 switch(benchMode) { 820 switch(benchMode) {
821 case kDeferredSilent_benchModes: 821 case kDeferredSilent_benchModes:
822 case kDeferred_benchModes: 822 case kDeferred_benchModes:
823 canvas = new SkDeferredCanvas(device); 823 canvas =
824 #if SK_DEFERRED_CANVAS_USES_FACTORIES
825 SkDeferredCanvas::Create(device);
826 #else
827 SkNEW_ARGS(SkDeferredCanvas, (device));
828 #endif
824 break; 829 break;
825 case kRecord_benchModes: 830 case kRecord_benchModes:
826 canvas = pictureRecordTo.beginRecording(dim.fX, dim.fY, 831 canvas = pictureRecordTo.beginRecording(dim.fX, dim.fY,
827 SkPicture::kUsePathBoundsForClip_RecordingFlag); 832 SkPicture::kUsePathBoundsForClip_RecordingFlag);
828 canvas->ref(); 833 canvas->ref();
829 break; 834 break;
830 case kPictureRecord_benchModes: { 835 case kPictureRecord_benchModes: {
831 // This sets up picture-to-picture recording. 836 // This sets up picture-to-picture recording.
832 // The C++ drawing calls for the benchmark are recorded into 837 // The C++ drawing calls for the benchmark are recorded into
833 // pictureRecordFrom. As the benchmark, we will time how 838 // pictureRecordFrom. As the benchmark, we will time how
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 } 987 }
983 988
984 return 0; 989 return 0;
985 } 990 }
986 991
987 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 992 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
988 int main(int argc, char * const argv[]) { 993 int main(int argc, char * const argv[]) {
989 return tool_main(argc, (char**) argv); 994 return tool_main(argc, (char**) argv);
990 } 995 }
991 #endif 996 #endif
OLDNEW
« no previous file with comments | « bench/DeferredSurfaceCopyBench.cpp ('k') | gm/gmmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698