OLD | NEW |
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 #include "SkShader.h" | 9 #include "SkShader.h" |
10 using namespace skiagm; | 10 using namespace skiagm; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 fBGColor = color; | 51 fBGColor = color; |
52 } | 52 } |
53 | 53 |
54 bool GM::animate(const SkAnimTimer& timer) { | 54 bool GM::animate(const SkAnimTimer& timer) { |
55 return this->onAnimate(timer); | 55 return this->onAnimate(timer); |
56 } | 56 } |
57 | 57 |
58 ////////////////////////////////////////////////////////////////////////////////
///////////// | 58 ////////////////////////////////////////////////////////////////////////////////
///////////// |
59 | 59 |
60 void GM::onDrawBackground(SkCanvas* canvas) { | 60 void GM::onDrawBackground(SkCanvas* canvas) { |
61 canvas->drawColor(fBGColor, SkXfermode::kSrc_Mode); | 61 canvas->drawColor(fBGColor, SkBlendMode::kSrc); |
62 } | 62 } |
63 | 63 |
64 void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) { | 64 void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) { |
65 SkISize size = this->getISize(); | 65 SkISize size = this->getISize(); |
66 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()), | 66 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()), |
67 SkIntToScalar(size.height())); | 67 SkIntToScalar(size.height())); |
68 SkPaint paint; | 68 SkPaint paint; |
69 paint.setColor(color); | 69 paint.setColor(color); |
70 canvas->drawRect(r, paint); | 70 canvas->drawRect(r, paint); |
71 } | 71 } |
(...skipping 28 matching lines...) Expand all Loading... |
100 fDrawProc(canvas); | 100 fDrawProc(canvas); |
101 } | 101 } |
102 | 102 |
103 SkISize skiagm::SimpleGM::onISize() { | 103 SkISize skiagm::SimpleGM::onISize() { |
104 return fSize; | 104 return fSize; |
105 } | 105 } |
106 | 106 |
107 SkString skiagm::SimpleGM::onShortName() { | 107 SkString skiagm::SimpleGM::onShortName() { |
108 return fName; | 108 return fName; |
109 } | 109 } |
OLD | NEW |