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

Unified Diff: samplecode/SampleSpiral.cpp

Issue 888283002: allow GMs to animate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: switch all existing animations to use animatePulse Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SamplePicture.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleSpiral.cpp
diff --git a/samplecode/SampleSpiral.cpp b/samplecode/SampleSpiral.cpp
deleted file mode 100644
index 5eda3c61ec0e582e9a20d8c847f1f917f77054fa..0000000000000000000000000000000000000000
--- a/samplecode/SampleSpiral.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#include "SampleCode.h"
-#include "SkView.h"
-#include "SkCanvas.h"
-
-class SpiralView : public SampleView {
-public:
- SpiralView() {
- this->setBGColor(0xFFDDDDDD);
- }
-
-protected:
- // overrides from SkEventSink
- virtual bool onQuery(SkEvent* evt) {
- if (SampleCode::TitleQ(*evt)) {
- SampleCode::TitleR(evt, "Spiral");
- return true;
- }
- return this->INHERITED::onQuery(evt);
- }
-
- virtual void onDrawContent(SkCanvas* canvas) {
- SkPaint paint;
- paint.setAntiAlias(true);
- paint.setStyle(SkPaint::kStroke_Style);
- paint.setStrokeWidth(SkScalarHalf(SkIntToScalar(3)));
- paint.setStyle(SkPaint::kFill_Style);
-
- SkRect r;
- SkScalar l,t,x,y;
- l = SampleCode::GetAnimScalar(SkIntToScalar(10),
- SkIntToScalar(400));
- t = SampleCode::GetAnimScalar(SkIntToScalar(5),
- SkIntToScalar(200));
-
- canvas->translate(320,240);
- for (int i = 0; i < 35; i++) {
- paint.setColor(0xFFF00FF0 - i * 0x04000000);
- SkScalar step = SK_ScalarPI / (55 - i);
- SkScalar angle = t * step;
- x = (20 + SkIntToScalar(i) * 5) * SkScalarSinCos(angle, &y);
- y *= (20 + SkIntToScalar(i) * 5);
- r.set(x, y, x + SkIntToScalar(10), y + SkIntToScalar(10));
- canvas->drawRect(r, paint);
- }
-
- this->inval(NULL);
- }
-
-private:
- typedef SampleView INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static SkView* MyFactory() { return new SpiralView; }
-static SkViewRegister reg(MyFactory);
« no previous file with comments | « samplecode/SamplePicture.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698