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

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

Issue 9537019: Revert "GTK: Remove calls that no longer exist and just call the base unref." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | 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) 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 "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"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 custom_size_.width(), custom_size_.height()); 175 custom_size_.width(), custom_size_.height());
176 bitmap.allocPixels(); 176 bitmap.allocPixels();
177 memcpy(bitmap.getAddr32(0, 0), custom_data_.data(), custom_data_.size()); 177 memcpy(bitmap.getAddr32(0, 0), custom_data_.data(), custom_data_.size());
178 178
179 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&bitmap); 179 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&bitmap);
180 GdkCursor* cursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), 180 GdkCursor* cursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(),
181 pixbuf, 181 pixbuf,
182 hotspot_.x(), 182 hotspot_.x(),
183 hotspot_.y()); 183 hotspot_.y());
184 184
185 g_object_unref(pixbuf); 185 gdk_pixbuf_unref(pixbuf);
186 186
187 if (unref_) 187 if (unref_)
188 g_object_unref(unref_); 188 gdk_cursor_unref(unref_);
189 unref_ = cursor; 189 unref_ = cursor;
190 return cursor; 190 return cursor;
191 } 191 }
192 192
193 void WebCursor::InitPlatformData() { 193 void WebCursor::InitPlatformData() {
194 unref_ = NULL; 194 unref_ = NULL;
195 return; 195 return;
196 } 196 }
197 197
198 bool WebCursor::SerializePlatformData(Pickle* pickle) const { 198 bool WebCursor::SerializePlatformData(Pickle* pickle) const {
(...skipping 14 matching lines...) Expand all
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 | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698