blob: de9038bed8ceb3e788f026184f2be63558c0dc0b [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001/*
2 * Copyright 2011 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 */
reed@android.com8a1c16f2008-12-17 15:59:43 +00007#include "SampleCode.h"
robertphillips@google.comb7061172013-09-06 14:16:12 +00008#include "SkBlurMask.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +00009#include "SkCanvas.h"
10#include "SkView.h"
11#include "Sk1DPathEffect.h"
12#include "Sk2DPathEffect.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000013#include "SkBlurMaskFilter.h"
reed0daf5dd2016-01-11 12:34:04 -080014#include "SkColorMatrixFilter.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000015#include "SkColorPriv.h"
16#include "SkCornerPathEffect.h"
17#include "SkDashPathEffect.h"
18#include "SkDiscretePathEffect.h"
19#include "SkEmbossMaskFilter.h"
commit-bot@chromium.org8b0e8ac2014-01-30 18:58:24 +000020#include "SkReadBuffer.h"
21#include "SkWriteBuffer.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000022#include "SkGradientShader.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000023#include "SkMath.h"
24#include "SkPath.h"
robertphillips@google.com770963f2014-04-18 18:04:41 +000025#include "SkPictureRecorder.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000026#include "SkRegion.h"
27#include "SkShader.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000028#include "SkCornerPathEffect.h"
29#include "SkPathMeasure.h"
30#include "SkPicture.h"
31#include "SkRandom.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000032#include "SkTypeface.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000033#include "SkUtils.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000034
35#include <math.h>
msarettd15750c2016-03-18 15:48:49 -070036#include "DecodeFile.h"
rmistry@google.comae933ce2012-08-23 18:19:56 +000037
reed@android.com8a1c16f2008-12-17 15:59:43 +000038class Dot2DPathEffect : public Sk2DPathEffect {
39public:
40 Dot2DPathEffect(SkScalar radius, const SkMatrix& matrix)
41 : Sk2DPathEffect(matrix), fRadius(radius) {}
42
djsollen@google.comba28d032012-03-26 17:57:35 +000043 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Dot2DPathEffect)
reed@android.com8a1c16f2008-12-17 15:59:43 +000044
45protected:
mtklein36352bf2015-03-25 18:17:31 -070046 void next(const SkPoint& loc, int u, int v, SkPath* dst) const override {
reed@android.com8a1c16f2008-12-17 15:59:43 +000047 dst->addCircle(loc.fX, loc.fY, fRadius);
48 }
rmistry@google.comae933ce2012-08-23 18:19:56 +000049
mtklein36352bf2015-03-25 18:17:31 -070050 void flatten(SkWriteBuffer& buffer) const override {
djsollen@google.com54924242012-03-29 15:18:04 +000051 this->INHERITED::flatten(buffer);
52 buffer.writeScalar(fRadius);
53 }
54
reed@android.com8a1c16f2008-12-17 15:59:43 +000055private:
56 SkScalar fRadius;
57
reed@android.com8a1c16f2008-12-17 15:59:43 +000058 typedef Sk2DPathEffect INHERITED;
59};
60
mike@reedtribe.org5fd92432011-05-05 01:59:48 +000061class DemoView : public SampleView {
reed@android.com8a1c16f2008-12-17 15:59:43 +000062public:
reed@google.com2f3dc9d2011-05-02 17:33:45 +000063 DemoView() {}
rmistry@google.comae933ce2012-08-23 18:19:56 +000064
reed@android.com8a1c16f2008-12-17 15:59:43 +000065protected:
66 // overrides from SkEventSink
mike@reedtribe.org5fd92432011-05-05 01:59:48 +000067 virtual bool onQuery(SkEvent* evt) {
68 if (SampleCode::TitleQ(*evt)) {
reed@android.com8a1c16f2008-12-17 15:59:43 +000069 SampleCode::TitleR(evt, "Demo");
70 return true;
71 }
72 return this->INHERITED::onQuery(evt);
73 }
rmistry@google.comae933ce2012-08-23 18:19:56 +000074
mike@reedtribe.org5fd92432011-05-05 01:59:48 +000075 virtual bool onClick(Click* click) {
reed@android.com8a1c16f2008-12-17 15:59:43 +000076 return this->INHERITED::onClick(click);
77 }
rmistry@google.comae933ce2012-08-23 18:19:56 +000078
mike@reedtribe.org5fd92432011-05-05 01:59:48 +000079 void makePath(SkPath& path) {
reed@android.com8a1c16f2008-12-17 15:59:43 +000080 path.addCircle(SkIntToScalar(20), SkIntToScalar(20), SkIntToScalar(20),
81 SkPath::kCCW_Direction);
82 for (int index = 0; index < 10; index++) {
commit-bot@chromium.org4b413c82013-11-25 19:44:07 +000083 SkScalar x = (float) cos(index / 10.0f * 2 * 3.1415925358f);
84 SkScalar y = (float) sin(index / 10.0f * 2 * 3.1415925358f);
reed@android.com8a1c16f2008-12-17 15:59:43 +000085 x *= index & 1 ? 7 : 14;
86 y *= index & 1 ? 7 : 14;
87 x += SkIntToScalar(20);
88 y += SkIntToScalar(20);
89 if (index == 0)
90 path.moveTo(x, y);
91 else
92 path.lineTo(x, y);
93 }
94 path.close();
95 }
rmistry@google.comae933ce2012-08-23 18:19:56 +000096
mike@reedtribe.org5fd92432011-05-05 01:59:48 +000097 virtual void onDrawContent(SkCanvas* canvas) {
reed@android.com8a1c16f2008-12-17 15:59:43 +000098 canvas->save();
robertphillips@google.com84b18c72014-04-13 19:09:42 +000099 this->drawPicture(canvas, 0);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000100 canvas->restore();
101
102 {
robertphillips@google.com84b18c72014-04-13 19:09:42 +0000103 SkPictureRecorder recorder;
104 {
halcanary96fcdcc2015-08-27 07:41:13 -0700105 SkCanvas* record = recorder.beginRecording(320, 480, nullptr, 0);
robertphillips@google.com84b18c72014-04-13 19:09:42 +0000106 this->drawPicture(record, 120);
107 }
reedca2622b2016-03-18 07:25:55 -0700108 sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture());
robertphillips@google.com84b18c72014-04-13 19:09:42 +0000109
reed@android.com8a1c16f2008-12-17 15:59:43 +0000110 canvas->translate(0, SkIntToScalar(120));
111
112 SkRect clip;
113 clip.set(0, 0, SkIntToScalar(160), SkIntToScalar(160));
114 do {
115 canvas->save();
116 canvas->clipRect(clip);
robertphillipsc5ba71d2014-09-04 08:42:50 -0700117 picture->playback(canvas);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000118 canvas->restore();
119 if (clip.fRight < SkIntToScalar(320))
120 clip.offset(SkIntToScalar(160), 0);
121 else if (clip.fBottom < SkIntToScalar(480))
122 clip.offset(-SkIntToScalar(320), SkIntToScalar(160));
123 else
124 break;
125 } while (true);
126 }
reed@android.com8a1c16f2008-12-17 15:59:43 +0000127 }
rmistry@google.comae933ce2012-08-23 18:19:56 +0000128
mike@reedtribe.org5fd92432011-05-05 01:59:48 +0000129 void drawPicture(SkCanvas* canvas, int spriteOffset) {
rmistry@google.comae933ce2012-08-23 18:19:56 +0000130 SkMatrix matrix; matrix.reset();
131 SkPaint paint;
132 SkPath path;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000133 SkPoint start = {0, 0};
134 SkPoint stop = { SkIntToScalar(40), SkIntToScalar(40) };
rmistry@google.comae933ce2012-08-23 18:19:56 +0000135 SkRect rect = {0, 0, SkIntToScalar(40), SkIntToScalar(40) };
136 SkRect rect2 = {0, 0, SkIntToScalar(65), SkIntToScalar(20) };
137 SkScalar left = 0, top = 0, x = 0, y = 0;
reed@google.com7fa2a652014-01-27 13:42:58 +0000138 int index;
rmistry@google.comae933ce2012-08-23 18:19:56 +0000139
140 char ascii[] = "ascii...";
reed@google.com7fa2a652014-01-27 13:42:58 +0000141 int asciiLength = sizeof(ascii) - 1;
rmistry@google.comae933ce2012-08-23 18:19:56 +0000142 char utf8[] = "utf8" "\xe2\x80\xa6";
143 short utf16[] = {'u', 't', 'f', '1', '6', 0x2026 };
144 short utf16simple[] = {'u', 't', 'f', '1', '6', '!' };
145
reed@android.com8a1c16f2008-12-17 15:59:43 +0000146 makePath(path);
Ben Wagner1a1d2412017-10-17 17:33:44 -0400147 SkTDArray<SkPoint> pos;
rmistry@google.comae933ce2012-08-23 18:19:56 +0000148 pos.setCount(asciiLength);
149 for (index = 0; index < asciiLength; index++)
150 pos[index].set(SkIntToScalar((unsigned int)index * 10),
tomhudson@google.comffe39bd2012-05-17 15:38:00 +0000151 SkIntToScalar((unsigned int)index * 2));
Ben Wagner1a1d2412017-10-17 17:33:44 -0400152 SkTDArray<SkPoint> pos2;
rmistry@google.comae933ce2012-08-23 18:19:56 +0000153 pos2.setCount(asciiLength);
154 for (index = 0; index < asciiLength; index++)
155 pos2[index].set(SkIntToScalar((unsigned int)index * 10),
tomhudson@google.comffe39bd2012-05-17 15:38:00 +0000156 SkIntToScalar(20));
rmistry@google.comae933ce2012-08-23 18:19:56 +0000157
reed@android.com8a1c16f2008-12-17 15:59:43 +0000158 // shaders
senorblanco@chromium.org64cc5792011-05-19 19:58:58 +0000159 SkPoint linearPoints[] = { { 0, 0, }, { SkIntToScalar(40), SkIntToScalar(40) } };
reed@android.com8a1c16f2008-12-17 15:59:43 +0000160 SkColor linearColors[] = { SK_ColorRED, SK_ColorBLUE };
halcanary96fcdcc2015-08-27 07:41:13 -0700161 SkScalar* linearPos = nullptr;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000162 int linearCount = 2;
163 SkShader::TileMode linearMode = SkShader::kMirror_TileMode;
reed8a21c9f2016-03-08 18:50:00 -0800164 auto linear = SkGradientShader::MakeLinear(linearPoints,
commit-bot@chromium.org83f23d82014-05-22 12:27:41 +0000165 linearColors, linearPos, linearCount, linearMode);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000166
167 SkPoint radialCenter = { SkIntToScalar(25), SkIntToScalar(25) };
168 SkScalar radialRadius = SkIntToScalar(25);
169 SkColor radialColors[] = { SK_ColorGREEN, SK_ColorGRAY, SK_ColorRED };
170 SkScalar radialPos[] = { 0, SkIntToScalar(3) / 5, SkIntToScalar(1)};
171 int radialCount = 3;
172 SkShader::TileMode radialMode = SkShader::kRepeat_TileMode;
reed8a21c9f2016-03-08 18:50:00 -0800173 auto radial = SkGradientShader::MakeRadial(radialCenter,
reed@android.com8a1c16f2008-12-17 15:59:43 +0000174 radialRadius, radialColors, radialPos, radialCount,
commit-bot@chromium.org83f23d82014-05-22 12:27:41 +0000175 radialMode);
rmistry@google.comae933ce2012-08-23 18:19:56 +0000176
reed@android.com8a1c16f2008-12-17 15:59:43 +0000177 SkEmbossMaskFilter::Light light;
178 light.fDirection[0] = SK_Scalar1/2;
179 light.fDirection[1] = SK_Scalar1/2;
180 light.fDirection[2] = SK_Scalar1/3;
rmistry@google.comae933ce2012-08-23 18:19:56 +0000181 light.fAmbient = 0x48;
182 light.fSpecular = 0x80;
rmistry@google.comae933ce2012-08-23 18:19:56 +0000183
reedd053ce92016-03-22 10:17:23 -0700184 auto lightingFilter = SkColorMatrixFilter::MakeLightingFilter(
reed@android.com8a1c16f2008-12-17 15:59:43 +0000185 0xff89bc45, 0xff112233);
rmistry@google.comae933ce2012-08-23 18:19:56 +0000186
reed@android.com8a1c16f2008-12-17 15:59:43 +0000187 canvas->save();
rmistry@google.comae933ce2012-08-23 18:19:56 +0000188 canvas->translate(SkIntToScalar(0), SkIntToScalar(5));
reed@google.com9cfc83c2013-07-22 17:18:18 +0000189 paint.setAntiAlias(true);
reed93a12152015-03-16 10:08:34 -0700190 paint.setFilterQuality(kLow_SkFilterQuality);
rmistry@google.comae933ce2012-08-23 18:19:56 +0000191 // !!! draw through a clip
192 paint.setColor(SK_ColorLTGRAY);
193 paint.setStyle(SkPaint::kFill_Style);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000194 SkRect clip = {0, 0, SkIntToScalar(320), SkIntToScalar(120)};
195 canvas->clipRect(clip);
reed8a21c9f2016-03-08 18:50:00 -0800196 paint.setShader(SkShader::MakeBitmapShader(fTx,
197 SkShader::kMirror_TileMode, SkShader::kRepeat_TileMode));
rmistry@google.comae933ce2012-08-23 18:19:56 +0000198 canvas->drawPaint(paint);
199 canvas->save();
200
reed@android.com8a1c16f2008-12-17 15:59:43 +0000201 // line (exercises xfermode, colorShader, colorFilter, filterShader)
rmistry@google.comae933ce2012-08-23 18:19:56 +0000202 paint.setColor(SK_ColorGREEN);
203 paint.setStrokeWidth(SkIntToScalar(10));
204 paint.setStyle(SkPaint::kStroke_Style);
reed374772b2016-10-05 17:33:02 -0700205 paint.setBlendMode(SkBlendMode::kXor);
reedd053ce92016-03-22 10:17:23 -0700206 paint.setColorFilter(lightingFilter);
Hal Canary23e474c2017-05-15 13:35:35 -0400207 canvas->drawLine(start, stop, paint); // should not be green
reed374772b2016-10-05 17:33:02 -0700208 paint.setBlendMode(SkBlendMode::kSrcOver);
halcanary96fcdcc2015-08-27 07:41:13 -0700209 paint.setColorFilter(nullptr);
rmistry@google.comae933ce2012-08-23 18:19:56 +0000210
reed@android.com8a1c16f2008-12-17 15:59:43 +0000211 // rectangle
rmistry@google.comae933ce2012-08-23 18:19:56 +0000212 paint.setStyle(SkPaint::kFill_Style);
213 canvas->translate(SkIntToScalar(50), 0);
214 paint.setColor(SK_ColorYELLOW);
reed8a21c9f2016-03-08 18:50:00 -0800215 paint.setShader(linear);
reeda4393342016-03-18 11:22:57 -0700216 paint.setPathEffect(pathEffectTest());
rmistry@google.comae933ce2012-08-23 18:19:56 +0000217 canvas->drawRect(rect, paint);
halcanary96fcdcc2015-08-27 07:41:13 -0700218 paint.setPathEffect(nullptr);
rmistry@google.comae933ce2012-08-23 18:19:56 +0000219
reed@android.com8a1c16f2008-12-17 15:59:43 +0000220 // circle w/ emboss & transparent (exercises 3dshader)
rmistry@google.comae933ce2012-08-23 18:19:56 +0000221 canvas->translate(SkIntToScalar(50), 0);
reedefdfd512016-04-04 10:02:58 -0700222 paint.setMaskFilter(SkEmbossMaskFilter::Make(
223 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(12)/5), light));
reed@android.com8a1c16f2008-12-17 15:59:43 +0000224 canvas->drawOval(rect, paint);
rmistry@google.comae933ce2012-08-23 18:19:56 +0000225 canvas->translate(SkIntToScalar(10), SkIntToScalar(10));
reed56263c72015-06-05 11:31:26 -0700226// paint.setShader(transparentShader)->unref();
reed@android.com8a1c16f2008-12-17 15:59:43 +0000227 canvas->drawOval(rect, paint);
rmistry@google.comae933ce2012-08-23 18:19:56 +0000228 canvas->translate(0, SkIntToScalar(-10));
229
reed@android.com8a1c16f2008-12-17 15:59:43 +0000230 // path
rmistry@google.comae933ce2012-08-23 18:19:56 +0000231 canvas->translate(SkIntToScalar(50), 0);
232 paint.setColor(SK_ColorRED);
233 paint.setStyle(SkPaint::kStroke_Style);
234 paint.setStrokeWidth(SkIntToScalar(5));
reed8a21c9f2016-03-08 18:50:00 -0800235 paint.setShader(radial);
halcanary96fcdcc2015-08-27 07:41:13 -0700236 paint.setMaskFilter(nullptr);
rmistry@google.comae933ce2012-08-23 18:19:56 +0000237 canvas->drawPath(path, paint);
238
halcanary96fcdcc2015-08-27 07:41:13 -0700239 paint.setShader(nullptr);
reed6f45c172015-11-04 08:34:07 -0800240 // bitmap
rmistry@google.comae933ce2012-08-23 18:19:56 +0000241 canvas->translate(SkIntToScalar(50), 0);
242 paint.setStyle(SkPaint::kFill_Style);
243 canvas->drawBitmap(fBug, left, top, &paint);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000244
rmistry@google.comae933ce2012-08-23 18:19:56 +0000245 canvas->translate(-SkIntToScalar(30), SkIntToScalar(30));
reed8a21c9f2016-03-08 18:50:00 -0800246 paint.setShader(shaderTest()); // test compose shader
rmistry@google.comae933ce2012-08-23 18:19:56 +0000247 canvas->drawRect(rect2, paint);
halcanary96fcdcc2015-08-27 07:41:13 -0700248 paint.setShader(nullptr);
rmistry@google.comae933ce2012-08-23 18:19:56 +0000249
reed@android.com8a1c16f2008-12-17 15:59:43 +0000250 canvas->restore();
251 // text
reed@android.com8a1c16f2008-12-17 15:59:43 +0000252 canvas->translate(0, SkIntToScalar(60));
rmistry@google.comae933ce2012-08-23 18:19:56 +0000253 canvas->save();
254 paint.setColor(SK_ColorGRAY);
255 canvas->drawPosText(ascii, asciiLength, pos.begin(), paint);
256 canvas->drawPosText(ascii, asciiLength, pos2.begin(), paint);
257
258 canvas->translate(SkIntToScalar(50), 0);
259 paint.setColor(SK_ColorCYAN);
260 canvas->drawText(utf8, sizeof(utf8) - 1, x, y, paint);
261
262 canvas->translate(SkIntToScalar(30), 0);
263 paint.setColor(SK_ColorMAGENTA);
264 paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);
265 matrix.setTranslate(SkIntToScalar(10), SkIntToScalar(10));
266 canvas->drawTextOnPath((void*) utf16, sizeof(utf16), path, &matrix, paint);
267 canvas->translate(0, SkIntToScalar(20));
268 canvas->drawTextOnPath((void*) utf16simple, sizeof(utf16simple), path, &matrix, paint);
269 canvas->restore();
270
271 canvas->translate(0, SkIntToScalar(60));
272 paint.setTextEncoding(SkPaint::kUTF8_TextEncoding);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000273 canvas->restore();
274 }
rmistry@google.comae933ce2012-08-23 18:19:56 +0000275
reed@google.com4d5c26d2013-01-08 16:17:50 +0000276 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) {
reed@android.com8a1c16f2008-12-17 15:59:43 +0000277 fClickPt.set(x, y);
reed@google.com4d5c26d2013-01-08 16:17:50 +0000278 return this->INHERITED::onFindClickHandler(x, y, modi);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000279 }
rmistry@google.comae933ce2012-08-23 18:19:56 +0000280
reeda4393342016-03-18 11:22:57 -0700281 sk_sp<SkPathEffect> pathEffectTest() {
reed@android.com8a1c16f2008-12-17 15:59:43 +0000282 static const int gXY[] = { 1, 0, 0, -1, 2, -1, 3, 0, 2, 1, 0, 1 };
283 SkScalar gPhase = 0;
284 SkPath path;
285 path.moveTo(SkIntToScalar(gXY[0]), SkIntToScalar(gXY[1]));
286 for (unsigned i = 2; i < SK_ARRAY_COUNT(gXY); i += 2)
287 path.lineTo(SkIntToScalar(gXY[i]), SkIntToScalar(gXY[i+1]));
288 path.close();
289 path.offset(SkIntToScalar(-6), 0);
reeda4393342016-03-18 11:22:57 -0700290 auto outer = SkPath1DPathEffect::Make(path, SkIntToScalar(12),
reed@android.com8a1c16f2008-12-17 15:59:43 +0000291 gPhase, SkPath1DPathEffect::kRotate_Style);
reeda4393342016-03-18 11:22:57 -0700292 auto inner = SkDiscretePathEffect::Make(SkIntToScalar(2),
reed@android.com8a1c16f2008-12-17 15:59:43 +0000293 SkIntToScalar(1)/10); // SkCornerPathEffect(SkIntToScalar(2));
Mike Reeda07741a2017-02-25 22:34:32 -0500294 return SkPathEffect::MakeCompose(outer, inner);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000295 }
reed@google.com963a8fa2012-05-10 13:04:59 +0000296
reed8a21c9f2016-03-08 18:50:00 -0800297 sk_sp<SkShader> shaderTest() {
senorblanco@chromium.org64cc5792011-05-19 19:58:58 +0000298 SkPoint pts[] = { { 0, 0, }, { SkIntToScalar(100), 0 } };
reed@android.com8a1c16f2008-12-17 15:59:43 +0000299 SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };
reed8a21c9f2016-03-08 18:50:00 -0800300 auto shaderA = SkGradientShader::MakeLinear(pts, colors, nullptr,
reed@android.com8a1c16f2008-12-17 15:59:43 +0000301 2, SkShader::kClamp_TileMode);
302 pts[1].set(0, SkIntToScalar(100));
303 SkColor colors2[] = {SK_ColorBLACK, SkColorSetARGB(0x80, 0, 0, 0)};
reed8a21c9f2016-03-08 18:50:00 -0800304 auto shaderB = SkGradientShader::MakeLinear(pts, colors2, nullptr,
reed@android.com8a1c16f2008-12-17 15:59:43 +0000305 2, SkShader::kClamp_TileMode);
reedcfb6bdf2016-03-29 11:32:50 -0700306 return SkShader::MakeComposeShader(std::move(shaderA), std::move(shaderB),
Mike Reed7d954ad2016-10-28 15:42:34 -0400307 SkBlendMode::kDstIn);
reed@android.com8a1c16f2008-12-17 15:59:43 +0000308 }
309
310 virtual void startTest() {
msarettd15750c2016-03-18 15:48:49 -0700311 decode_file("/Users/caryclark/Desktop/bugcirc.gif", &fBug);
312 decode_file("/Users/caryclark/Desktop/tbcirc.gif", &fTb);
313 decode_file("/Users/caryclark/Desktop/05psp04.gif", &fTx);
rmistry@google.comae933ce2012-08-23 18:19:56 +0000314 }
reed@android.com8a1c16f2008-12-17 15:59:43 +0000315
reed@android.com8a1c16f2008-12-17 15:59:43 +0000316private:
317 SkPoint fClickPt;
318 SkBitmap fBug, fTb, fTx;
mike@reedtribe.org5fd92432011-05-05 01:59:48 +0000319 typedef SampleView INHERITED;
reed@android.com8a1c16f2008-12-17 15:59:43 +0000320};
321
322//////////////////////////////////////////////////////////////////////////////
323
324static SkView* MyFactory() { return new DemoView; }
325static SkViewRegister reg(MyFactory);