diff options
| author | rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-23 18:19:56 +0000 |
|---|---|---|
| committer | rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-23 18:19:56 +0000 |
| commit | ae933ce0ea5fd9d21cb6ef2cee7e729d32690aac (patch) | |
| tree | 62d80e33b16679d01454cf814977a7030d3a5462 /samplecode/TransitionView.cpp | |
| parent | d6176b0dcacb124539e0cfd051e6d93a9782f020 (diff) | |
Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part III of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6475053
git-svn-id: http://skia.googlecode.com/svn/trunk@5264 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/TransitionView.cpp')
| -rw-r--r-- | samplecode/TransitionView.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/samplecode/TransitionView.cpp b/samplecode/TransitionView.cpp index 7a50f11f6e..95938ef8d0 100644 --- a/samplecode/TransitionView.cpp +++ b/samplecode/TransitionView.cpp @@ -24,15 +24,15 @@ class TransitionView : public SampleView { public: TransitionView(SkView* prev, SkView* next, int direction) : fInterp(4, 2){ fAnimationDirection = (Direction)(1 << (direction % 8)); - + fPrev = prev; fPrev->setClipToBounds(false); fPrev->setVisibleP(true); (void)SampleView::SetUsePipe(fPrev, SkOSMenu::kOffState); - //Not calling unref because fPrev is assumed to have been created, so + //Not calling unref because fPrev is assumed to have been created, so //this will result in a transfer of ownership this->attachChildToBack(fPrev); - + fNext = next; fNext->setClipToBounds(true); fNext->setVisibleP(true); @@ -40,20 +40,20 @@ public: //Calling unref because next is a newly created view and TransitionView //is now the sole owner of fNext this->attachChildToFront(fNext)->unref(); - + fDone = false; //SkDebugf("--created transition\n"); } - + ~TransitionView(){ //SkDebugf("--deleted transition\n"); } - + virtual void requestMenu(SkOSMenu* menu) { if (SampleView::IsSampleView(fNext)) ((SampleView*)fNext)->requestMenu(menu); } - + protected: virtual bool onQuery(SkEvent* evt) { if (SampleCode::TitleQ(*evt)) { @@ -82,7 +82,7 @@ protected: if (evt.isType("transition-done")) { fNext->setLoc(0, 0); fNext->setClipToBounds(false); - SkEvent* evt = new SkEvent(gReplaceTransitionEvt, + SkEvent* evt = new SkEvent(gReplaceTransitionEvt, this->getParent()->getSinkID()); evt->setFast32(fNext->getSinkID()); //increate ref count of fNext so it survives detachAllChildren @@ -101,7 +101,7 @@ protected: if (is_overview(fNext) || is_overview(fPrev)) { fPipeState = SkOSMenu::kOffState; } - + SkScalar values[4]; SkInterpolator::Result result = fInterp.timeToValues(SkTime::GetMSecs(), values); //SkDebugf("transition %x %d pipe:%d\n", this, result, fUsePipe); @@ -118,13 +118,13 @@ protected: fDone = true; } } - + virtual void onSizeChange() { this->INHERITED::onSizeChange(); - + fNext->setSize(this->width(), this->height()); fPrev->setSize(this->width(), this->height()); - + SkScalar lr = 0, ud = 0; if (fAnimationDirection & (kLeftDirection|kULDirection|kDLDirection)) lr = this->width(); @@ -134,13 +134,13 @@ protected: ud = this->height(); if (fAnimationDirection & (kDownDirection|kDLDirection|kDRDirection)) ud = -this->height(); - + fBegin[kPrevX] = fBegin[kPrevY] = 0; fBegin[kNextX] = lr; fBegin[kNextY] = ud; fNext->setLocX(lr); fNext->setLocY(ud); - + if (is_transition(fPrev)) lr = ud = 0; fEnd[kPrevX] = -lr; @@ -151,7 +151,7 @@ protected: fInterp.setKeyFrame(0, SkTime::GetMSecs(), fBegin, blend); fInterp.setKeyFrame(1, SkTime::GetMSecs()+500, fEnd, blend); } - + private: enum { kPrevX = 0, @@ -163,7 +163,7 @@ private: SkView* fNext; bool fDone; SkInterpolator fInterp; - + enum Direction{ kUpDirection = 1, kURDirection = 1 << 1, @@ -174,11 +174,11 @@ private: kLeftDirection = 1 << 6, kULDirection = 1 << 7 }; - + Direction fAnimationDirection; SkScalar fBegin[4]; SkScalar fEnd[4]; - + typedef SampleView INHERITED; }; |
