Commit 25f0e5e3 by Jamie Madill

Add a Resize method to OSWindow.

BUG=angle:730 Change-Id: I64106f05eb4188305eb34bbabe7d1cde037e1948 Reviewed-on: https://chromium-review.googlesource.com/213293Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 2b97681b
...@@ -33,8 +33,9 @@ class OSWindow ...@@ -33,8 +33,9 @@ class OSWindow
void pushEvent(Event event); void pushEvent(Event event);
virtual void setMousePosition(int x, int y) = 0; virtual void setMousePosition(int x, int y) = 0;
virtual bool resize(int width, int height) = 0;
private: protected:
int mWidth; int mWidth;
int mHeight; int mHeight;
......
...@@ -474,3 +474,22 @@ OSWindow *CreateOSWindow() ...@@ -474,3 +474,22 @@ OSWindow *CreateOSWindow()
{ {
return new Win32Window(); return new Win32Window();
} }
bool Win32Window::resize(int width, int height)
{
RECT windowRect;
if (!GetWindowRect(mNativeWindow, &windowRect))
{
return false;
}
if (!MoveWindow(mNativeWindow, windowRect.left, windowRect.top, width, height, FALSE))
{
return false;
}
mWidth = width;
mHeight = height;
return true;
}
...@@ -29,6 +29,7 @@ class Win32Window : public OSWindow ...@@ -29,6 +29,7 @@ class Win32Window : public OSWindow
void pushEvent(Event event); void pushEvent(Event event);
void setMousePosition(int x, int y); void setMousePosition(int x, int y);
bool resize(int width, int height);
private: private:
std::string mClassName; std::string mClassName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment