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

Side by Side Diff: ui/base/cursor/cursor_loader_x11.cc

Issue 2605773002: Fix Aura can't provide accurate cursor hotspot info. (Closed)
Patch Set: restore logic in SearchTable() Created 3 years, 11 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 | « no previous file | ui/base/cursor/cursors_aura.cc » ('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 "ui/base/cursor/cursor_loader_x11.h" 5 #include "ui/base/cursor/cursor_loader_x11.h"
6 6
7 #include <float.h> 7 #include <float.h>
8 #include <X11/cursorfont.h> 8 #include <X11/cursorfont.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 10
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 DCHECK(cursor); 277 DCHECK(cursor);
278 278
279 if (*cursor == kCursorNone) { 279 if (*cursor == kCursorNone) {
280 cursor->SetPlatformCursor(invisible_cursor_.get()); 280 cursor->SetPlatformCursor(invisible_cursor_.get());
281 return; 281 return;
282 } 282 }
283 283
284 if (*cursor == kCursorCustom) 284 if (*cursor == kCursorCustom)
285 return; 285 return;
286 286
287 cursor->set_device_scale_factor(scale());
287 cursor->SetPlatformCursor(CursorFromId(cursor->native_type())); 288 cursor->SetPlatformCursor(CursorFromId(cursor->native_type()));
288 } 289 }
289 290
290 const XcursorImage* CursorLoaderX11::GetXcursorImageForTest(int id) { 291 const XcursorImage* CursorLoaderX11::GetXcursorImageForTest(int id) {
291 return test::GetCachedXcursorImage(image_cursors_[id]->cursor); 292 return test::GetCachedXcursorImage(image_cursors_[id]->cursor);
292 } 293 }
293 294
294 bool CursorLoaderX11::IsImageCursor(gfx::NativeCursor native_cursor) { 295 bool CursorLoaderX11::IsImageCursor(gfx::NativeCursor native_cursor) {
295 int type = native_cursor.native_type(); 296 int type = native_cursor.native_type();
296 return image_cursors_.count(type) || animated_cursors_.count(type); 297 return image_cursors_.count(type) || animated_cursors_.count(type);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 342 }
342 343
343 // As a last resort, return a left pointer. 344 // As a last resort, return a left pointer.
344 cursor = XCreateFontCursor(display_, XC_left_ptr); 345 cursor = XCreateFontCursor(display_, XC_left_ptr);
345 DCHECK(cursor); 346 DCHECK(cursor);
346 font_cursors_[id] = cursor; 347 font_cursors_[id] = cursor;
347 return cursor; 348 return cursor;
348 } 349 }
349 350
350 } // namespace ui 351 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/base/cursor/cursors_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698