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

Side by Side Diff: webkit/glue/webcursor_gtk.cc

Issue 10537037: Fix gcc 4.7 building problems - cont' (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reverted "adding license header to webcursor_gtk_data.h" Created 8 years, 6 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
« no previous file with comments | « media/base/simd/convert_rgb_to_yuv_sse2.cc ('k') | webkit/glue/webcursor_gtk_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "webkit/glue/webcursor.h" 5 #include "webkit/glue/webcursor.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 13 matching lines...) Expand all
24 GdkCursor* GetInlineCustomCursor(CustomCursorType type) { 24 GdkCursor* GetInlineCustomCursor(CustomCursorType type) {
25 static GdkCursor* CustomCursorsGdk[G_N_ELEMENTS(CustomCursors)]; 25 static GdkCursor* CustomCursorsGdk[G_N_ELEMENTS(CustomCursors)];
26 GdkCursor* cursor = CustomCursorsGdk[type]; 26 GdkCursor* cursor = CustomCursorsGdk[type];
27 if (cursor) 27 if (cursor)
28 return cursor; 28 return cursor;
29 const CustomCursor& custom = CustomCursors[type]; 29 const CustomCursor& custom = CustomCursors[type];
30 cursor = gdk_cursor_new_from_name(gdk_display_get_default(), custom.name); 30 cursor = gdk_cursor_new_from_name(gdk_display_get_default(), custom.name);
31 if (!cursor) { 31 if (!cursor) {
32 const GdkColor fg = { 0, 0, 0, 0 }; 32 const GdkColor fg = { 0, 0, 0, 0 };
33 const GdkColor bg = { 65535, 65535, 65535, 65535 }; 33 const GdkColor bg = { 65535, 65535, 65535, 65535 };
34 GdkPixmap* source = gdk_bitmap_create_from_data(NULL, custom.bits, 34 GdkPixmap* source = gdk_bitmap_create_from_data(
35 32, 32); 35 NULL, reinterpret_cast<const gchar*>(custom.bits), 32, 32);
36 GdkPixmap* mask = gdk_bitmap_create_from_data(NULL, custom.mask_bits, 36 GdkPixmap* mask = gdk_bitmap_create_from_data(
37 32, 32); 37 NULL, reinterpret_cast<const gchar*>(custom.mask_bits), 32, 32);
38 cursor = gdk_cursor_new_from_pixmap(source, mask, &fg, &bg, 38 cursor = gdk_cursor_new_from_pixmap(source, mask, &fg, &bg,
39 custom.hot_x, custom.hot_y); 39 custom.hot_x, custom.hot_y);
40 g_object_unref(source); 40 g_object_unref(source);
41 g_object_unref(mask); 41 g_object_unref(mask);
42 } 42 }
43 CustomCursorsGdk[type] = cursor; 43 CustomCursorsGdk[type] = cursor;
44 return cursor; 44 return cursor;
45 } 45 }
46 46
47 } // end anonymous namespace 47 } // end anonymous namespace
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 unref_ = NULL; 213 unref_ = NULL;
214 } 214 }
215 return; 215 return;
216 } 216 }
217 217
218 void WebCursor::CopyPlatformData(const WebCursor& other) { 218 void WebCursor::CopyPlatformData(const WebCursor& other) {
219 if (other.unref_) 219 if (other.unref_)
220 unref_ = gdk_cursor_ref(other.unref_); 220 unref_ = gdk_cursor_ref(other.unref_);
221 return; 221 return;
222 } 222 }
OLDNEW
« no previous file with comments | « media/base/simd/convert_rgb_to_yuv_sse2.cc ('k') | webkit/glue/webcursor_gtk_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698