Index: samplecode/SampleApp.cpp |
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp |
index 318a8224c0adeb075e55379953abd1666ce2b034..2d12bfd67293bbaccc9107befbdb11d3ad6e317a 100644 |
--- a/samplecode/SampleApp.cpp |
+++ b/samplecode/SampleApp.cpp |
@@ -823,9 +823,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev |
fMagnify = false; |
fSaveToPdf = false; |
- |
- fTransitionNext = 6; |
- fTransitionPrev = 2; |
+ fSaveToSKP = false; |
int sinkID = this->getSinkID(); |
fAppMenu = new SkOSMenu; |
@@ -888,16 +886,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev |
fAppMenu->assignKeyEquivalentToItem(itemID, 'z'); |
itemID = fAppMenu->appendSwitch("Magnify", "Magnify" , sinkID, fMagnify); |
fAppMenu->assignKeyEquivalentToItem(itemID, 'm'); |
- itemID =fAppMenu->appendList("Transition-Next", "Transition-Next", sinkID, |
- fTransitionNext, "Up", "Up and Right", "Right", |
- "Down and Right", "Down", "Down and Left", |
- "Left", "Up and Left", NULL); |
- fAppMenu->assignKeyEquivalentToItem(itemID, 'j'); |
- itemID =fAppMenu->appendList("Transition-Prev", "Transition-Prev", sinkID, |
- fTransitionPrev, "Up", "Up and Right", "Right", |
- "Down and Right", "Down", "Down and Left", |
- "Left", "Up and Left", NULL); |
- fAppMenu->assignKeyEquivalentToItem(itemID, 'k'); |
+ |
itemID = fAppMenu->appendAction("Save to PDF", sinkID); |
fAppMenu->assignKeyEquivalentToItem(itemID, 'e'); |
@@ -1259,6 +1248,12 @@ void SampleWindow::afterChildren(SkCanvas* orig) { |
if (kPicture_DeviceType == fDeviceType) { |
SkAutoTUnref<const SkPicture> picture(fRecorder.endRecording()); |
+ if (fSaveToSKP) { |
+ SkFILEWStream stream("sample_app.skp"); |
+ picture->serialize(&stream); |
+ fSaveToSKP = false; |
+ } |
+ |
if (true) { |
if (true) { |
SkImageInfo info; |
@@ -1496,9 +1491,8 @@ bool SampleWindow::onEvent(const SkEvent& evt) { |
SkOSMenu::FindListIndex(evt, "Hinting", &fHintingState) || |
SkOSMenu::FindSwitchState(evt, "Clip", &fUseClip) || |
SkOSMenu::FindSwitchState(evt, "Zoomer", &fShowZoomer) || |
- SkOSMenu::FindSwitchState(evt, "Magnify", &fMagnify) || |
- SkOSMenu::FindListIndex(evt, "Transition-Next", &fTransitionNext) || |
- SkOSMenu::FindListIndex(evt, "Transition-Prev", &fTransitionPrev)) { |
+ SkOSMenu::FindSwitchState(evt, "Magnify", &fMagnify)) |
+ { |
this->inval(NULL); |
this->updateTitle(); |
return true; |
@@ -1653,6 +1647,10 @@ bool SampleWindow::onHandleChar(SkUnichar uni) { |
this->inval(NULL); |
this->updateTitle(); |
return true; |
+ case 'K': |
+ fSaveToSKP = true; |
+ this->inval(NULL); |
+ return true; |
#if SK_SUPPORT_GPU |
case 'p': |
{ |