diff options
author | tfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-09-18 01:52:20 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-09-18 01:52:20 +0000 |
commit | b1b7f707907b8c63b955cd2aef1cc454623e3656 (patch) | |
tree | 639827ef5265f501acc41491a43849929eef6219 /samplecode | |
parent | 13fd5a15a170c0d024f4907991d8a57d8adf755e (diff) |
Add a header for OverView.cpp as well.
This fixes another FIXMEs.
Signed-off-by: Thiago Farina <tfarina@chromium.org>
Review URL: https://codereview.appspot.com/6492125
git-svn-id: http://skia.googlecode.com/svn/trunk@5576 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode')
-rw-r--r-- | samplecode/OverView.cpp | 6 | ||||
-rw-r--r-- | samplecode/OverView.h | 18 | ||||
-rw-r--r-- | samplecode/SampleApp.cpp | 6 | ||||
-rw-r--r-- | samplecode/TransitionView.cpp | 8 | ||||
-rw-r--r-- | samplecode/TransitionView.h | 2 |
5 files changed, 27 insertions, 13 deletions
diff --git a/samplecode/OverView.cpp b/samplecode/OverView.cpp index 9858608241..f170bdbcad 100644 --- a/samplecode/OverView.cpp +++ b/samplecode/OverView.cpp @@ -5,6 +5,8 @@ * found in the LICENSE file. */ +#include "OverView.h" + #include "SampleCode.h" #include "SkCanvas.h" @@ -69,14 +71,10 @@ private: typedef SkView INHERITED; }; -// FIXME: this should be in a header -SkView* create_overview(int count, const SkViewFactory* factories[]); SkView* create_overview(int count, const SkViewFactory* factories[]) { return SkNEW_ARGS(OverView, (count, factories)); } -// FIXME: this should be in a header -bool is_overview(SkView* view); bool is_overview(SkView* view) { SkEvent isOverview(gIsOverview); return view->doQuery(&isOverview); diff --git a/samplecode/OverView.h b/samplecode/OverView.h new file mode 100644 index 0000000000..3412b19b0f --- /dev/null +++ b/samplecode/OverView.h @@ -0,0 +1,18 @@ +/* + * Copyright 2012 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SAMPLECODE_OVERVIEW_H_ +#define SAMPLECODE_OVERVIEW_H_ + +class SkView; +class SkViewFactory; + +SkView* create_overview(int, const SkViewFactory*[]); + +bool is_overview(SkView* view); + +#endif // SAMPLECODE_OVERVIEW_H_ diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index cfdd4ae3a5..a98f2fcb77 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -37,6 +37,7 @@ class GrContext; #include "SkGPipe.h" #include "SamplePipeControllers.h" +#include "OverView.h" #include "TransitionView.h" SK_DEFINE_INST_COUNT(SampleWindow::DeviceManager) @@ -79,11 +80,6 @@ SkTDArray<char> gTempDataStore; //#define DEFAULT_TO_GPU 1 #endif -extern SkView* create_overview(int, const SkViewFactory*[]); -extern bool is_overview(SkView* view); -extern bool is_transition(SkView* view); - - #define ANIMATING_EVENTTYPE "nextSample" #define ANIMATING_DELAY 750 diff --git a/samplecode/TransitionView.cpp b/samplecode/TransitionView.cpp index b2b1b9d24f..e755288062 100644 --- a/samplecode/TransitionView.cpp +++ b/samplecode/TransitionView.cpp @@ -6,27 +6,27 @@ */ #include "TransitionView.h" +#include "OverView.h" #include "SampleCode.h" #include "SkView.h" #include "SkCanvas.h" #include "SkTime.h" #include "SkInterpolator.h" -extern bool is_overview(SkView* view); - static const char gIsTransitionQuery[] = "is-transition"; static const char gReplaceTransitionEvt[] = "replace-transition-view"; -static bool is_transition(SkView* view) { +bool is_transition(SkView* view) { SkEvent isTransition(gIsTransitionQuery); return view->doQuery(&isTransition); } class TransitionView : public SampleView { enum { -// kDurationMS = 500 + // kDurationMS = 500 kDurationMS = 1 }; + public: TransitionView(SkView* prev, SkView* next, int direction) : fInterp(4, 2){ fAnimationDirection = (Direction)(1 << (direction % 8)); diff --git a/samplecode/TransitionView.h b/samplecode/TransitionView.h index ac95221f89..92e136aaf6 100644 --- a/samplecode/TransitionView.h +++ b/samplecode/TransitionView.h @@ -12,4 +12,6 @@ class SkView; SkView* create_transition(SkView* prev, SkView* next, int direction); +bool is_transition(SkView* view); + #endif // SAMPLECODE_TRANSITIONVIEW_H_ |