| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/demos/framework/window.h" | 5 #include "gpu/demos/framework/window.h" |
| 6 | 6 |
| 7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 using gpu::demos::Window; | 13 using gpu::demos::Window; |
| 14 | 14 |
| 15 gboolean OnDelete(GtkWidget* widget, GdkEventExpose* event) { | 15 gboolean OnDelete(GtkWidget* widget, GdkEventExpose* event) { |
| 16 gtk_main_quit(); | 16 gtk_main_quit(); |
| 17 return FALSE; | 17 return FALSE; |
| 18 } | 18 } |
| 19 | 19 |
| 20 gboolean OnExpose(GtkWidget* widget, GdkEventExpose* event, gpointer data) { | 20 gboolean OnExpose(GtkWidget* widget, GdkEventExpose* event, gpointer data) { |
| 21 Window* window = static_cast<Window*>(data); | 21 Window* window = static_cast<Window*>(data); |
| 22 window->OnPaint(); | 22 window->OnPaint(); |
| 23 | 23 |
| 24 // TODO(alokp): Figure out why this is crashing. Animation will not work | 24 gtk_widget_queue_draw(widget); |
| 25 // until then. | |
| 26 //gtk_widget_queue_draw(widget); | |
| 27 return FALSE; | 25 return FALSE; |
| 28 } | 26 } |
| 29 } // namespace | 27 } // namespace |
| 30 | 28 |
| 31 namespace gpu { | 29 namespace gpu { |
| 32 namespace demos { | 30 namespace demos { |
| 33 | 31 |
| 34 void Window::MainLoop() { | 32 void Window::MainLoop() { |
| 35 gtk_signal_connect(GTK_OBJECT(window_handle_), | 33 gtk_signal_connect(GTK_OBJECT(window_handle_), |
| 36 "delete_event", | 34 "delete_event", |
| (...skipping 19 matching lines...) Expand all Loading... |
| 56 return GTK_WINDOW(hwnd); | 54 return GTK_WINDOW(hwnd); |
| 57 } | 55 } |
| 58 | 56 |
| 59 gfx::AcceleratedWidget Window::PluginWindow(gfx::NativeWindow hwnd) { | 57 gfx::AcceleratedWidget Window::PluginWindow(gfx::NativeWindow hwnd) { |
| 60 return GDK_WINDOW_XWINDOW(GTK_WIDGET(hwnd)->window); | 58 return GDK_WINDOW_XWINDOW(GTK_WIDGET(hwnd)->window); |
| 61 } | 59 } |
| 62 | 60 |
| 63 } // namespace demos | 61 } // namespace demos |
| 64 } // namespace gpu | 62 } // namespace gpu |
| 65 | 63 |
| OLD | NEW |