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

Side by Side Diff: gm/selftest.cpp

Issue 2154603002: Probably no need for GM self-tests now that GM doesn't exist. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 /**
9 * Pathologically simple drawing tests, designed to generate consistent
10 * output images across platforms for gm/tests/run.sh
11 */
12
13 #include "gm.h"
14 #include "SkCanvas.h"
15 #include "SkPaint.h"
16
17 class SelfTestGM : public skiagm::GM {
18 public:
19 SelfTestGM(const char name[], SkColor color) :
20 fName(name), fColor(color) {}
21 const static int kWidth = 300;
22 const static int kHeight = 200;
23
24 protected:
25 SkString onShortName() {
26 return fName;
27 }
28
29 SkISize onISize() { return SkISize::Make(kWidth, kHeight); }
30
31 virtual void onDraw(SkCanvas* canvas) {
32 SkPaint paint;
33 paint.setStyle(SkPaint::kFill_Style);
34 paint.setColor(fColor);
35 canvas->drawRectCoords(0, 0, SkIntToScalar(kWidth), SkIntToScalar(kHeigh t), paint);
36 }
37
38 private:
39 const SkString fName;
40 const SkColor fColor;
41 };
42
43 //////////////////////////////////////////////////////////////////////////////
44
45 // We use translucent colors to make sure we are properly handling cases like
46 // those which caused https://code.google.com/p/skia/issues/detail?id=1079
47 // ('gm generating spurious pixel_error messages as of r7258')
48 static SkColor kTranslucentGreen = 0x7700EE00;
49 static SkColor kTranslucentBlue = 0x770000DD;
50
51 DEF_GM( return new SelfTestGM("selftest1", kTranslucentGreen); )
52 DEF_GM( return new SelfTestGM("selftest2", kTranslucentBlue); )
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698