win32: post invalidation rectangle to OS directly in SkOSWindow::onHandleInval()
Review URL: https://codereview.chromium.org/1190563002
This commit is contained in:
parent
256cc89c48
commit
e0ef4a7157
@ -32,8 +32,6 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define INVALIDATE_DELAY_MS 200
|
|
||||||
|
|
||||||
static SkOSWindow* gCurrOSWin;
|
static SkOSWindow* gCurrOSWin;
|
||||||
static HWND gEventTarget;
|
static HWND gEventTarget;
|
||||||
|
|
||||||
@ -144,14 +142,6 @@ bool SkOSWindow::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
return true;
|
return true;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case WM_TIMER: {
|
|
||||||
RECT* rect = (RECT*)wParam;
|
|
||||||
InvalidateRect(hWnd, rect, FALSE);
|
|
||||||
KillTimer(hWnd, (UINT_PTR)rect);
|
|
||||||
delete rect;
|
|
||||||
return true;
|
|
||||||
} break;
|
|
||||||
|
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
this->handleClick(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam),
|
this->handleClick(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam),
|
||||||
Click::kDown_State, NULL, getModifiers(message));
|
Click::kDown_State, NULL, getModifiers(message));
|
||||||
@ -228,12 +218,12 @@ void SkOSWindow::updateSize()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void SkOSWindow::onHandleInval(const SkIRect& r) {
|
void SkOSWindow::onHandleInval(const SkIRect& r) {
|
||||||
RECT* rect = new RECT;
|
RECT rect;
|
||||||
rect->left = r.fLeft;
|
rect.left = r.fLeft;
|
||||||
rect->top = r.fTop;
|
rect.top = r.fTop;
|
||||||
rect->right = r.fRight;
|
rect.right = r.fRight;
|
||||||
rect->bottom = r.fBottom;
|
rect.bottom = r.fBottom;
|
||||||
SetTimer((HWND)fHWND, (UINT_PTR)rect, INVALIDATE_DELAY_MS, NULL);
|
InvalidateRect((HWND)fHWND, &rect, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkOSWindow::onAddMenu(const SkOSMenu* sk_menu)
|
void SkOSWindow::onAddMenu(const SkOSMenu* sk_menu)
|
||||||
|
Loading…
Reference in New Issue
Block a user