OLD | NEW |
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 #include "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 dst->setConfig(config, w, h); | 100 dst->setConfig(config, w, h); |
101 dst->allocPixels(); | 101 dst->allocPixels(); |
102 dst->eraseColor(SK_ColorWHITE); | 102 dst->eraseColor(SK_ColorWHITE); |
103 | 103 |
104 SkCanvas canvas(*dst); | 104 SkCanvas canvas(*dst); |
105 canvas.drawPath(path, paint); | 105 canvas.drawPath(path, paint); |
106 } | 106 } |
107 | 107 |
108 class StrokeTextView : public SampleView { | 108 class StrokeTextView : public SampleView { |
109 bool fAA; | |
110 public: | 109 public: |
111 StrokeTextView() : fAA(false) { | 110 StrokeTextView() { |
112 this->setBGColor(0xFFCC8844); | 111 this->setBGColor(0xFFCC8844); |
113 } | 112 } |
114 | 113 |
115 protected: | 114 protected: |
116 // overrides from SkEventSink | 115 // overrides from SkEventSink |
117 virtual bool onQuery(SkEvent* evt) { | 116 virtual bool onQuery(SkEvent* evt) { |
118 if (SampleCode::TitleQ(*evt)) { | 117 if (SampleCode::TitleQ(*evt)) { |
119 SampleCode::TitleR(evt, "StrokeText"); | 118 SampleCode::TitleR(evt, "StrokeText"); |
120 return true; | 119 return true; |
121 } | 120 } |
(...skipping 17 matching lines...) Expand all Loading... |
139 | 138 |
140 private: | 139 private: |
141 | 140 |
142 typedef SampleView INHERITED; | 141 typedef SampleView INHERITED; |
143 }; | 142 }; |
144 | 143 |
145 ////////////////////////////////////////////////////////////////////////////// | 144 ////////////////////////////////////////////////////////////////////////////// |
146 | 145 |
147 static SkView* MyFactory() { return new StrokeTextView; } | 146 static SkView* MyFactory() { return new StrokeTextView; } |
148 static SkViewRegister reg(MyFactory); | 147 static SkViewRegister reg(MyFactory); |
OLD | NEW |