- 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
This commit is contained in:
Scroggo 2011-06-17 13:53:05 +00:00
Родитель cae6b3f1e8
Коммит b4490c7435
2 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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;