diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-26 22:01:41 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-26 22:01:41 +0000 |
commit | b714f55c2a99e52c19eee74503373169a5bb1570 (patch) | |
tree | 2bd2cc1efc5900de121769bf773c7ffbcac01c29 /ui/aura | |
parent | 7406bc1007bc11994c05ccbc1299e6bfabdfdb8f (diff) | |
download | chromium_src-b714f55c2a99e52c19eee74503373169a5bb1570.zip chromium_src-b714f55c2a99e52c19eee74503373169a5bb1570.tar.gz chromium_src-b714f55c2a99e52c19eee74503373169a5bb1570.tar.bz2 |
DCHECK mouse pointer scale factor only when we are loading 2x resources
Bug=None
Test=Try bots pass
TBR=oshima,sky
Review URL: https://chromiumcodereview.appspot.com/10666038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144292 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r-- | ui/aura/root_window_host_linux.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc index db168ff..f1deb2d 100644 --- a/ui/aura/root_window_host_linux.cc +++ b/ui/aura/root_window_host_linux.cc @@ -13,6 +13,7 @@ #include <X11/extensions/Xrandr.h> #include <algorithm> +#include "base/command_line.h" #include "base/message_pump_aurax11.h" #include "base/stl_util.h" #include "base/stringprintf.h" @@ -27,6 +28,7 @@ #include "ui/base/keycodes/keyboard_codes.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/touch/touch_factory.h" +#include "ui/base/ui_base_switches.h" #include "ui/base/view_prop.h" #include "ui/base/x/x11_util.h" #include "ui/compositor/layer.h" @@ -300,6 +302,11 @@ bool ShouldSendCharEventForKeyboardCode(ui::KeyboardCode keycode) { } } +bool HasLoaded2xResources() { + return gfx::Display::GetForcedDeviceScaleFactor() > 1.0f || + CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoad2xResources); +} + } // namespace // A utility class that provides X Cursor for NativeCursors for which we have @@ -401,8 +408,7 @@ class RootWindowHostLinux::ImageCursors { ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id); const gfx::ImageSkiaRep& image_rep = image->GetRepresentation( ui::GetScaleFactorFromScale(scale_factor_)); - // TODO(pkotwicz): The DCHECK is failing in unittests, investigate. - // DCHECK_EQ(scale_factor_, image_rep.GetScale()); + DCHECK(!HasLoaded2xResources() || scale_factor_ == image_rep.GetScale()); gfx::Point hot(hot_x * scale_factor_, hot_y * scale_factor_); XcursorImage* x_image = ui::SkBitmapToXcursorImage(&image_rep.sk_bitmap(), hot); @@ -418,8 +424,7 @@ class RootWindowHostLinux::ImageCursors { ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id); const gfx::ImageSkiaRep& image_rep = image->GetRepresentation( ui::GetScaleFactorFromScale(scale_factor_)); - // TODO(pkotwicz): The DCHECK is failing in unittests, investigate. - // DCHECK_EQ(scale_factor_, image_rep.GetScale()); + DCHECK(!HasLoaded2xResources() || scale_factor_ == image_rep.GetScale()); const SkBitmap bitmap = image_rep.sk_bitmap(); DCHECK_EQ(bitmap.config(), SkBitmap::kARGB_8888_Config); int frame_width = bitmap.height(); |