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

Unified Diff: ui/base/resource/resource_bundle.cc

Issue 10389109: Add gfx::Screen::IsEnabled() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | ui/gfx/image/image_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle.cc
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc
index f84e8dbb8d432f03040d2a7ef4e472c06ce51c10..ed0bab93da22fa302d4a5d365d1457f6312b27d0 100644
--- a/ui/base/resource/resource_bundle.cc
+++ b/ui/base/resource/resource_bundle.cc
@@ -26,6 +26,10 @@
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image_skia.h"
+#if defined(USE_AURA)
+#include "ui/compositor/dip_util.h"
+#endif
+
namespace ui {
namespace {
@@ -236,11 +240,12 @@ 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(ENABLE_DIP)
- image_skia.AddBitmapForScale(*bitmap, data_packs_[i]->GetScaleFactor());
-#else
- image_skia.AddBitmapForScale(*bitmap, 1.0f);
+ float image_scale_factor = 1.0f;
+#if defined(USE_AURA)
+ if (ui::IsDIPEnabled())
sky 2012/05/14 14:09:58 Can we define this for all platforms so that we do
+ image_scale_factor = data_packs_[i]->GetScaleFactor();
#endif
+ image_skia.AddBitmapForScale(*bitmap, image_scale_factor);
}
}
« no previous file with comments | « no previous file | ui/gfx/image/image_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698