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

Unified Diff: ui/gl/gl_surface_wgl.cc

Issue 2012803003: Fix --use-gl=desktop for Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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
« no previous file with comments | « ui/gl/gl_surface_wgl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_wgl.cc
diff --git a/ui/gl/gl_surface_wgl.cc b/ui/gl/gl_surface_wgl.cc
index 73a92d7024c8bc7e947094ad03a32c78b85f5daf..d380e757fae597c893b7c7749115c83d12399c0c 100644
--- a/ui/gl/gl_surface_wgl.cc
+++ b/ui/gl/gl_surface_wgl.cc
@@ -239,6 +239,8 @@ bool NativeViewGLSurfaceWGL::Initialize(GLSurface::Format format) {
return false;
}
+ format_ = format;
+
return true;
}
@@ -253,6 +255,32 @@ void NativeViewGLSurfaceWGL::Destroy() {
device_context_ = NULL;
}
+bool NativeViewGLSurfaceWGL::Resize(const gfx::Size& size,
+ float scale_factor,
+ bool has_alpha) {
+ RECT rect;
+ if (!GetClientRect(window_, &rect)) {
+ LOG(ERROR) << "Failed to get parent window size.";
+ return false;
+ }
+ DCHECK(size.width() == (rect.right - rect.left) &&
+ size.height() == (rect.bottom - rect.top));
+ if (!MoveWindow(child_window_, 0, 0, size.width(), size.height(), FALSE)) {
+ LOG(ERROR) << "Failed to resize child window.";
+ return false;
+ }
+ return true;
+}
+
+bool NativeViewGLSurfaceWGL::Recreate() {
+ Destroy();
+ if (!Initialize(format_)) {
+ LOG(ERROR) << "Failed to create surface.";
+ return false;
+ }
+ return true;
+}
+
bool NativeViewGLSurfaceWGL::IsOffscreen() {
return false;
}
« no previous file with comments | « ui/gl/gl_surface_wgl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698