aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gyp/SampleApp.gyp2
-rw-r--r--gyp/iOSSampleApp.gyp1
-rw-r--r--samplecode/OverView.cpp6
-rw-r--r--samplecode/OverView.h18
-rw-r--r--samplecode/SampleApp.cpp6
-rw-r--r--samplecode/TransitionView.cpp8
-rw-r--r--samplecode/TransitionView.h2
7 files changed, 29 insertions, 14 deletions
diff --git a/gyp/SampleApp.gyp b/gyp/SampleApp.gyp
index a2ee5c90b2..ac5c87fd44 100644
--- a/gyp/SampleApp.gyp
+++ b/gyp/SampleApp.gyp
@@ -1,4 +1,3 @@
-
{
'targets': [
{
@@ -21,6 +20,7 @@
'../samplecode/GMSampleView.h',
'../samplecode/ClockFaceView.cpp',
'../samplecode/OverView.cpp',
+ '../samplecode/OverView.h',
'../samplecode/Sample2PtRadial.cpp',
'../samplecode/SampleAAClip.cpp',
'../samplecode/SampleAARects.cpp',
diff --git a/gyp/iOSSampleApp.gyp b/gyp/iOSSampleApp.gyp
index 5cd2c9c70b..dca28c4aa6 100644
--- a/gyp/iOSSampleApp.gyp
+++ b/gyp/iOSSampleApp.gyp
@@ -30,6 +30,7 @@
'../samplecode/ClockFaceView.cpp',
'../samplecode/OverView.cpp',
+ '../samplecode/OverView.h',
'../samplecode/Sample2PtRadial.cpp',
'../samplecode/SampleAll.cpp',
'../samplecode/SampleAnimator.cpp',
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_