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

Side by Side Diff: bench/GMBench.cpp

Issue 347823004: Remove Sk prefix from some bench classes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkGMBench -> GMBench Created 6 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
« no previous file with comments | « bench/GMBench.h ('k') | bench/GameBench.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 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 #include "SkGMBench.h" 8 #include "GMBench.h"
9 9
10 SkGMBench::SkGMBench(skiagm::GM* gm) : fGM(gm) { 10 GMBench::GMBench(skiagm::GM* gm) : fGM(gm) {
11 fName.printf("GM:%s", gm->getName()); 11 fName.printf("GM:%s", gm->getName());
12 } 12 }
13 13
14 SkGMBench::~SkGMBench() { delete fGM; } 14 GMBench::~GMBench() { delete fGM; }
15 15
16 const char* SkGMBench::onGetName() { 16 const char* GMBench::onGetName() {
17 return fName.c_str(); 17 return fName.c_str();
18 } 18 }
19 19
20 bool SkGMBench::isSuitableFor(Backend backend) { 20 bool GMBench::isSuitableFor(Backend backend) {
21 uint32_t flags = fGM->getFlags(); 21 uint32_t flags = fGM->getFlags();
22 switch (backend) { 22 switch (backend) {
23 case kGPU_Backend: 23 case kGPU_Backend:
24 return !(skiagm::GM::kSkipGPU_Flag & flags); 24 return !(skiagm::GM::kSkipGPU_Flag & flags);
25 case kPDF_Backend: 25 case kPDF_Backend:
26 return !(skiagm::GM::kSkipPDF_Flag & flags); 26 return !(skiagm::GM::kSkipPDF_Flag & flags);
27 case kRaster_Backend: 27 case kRaster_Backend:
28 // GM doesn't have an equivalent flag. If the GM has known issues wi th 565 then 28 // GM doesn't have an equivalent flag. If the GM has known issues wi th 565 then
29 // we skip it for ALL raster configs in bench. 29 // we skip it for ALL raster configs in bench.
30 return !(skiagm::GM::kSkip565_Flag & flags); 30 return !(skiagm::GM::kSkip565_Flag & flags);
31 case kNonRendering_Backend: 31 case kNonRendering_Backend:
32 return false; 32 return false;
33 default: 33 default:
34 SkDEBUGFAIL("Unexpected backend type."); 34 SkDEBUGFAIL("Unexpected backend type.");
35 return false; 35 return false;
36 } 36 }
37 } 37 }
38 38
39 void SkGMBench::onDraw(const int loops, SkCanvas* canvas) { 39 void GMBench::onDraw(const int loops, SkCanvas* canvas) {
40 // Do we care about timing the draw of the background (once)? 40 // Do we care about timing the draw of the background (once)?
41 // Does the GM ever rely on drawBackground to lazily compute something? 41 // Does the GM ever rely on drawBackground to lazily compute something?
42 fGM->drawBackground(canvas); 42 fGM->drawBackground(canvas);
43 for (int i = 0; i < loops; ++i) { 43 for (int i = 0; i < loops; ++i) {
44 fGM->drawContent(canvas); 44 fGM->drawContent(canvas);
45 } 45 }
46 } 46 }
47 47
48 SkIPoint SkGMBench::onGetSize() { 48 SkIPoint GMBench::onGetSize() {
49 SkISize size = fGM->getISize(); 49 SkISize size = fGM->getISize();
50 return SkIPoint::Make(size.fWidth, size.fHeight); 50 return SkIPoint::Make(size.fWidth, size.fHeight);
51 } 51 }
OLDNEW
« no previous file with comments | « bench/GMBench.h ('k') | bench/GameBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698