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 @@
#include "ui/gfx/codec/jpeg_codec.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/screen.h"
namespace ui {
......@@ -236,11 +237,11 @@ gfx::Image& ResourceBundle::GetImageNamed(int resource_id) {
for (size_t i = 0; i < data_packs_.size(); ++i) {
scoped_ptr<SkBitmap> bitmap(LoadBitmap(*data_packs_[i], resource_id));
if (bitmap.get()) {
#if defined(USE_AURA)
image_skia.AddBitmapForScale(*bitmap, data_packs_[i]->GetScaleFactor());
#else
image_skia.AddBitmapForScale(*bitmap, 1.0f);
#endif
if (gfx::Screen::IsDIPEnabled())
image_skia.AddBitmapForScale(*bitmap,
data_packs_[i]->GetScaleFactor());
else
image_skia.AddBitmapForScale(*bitmap, 1.0f);
}
}
......
......@@ -28,6 +28,9 @@ class UI_EXPORT Screen {
static void SetInstance(ScreenImpl* screen);
#endif
// Returns true if DIP is enabled.
static bool IsDIPEnabled();
// Returns the current absolute position of the mouse pointer.
static gfx::Point GetCursorScreenPoint();
......
......@@ -9,6 +9,11 @@
namespace gfx {
// static
bool Screen::IsDIPEnabled() {
return false;
}
// static
gfx::Monitor Screen::GetPrimaryMonitor() {
NOTIMPLEMENTED() << "crbug.com/117839 tracks implementation";
......
......@@ -26,6 +26,11 @@ void Screen::SetInstance(ScreenImpl* screen) {
// TODO(oshima): Implement ScreenImpl for Linux/aura and remove this
// ifdef.
// static
bool Screen::IsDIPEnabled() {
return true;
}
// static
Point Screen::GetCursorScreenPoint() {
return g_instance_->GetCursorScreenPoint();
......
......@@ -75,6 +75,11 @@ gfx::Rect GetMonitorAreaNearestWindow(gfx::NativeView view) {
namespace gfx {
// static
bool Screen::IsDIPEnabled() {
return false;
}
// static
gfx::Point Screen::GetCursorScreenPoint() {
gint x, y;
......
......@@ -74,6 +74,11 @@ gfx::Monitor GetMonitorForScreen(NSScreen* screen, bool is_primary) {
namespace gfx {
// static
bool Screen::IsDIPEnabled() {
return false;
}
// static
gfx::Point Screen::GetCursorScreenPoint() {
NSPoint mouseLocation = [NSEvent mouseLocation];
......
......@@ -29,6 +29,11 @@ gfx::Monitor GetMonitor(MONITORINFO& monitor_info) {
namespace gfx {
// static
bool Screen::IsDIPEnabled() {
return false;
}
// static
gfx::Point Screen::GetCursorScreenPoint() {
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