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

Side by Side Diff: gm/gm.cpp

Issue 178473006: DM: also run benches once. (Closed) Base URL: https://skia.googlesource.com/skia.git@dm
Patch Set: add note Created 6 years, 9 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 | « gm/gm.h ('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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "gm.h" 8 #include "gm.h"
9 using namespace skiagm; 9 using namespace skiagm;
10 10
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 void GM::drawBackground(SkCanvas* canvas) { 35 void GM::drawBackground(SkCanvas* canvas) {
36 if (!fHaveCalledOnceBeforeDraw) { 36 if (!fHaveCalledOnceBeforeDraw) {
37 fHaveCalledOnceBeforeDraw = true; 37 fHaveCalledOnceBeforeDraw = true;
38 this->onOnceBeforeDraw(); 38 this->onOnceBeforeDraw();
39 } 39 }
40 this->onDrawBackground(canvas); 40 this->onDrawBackground(canvas);
41 } 41 }
42 42
43 const char* GM::shortName() { 43 const char* GM::getName() {
44 if (fShortName.size() == 0) { 44 if (fShortName.size() == 0) {
45 fShortName = this->onShortName(); 45 fShortName = this->onShortName();
46 } 46 }
47 return fShortName.c_str(); 47 return fShortName.c_str();
48 } 48 }
49 49
50 void GM::setBGColor(SkColor color) { 50 void GM::setBGColor(SkColor color) {
51 fBGColor = color; 51 fBGColor = color;
52 } 52 }
53 53
54 void GM::onDrawBackground(SkCanvas* canvas) { 54 void GM::onDrawBackground(SkCanvas* canvas) {
55 canvas->drawColor(fBGColor, SkXfermode::kSrc_Mode); 55 canvas->drawColor(fBGColor, SkXfermode::kSrc_Mode);
56 } 56 }
57 57
58 void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) { 58 void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) {
59 SkISize size = this->getISize(); 59 SkISize size = this->getISize();
60 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()), 60 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()),
61 SkIntToScalar(size.height())); 61 SkIntToScalar(size.height()));
62 SkPaint paint; 62 SkPaint paint;
63 paint.setColor(color); 63 paint.setColor(color);
64 canvas->drawRect(r, paint); 64 canvas->drawRect(r, paint);
65 } 65 }
66 66
67 // need to explicitly declare this, or we get some weird infinite loop llist 67 // need to explicitly declare this, or we get some weird infinite loop llist
68 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead; 68 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead;
OLDNEW
« no previous file with comments | « gm/gm.h ('k') | gm/gmmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698