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

Unified Diff: samplecode/SampleMovie.cpp

Issue 901933004: migrate more samples over to SkAnimTImer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix warning Created 5 years, 10 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/SampleMipMap.cpp ('k') | samplecode/SampleOvalTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleMovie.cpp
diff --git a/samplecode/SampleMovie.cpp b/samplecode/SampleMovie.cpp
deleted file mode 100644
index 5928f92ae7dd947f08c7e6b1a0d65818886bb6f3..0000000000000000000000000000000000000000
--- a/samplecode/SampleMovie.cpp
+++ /dev/null
@@ -1,64 +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"
-#include "SkMovie.h"
-#include "SkTime.h"
-#include <new>
-
-class AnimGifView : public SkView {
- SkMovie* fMovie;
-public:
- AnimGifView() {
- fMovie = SkMovie::DecodeFile("/skimages/dollarblk.gif");
- }
-
- virtual ~AnimGifView() {
- SkSafeUnref(fMovie);
- }
-
-protected:
- // overrides from SkEventSink
- virtual bool onQuery(SkEvent* evt) {
- if (SampleCode::TitleQ(*evt)) {
- SampleCode::TitleR(evt, "Animated Gif");
- return true;
- }
- return this->INHERITED::onQuery(evt);
- }
-
- void drawBG(SkCanvas* canvas) {
- canvas->drawColor(0xFFDDDDDD);
- }
-
- virtual void onDraw(SkCanvas* canvas) {
- this->drawBG(canvas);
-
- if (fMovie) {
- if (fMovie->duration()) {
- fMovie->setTime(SkTime::GetMSecs() % fMovie->duration());
- } else {
- fMovie->setTime(0);
- }
- canvas->drawBitmap(fMovie->bitmap(), SkIntToScalar(20),
- SkIntToScalar(20));
- this->inval(NULL);
- }
- }
-
-private:
- SkPath fPath;
-
- typedef SkView INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static SkView* MyFactory() { return new AnimGifView; }
-static SkViewRegister reg(MyFactory);
« no previous file with comments | « samplecode/SampleMipMap.cpp ('k') | samplecode/SampleOvalTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698