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

Side by Side Diff: ui/base/resource/resource_bundle.cc

Issue 1719343002: Move ENABLE_HIDPI to new build flags system (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/ui_base.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/resource/resource_bundle.h" 5 #include "ui/base/resource/resource_bundle.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <utility> 10 #include <utility>
(...skipping 14 matching lines...) Expand all
25 #include "base/synchronization/lock.h" 25 #include "base/synchronization/lock.h"
26 #include "build/build_config.h" 26 #include "build/build_config.h"
27 #include "skia/ext/image_operations.h" 27 #include "skia/ext/image_operations.h"
28 #include "third_party/skia/include/core/SkBitmap.h" 28 #include "third_party/skia/include/core/SkBitmap.h"
29 #include "ui/base/l10n/l10n_util.h" 29 #include "ui/base/l10n/l10n_util.h"
30 #include "ui/base/layout.h" 30 #include "ui/base/layout.h"
31 #include "ui/base/material_design/material_design_controller.h" 31 #include "ui/base/material_design/material_design_controller.h"
32 #include "ui/base/resource/data_pack.h" 32 #include "ui/base/resource/data_pack.h"
33 #include "ui/base/ui_base_paths.h" 33 #include "ui/base/ui_base_paths.h"
34 #include "ui/base/ui_base_switches.h" 34 #include "ui/base/ui_base_switches.h"
35 #include "ui/base/ui_features.h"
35 #include "ui/gfx/codec/jpeg_codec.h" 36 #include "ui/gfx/codec/jpeg_codec.h"
36 #include "ui/gfx/codec/png_codec.h" 37 #include "ui/gfx/codec/png_codec.h"
37 #include "ui/gfx/geometry/safe_integer_conversions.h" 38 #include "ui/gfx/geometry/safe_integer_conversions.h"
38 #include "ui/gfx/geometry/size_conversions.h" 39 #include "ui/gfx/geometry/size_conversions.h"
39 #include "ui/gfx/image/image_skia.h" 40 #include "ui/gfx/image/image_skia.h"
40 #include "ui/gfx/image/image_skia_source.h" 41 #include "ui/gfx/image/image_skia_source.h"
41 #include "ui/gfx/screen.h" 42 #include "ui/gfx/screen.h"
42 #include "ui/strings/grit/app_locale_settings.h" 43 #include "ui/strings/grit/app_locale_settings.h"
43 44
44 #if defined(OS_ANDROID) 45 #if defined(OS_ANDROID)
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 supported_scale_factors.push_back(SCALE_FACTOR_200P); 631 supported_scale_factors.push_back(SCALE_FACTOR_200P);
631 } else { 632 } else {
632 supported_scale_factors.push_back(SCALE_FACTOR_100P); 633 supported_scale_factors.push_back(SCALE_FACTOR_100P);
633 } 634 }
634 #elif defined(OS_MACOSX) 635 #elif defined(OS_MACOSX)
635 if (base::mac::IsOSLionOrLater()) 636 if (base::mac::IsOSLionOrLater())
636 supported_scale_factors.push_back(SCALE_FACTOR_200P); 637 supported_scale_factors.push_back(SCALE_FACTOR_200P);
637 #elif defined(OS_CHROMEOS) 638 #elif defined(OS_CHROMEOS)
638 // TODO(oshima): Include 200P only if the device support 200P 639 // TODO(oshima): Include 200P only if the device support 200P
639 supported_scale_factors.push_back(SCALE_FACTOR_200P); 640 supported_scale_factors.push_back(SCALE_FACTOR_200P);
640 #elif defined(OS_LINUX) && defined(ENABLE_HIDPI) 641 #elif defined(OS_LINUX) && BUILDFLAG(ENABLE_HIDPI)
641 supported_scale_factors.push_back(SCALE_FACTOR_200P); 642 supported_scale_factors.push_back(SCALE_FACTOR_200P);
642 #elif defined(OS_WIN) 643 #elif defined(OS_WIN)
643 bool default_to_100P = true; 644 bool default_to_100P = true;
644 // On Windows if the dpi scale is greater than 1.25 on high dpi machines 645 // On Windows if the dpi scale is greater than 1.25 on high dpi machines
645 // downscaling from 200 percent looks better than scaling up from 100 646 // downscaling from 200 percent looks better than scaling up from 100
646 // percent. 647 // percent.
647 if (gfx::GetDPIScale() > 1.25) { 648 if (gfx::GetDPIScale() > 1.25) {
648 supported_scale_factors.push_back(SCALE_FACTOR_200P); 649 supported_scale_factors.push_back(SCALE_FACTOR_200P);
649 default_to_100P = false; 650 default_to_100P = false;
650 } 651 }
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 // static 874 // static
874 bool ResourceBundle::DecodePNG(const unsigned char* buf, 875 bool ResourceBundle::DecodePNG(const unsigned char* buf,
875 size_t size, 876 size_t size,
876 SkBitmap* bitmap, 877 SkBitmap* bitmap,
877 bool* fell_back_to_1x) { 878 bool* fell_back_to_1x) {
878 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); 879 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size);
879 return gfx::PNGCodec::Decode(buf, size, bitmap); 880 return gfx::PNGCodec::Decode(buf, size, bitmap);
880 } 881 }
881 882
882 } // namespace ui 883 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/ui_base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698