Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2572)

Unified Diff: app/gfx/gl/gl_context_win.cc

Issue 4815001: Use inner HWND for accelerated rendering on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: app/gfx/gl/gl_context_win.cc
===================================================================
--- app/gfx/gl/gl_context_win.cc (revision 66779)
+++ app/gfx/gl/gl_context_win.cc (working copy)
@@ -50,6 +50,7 @@
virtual bool IsCurrent();
virtual bool IsOffscreen();
virtual bool SwapBuffers();
+ virtual void SetSize(gfx::Size);
virtual gfx::Size GetSize();
virtual void* GetHandle();
virtual void SetSwapInterval(int interval);
@@ -82,6 +83,7 @@
virtual bool IsCurrent();
virtual bool IsOffscreen();
virtual bool SwapBuffers();
+ virtual void SetSize(gfx::Size);
virtual gfx::Size GetSize();
virtual void* GetHandle();
virtual void SetSwapInterval(int interval);
@@ -411,6 +413,12 @@
return ::SwapBuffers(device_context_) == TRUE;
}
+void NativeViewGLContext::SetSize(gfx::Size size) {
+ UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS |
+ SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE;
+ SetWindowPos(window_, NULL, 0, 0, size.width(), size.height(), swp_flags);
+}
+
gfx::Size NativeViewGLContext::GetSize() {
RECT rect;
CHECK(GetClientRect(window_, &rect));
@@ -527,6 +535,14 @@
// but GDI does not have those semantics.
}
+void OSMesaViewGLContext::SetSize(gfx::Size size) {
+ UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS |
+ SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE;
+ SetWindowPos(window_, NULL, 0, 0, size.width(), size.height(), swp_flags);
+ UpdateSize();
+}
+
+
void OSMesaViewGLContext::UpdateSize() {
// Change back buffer size to that of window. If window handle is invalid, do
// not change the back buffer size.

Powered by Google App Engine
This is Rietveld 408576698