diff options
-rw-r--r-- | samplecode/SampleApp.cpp | 8 | ||||
-rw-r--r-- | src/utils/unix/SkOSWindow_Unix.cpp | 2 |
2 files changed, 9 insertions, 1 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 diff --git a/src/utils/unix/SkOSWindow_Unix.cpp b/src/utils/unix/SkOSWindow_Unix.cpp index 2e4ae88212..a75216676d 100644 --- a/src/utils/unix/SkOSWindow_Unix.cpp +++ b/src/utils/unix/SkOSWindow_Unix.cpp @@ -25,7 +25,7 @@ const int HEIGHT = 500; const long EVENT_MASK = StructureNotifyMask|ButtonPressMask|ButtonReleaseMask |ExposureMask|PointerMotionMask|KeyPressMask|KeyReleaseMask; -SkOSWindow::SkOSWindow(void* unused) : fGLAttached(false), fVi(0) +SkOSWindow::SkOSWindow(void* unused) : INHERITED(), fGLAttached(false), fVi(0) { fUnixWindow.fDisplay = XOpenDisplay(NULL); Display* dsp = fUnixWindow.fDisplay; |