Minor fixes for SampleApp.
- Add a comment for invalidating in onSizeChange.
- Call base constructor for SkOSWindow_Unix.
- Call onSizeChange in SampleWindow constructor so fZoomCenter gets set.
git-svn-id: http://skia.googlecode.com/svn/trunk@1627 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index c003e4a..2fb73b7 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -398,6 +398,12 @@
fCurrIndex = 0;
this->loadView(fSamples[fCurrIndex]());
+ // If another constructor set our dimensions, ensure that our
+ // onSizeChange gets called.
+ if (this->height() && this->width()) {
+ this->onSizeChange();
+ }
+
#ifdef SK_BUILD_FOR_MAC
testpdf();
#endif
@@ -1365,6 +1371,8 @@
fZoomCenterY = SkScalarHalf(this->height());
#ifdef ANDROID
+ // FIXME: The first draw after a size change does not work on Android, so
+ // we post an invalidate.
postInvalDelay(this->getSinkID());
#endif
this->updateTitle(); // to refresh our config