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

Side by Side Diff: media/tools/shader_bench/window_linux.cc

Issue 6628020: Cleaning up src/media to be consistent with static versus anonymous namespaces. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: fix namespaces Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "media/tools/shader_bench/window.h" 5 #include "media/tools/shader_bench/window.h"
6 6
7 #include "base/task.h" 7 #include "base/task.h"
8 #include "media/tools/shader_bench/painter.h" 8 #include "media/tools/shader_bench/painter.h"
9 9
10 #include <gdk/gdkx.h> 10 #include <gdk/gdkx.h>
11 #include <gtk/gtk.h> 11 #include <gtk/gtk.h>
12 12
13 namespace { 13 namespace media {
14 14
15 gboolean OnDelete(GtkWidget* widget, GdkEventExpose* event) { 15 static 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 static gboolean OnExpose(GtkWidget* widget,
21 media::Window* window = reinterpret_cast<media::Window*>(data); 21 GdkEventExpose* event,
22 gpointer data) {
23 Window* window = reinterpret_cast<Window*>(data);
22 if (window) 24 if (window)
23 window->OnPaint(); 25 window->OnPaint();
24 return FALSE; 26 return FALSE;
25 } 27 }
26 28
27 } // namespace
28
29 namespace media {
30
31 gfx::NativeWindow Window::CreateNativeWindow(int width, int height) { 29 gfx::NativeWindow Window::CreateNativeWindow(int width, int height) {
32 GtkWidget* hwnd = gtk_window_new(GTK_WINDOW_TOPLEVEL); 30 GtkWidget* hwnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
33 31
34 gtk_window_set_default_size(GTK_WINDOW(hwnd), width, height); 32 gtk_window_set_default_size(GTK_WINDOW(hwnd), width, height);
35 gtk_widget_set_double_buffered(hwnd, FALSE); 33 gtk_widget_set_double_buffered(hwnd, FALSE);
36 gtk_widget_set_app_paintable(hwnd, TRUE); 34 gtk_widget_set_app_paintable(hwnd, TRUE);
37 gtk_widget_show(hwnd); 35 gtk_widget_show(hwnd);
38 36
39 return GTK_WINDOW(hwnd); 37 return GTK_WINDOW(hwnd);
40 } 38 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 78 }
81 gtk_main_quit(); 79 gtk_main_quit();
82 } 80 }
83 } 81 }
84 82
85 void Window::MainLoop() { 83 void Window::MainLoop() {
86 gtk_main(); 84 gtk_main();
87 } 85 }
88 86
89 } // namespace media 87 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698