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

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

Issue 5105006: Resize synchronization for Linux. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
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
« no previous file with comments | « no previous file | chrome/browser/gpu_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/gfx/gl/gl_context_linux.cc
diff --git a/app/gfx/gl/gl_context_linux.cc b/app/gfx/gl/gl_context_linux.cc
index fd0b7b984b1d06bfc55b95602f4b655a63afeee8..bcb0b600c34ffcb7a84103c213f97fea8bce5a0b 100644
--- a/app/gfx/gl/gl_context_linux.cc
+++ b/app/gfx/gl/gl_context_linux.cc
@@ -17,6 +17,8 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/scoped_ptr.h"
+#include "chrome/common/child_thread.h"
+#include "chrome/common/gpu_messages.h"
namespace gfx {
@@ -47,6 +49,7 @@ class ViewGLContext : public GLContext {
virtual bool IsOffscreen();
virtual bool SwapBuffers();
virtual gfx::Size GetSize();
+ virtual void SetSize(gfx::Size size);
virtual void* GetHandle();
virtual void SetSwapInterval(int interval);
@@ -315,6 +318,17 @@ gfx::Size ViewGLContext::GetSize() {
return gfx::Size(attributes.width, attributes.height);
}
+void ViewGLContext::SetSize(gfx::Size size) {
+ // Need to flush the GL commands in flight so that the resize operation
+ // doesn't damage the backbuffer.
+ glFinish();
+
+ ChildThread* gpu_thread = ChildThread::current();
+ bool result = false;
+ gpu_thread->Send(
+ new GpuHostMsg_ResizeXID(window_, size.width(), size.height(), &result));
Ken Russell (switch to Gerrit) 2010/11/22 22:49:52 This violates a large number of abstraction barrie
jonathan.backer 2010/11/23 16:41:13 Done. Thanks for catching this. I used your callba
+}
+
void* ViewGLContext::GetHandle() {
return context_;
}
« no previous file with comments | « no previous file | chrome/browser/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698