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

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

Issue 2949353003: Implement large cursors in Mushrome. (Closed)
Patch Set: rename everything to CursorSize Created 3 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 | « ui/base/cursor/cursor.h ('k') | ui/base/cursor/cursor_type.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 "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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 339 }
340 if (cursor != None) { 340 if (cursor != None) {
341 font_cursors_[id] = cursor; 341 font_cursors_[id] = cursor;
342 return cursor; 342 return cursor;
343 } 343 }
344 344
345 // If the theme is missing the desired cursor, use a chromium-supplied 345 // If the theme is missing the desired cursor, use a chromium-supplied
346 // fallback icon. 346 // fallback icon.
347 int resource_id; 347 int resource_id;
348 gfx::Point point; 348 gfx::Point point;
349 if (ui::GetCursorDataFor(ui::CURSOR_SET_NORMAL, id, scale(), &resource_id, 349 if (ui::GetCursorDataFor(ui::CursorSize::kNormal, id, scale(), &resource_id,
350 &point)) { 350 &point)) {
351 LoadImageCursor(id, resource_id, point); 351 LoadImageCursor(id, resource_id, point);
352 return image_cursors_[id]->cursor; 352 return image_cursors_[id]->cursor;
353 } 353 }
354 354
355 // As a last resort, return a left pointer. 355 // As a last resort, return a left pointer.
356 cursor = XCreateFontCursor(display_, XC_left_ptr); 356 cursor = XCreateFontCursor(display_, XC_left_ptr);
357 DCHECK(cursor); 357 DCHECK(cursor);
358 font_cursors_[id] = cursor; 358 font_cursors_[id] = cursor;
359 return cursor; 359 return cursor;
360 } 360 }
361 361
362 } // namespace ui 362 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/cursor/cursor.h ('k') | ui/base/cursor/cursor_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698