diff options
author | Scroggo <Scroggo@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-17 13:53:05 +0000 |
---|---|---|
committer | Scroggo <Scroggo@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-17 13:53:05 +0000 |
commit | b4490c7435df46261c00dbfdcdd9d2e9d56d1f52 (patch) | |
tree | b7f1a0b32f453e3cf9b1e6d12f3ca8f3e9d5d32b /samplecode | |
parent | cae6b3f1e85239f95fcdad2b341ccbe83a8a2a40 (diff) |
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
Diffstat (limited to 'samplecode')
-rw-r--r-- | samplecode/SampleApp.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index c003e4a3de..2fb73b7e03 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -398,6 +398,12 @@ SampleWindow::SampleWindow(void* hwnd) : INHERITED(hwnd) { 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 @@ void SampleWindow::onSizeChange() { 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 |