Commit 7efa5fbd authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

Fix a couple of bugs with the image skia implementation

Bug=124566
Test=Manual

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=137684

Review URL: https://chromiumcodereview.appspot.com/10389109

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138287 0039d316-1c4b-4281-b951-d872f2087c98
parent b9305cab
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "ui/gfx/codec/jpeg_codec.h" #include "ui/gfx/codec/jpeg_codec.h"
#include "ui/gfx/codec/png_codec.h" #include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#include "ui/gfx/screen.h"
namespace ui { namespace ui {
...@@ -236,11 +237,11 @@ gfx::Image& ResourceBundle::GetImageNamed(int resource_id) { ...@@ -236,11 +237,11 @@ gfx::Image& ResourceBundle::GetImageNamed(int resource_id) {
for (size_t i = 0; i < data_packs_.size(); ++i) { for (size_t i = 0; i < data_packs_.size(); ++i) {
scoped_ptr<SkBitmap> bitmap(LoadBitmap(*data_packs_[i], resource_id)); scoped_ptr<SkBitmap> bitmap(LoadBitmap(*data_packs_[i], resource_id));
if (bitmap.get()) { if (bitmap.get()) {
#if defined(USE_AURA) if (gfx::Screen::IsDIPEnabled())
image_skia.AddBitmapForScale(*bitmap, data_packs_[i]->GetScaleFactor()); image_skia.AddBitmapForScale(*bitmap,
#else data_packs_[i]->GetScaleFactor());
image_skia.AddBitmapForScale(*bitmap, 1.0f); else
#endif image_skia.AddBitmapForScale(*bitmap, 1.0f);
} }
} }
......
...@@ -28,6 +28,9 @@ class UI_EXPORT Screen { ...@@ -28,6 +28,9 @@ class UI_EXPORT Screen {
static void SetInstance(ScreenImpl* screen); static void SetInstance(ScreenImpl* screen);
#endif #endif
// Returns true if DIP is enabled.
static bool IsDIPEnabled();
// Returns the current absolute position of the mouse pointer. // Returns the current absolute position of the mouse pointer.
static gfx::Point GetCursorScreenPoint(); static gfx::Point GetCursorScreenPoint();
......
...@@ -9,6 +9,11 @@ ...@@ -9,6 +9,11 @@
namespace gfx { namespace gfx {
// static
bool Screen::IsDIPEnabled() {
return false;
}
// static // static
gfx::Monitor Screen::GetPrimaryMonitor() { gfx::Monitor Screen::GetPrimaryMonitor() {
NOTIMPLEMENTED() << "crbug.com/117839 tracks implementation"; NOTIMPLEMENTED() << "crbug.com/117839 tracks implementation";
......
...@@ -26,6 +26,11 @@ void Screen::SetInstance(ScreenImpl* screen) { ...@@ -26,6 +26,11 @@ void Screen::SetInstance(ScreenImpl* screen) {
// TODO(oshima): Implement ScreenImpl for Linux/aura and remove this // TODO(oshima): Implement ScreenImpl for Linux/aura and remove this
// ifdef. // ifdef.
// static
bool Screen::IsDIPEnabled() {
return true;
}
// static // static
Point Screen::GetCursorScreenPoint() { Point Screen::GetCursorScreenPoint() {
return g_instance_->GetCursorScreenPoint(); return g_instance_->GetCursorScreenPoint();
......
...@@ -75,6 +75,11 @@ gfx::Rect GetMonitorAreaNearestWindow(gfx::NativeView view) { ...@@ -75,6 +75,11 @@ gfx::Rect GetMonitorAreaNearestWindow(gfx::NativeView view) {
namespace gfx { namespace gfx {
// static
bool Screen::IsDIPEnabled() {
return false;
}
// static // static
gfx::Point Screen::GetCursorScreenPoint() { gfx::Point Screen::GetCursorScreenPoint() {
gint x, y; gint x, y;
......
...@@ -74,6 +74,11 @@ gfx::Monitor GetMonitorForScreen(NSScreen* screen, bool is_primary) { ...@@ -74,6 +74,11 @@ gfx::Monitor GetMonitorForScreen(NSScreen* screen, bool is_primary) {
namespace gfx { namespace gfx {
// static
bool Screen::IsDIPEnabled() {
return false;
}
// static // static
gfx::Point Screen::GetCursorScreenPoint() { gfx::Point Screen::GetCursorScreenPoint() {
NSPoint mouseLocation = [NSEvent mouseLocation]; NSPoint mouseLocation = [NSEvent mouseLocation];
......
...@@ -29,6 +29,11 @@ gfx::Monitor GetMonitor(MONITORINFO& monitor_info) { ...@@ -29,6 +29,11 @@ gfx::Monitor GetMonitor(MONITORINFO& monitor_info) {
namespace gfx { namespace gfx {
// static
bool Screen::IsDIPEnabled() {
return false;
}
// static // static
gfx::Point Screen::GetCursorScreenPoint() { gfx::Point Screen::GetCursorScreenPoint() {
POINT pt; POINT pt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment