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

Unified Diff: ui/base/x/x11_util.cc

Issue 280133002: Do not scale cursor image for 2x image (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added test Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« ui/base/x/x11_util.h ('K') | « ui/base/x/x11_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/x11_util.cc
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index 4bfd5c7ee9f9d8222c2a4f42e6a3f7252a6a7d79..5ab953437ed56a3010bf012ebc9c18f146ba2633 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -167,6 +167,10 @@ class XCustomCursorCache {
cache_.clear();
}
+ const XcursorImage* GetXcursorImage(::Cursor cursor) const {
+ return cache_.find(cursor)->second->image();
+ }
+
private:
friend struct DefaultSingletonTraits<XCustomCursorCache>;
@@ -199,6 +203,10 @@ class XCustomCursorCache {
return false;
}
+ const XcursorImage* image() const {
+ return image_;
+ };
+
private:
XcursorImage* image_;
int ref_;
@@ -315,11 +323,6 @@ bool QueryRenderSupport(Display* dpy) {
return cursor_cache->GetCursor(cursor_shape);
}
-void ResetXCursorCache() {
- delete cursor_cache;
- cursor_cache = NULL;
-}
-
::Cursor CreateReffedCustomXCursor(XcursorImage* image) {
return XCustomCursorCache::GetInstance()->InstallCustomCursor(image);
}
@@ -1271,6 +1274,18 @@ void XScopedCursor::reset(::Cursor cursor) {
cursor_ = cursor;
}
+namespace test {
+
+void ResetXCursorCache() {
+ delete cursor_cache;
+ cursor_cache = NULL;
+}
+
+const XcursorImage* GetCachedXcursorImage(::Cursor cursor) {
+ return XCustomCursorCache::GetInstance()->GetXcursorImage(cursor);
+}
+}
+
// ----------------------------------------------------------------------------
// These functions are declared in x11_util_internal.h because they require
// XLib.h to be included, and it conflicts with many other headers.
« ui/base/x/x11_util.h ('K') | « ui/base/x/x11_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698