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

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

Issue 23498059: Remove last dependencies on ui/base from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last rebase Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura/test/test_aura_initializer.cc ('k') | ui/base/win/dpi_setup.h » ('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 <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 23 matching lines...) Expand all
34 #include "ui/gfx/screen.h" 34 #include "ui/gfx/screen.h"
35 #include "ui/gfx/size_conversions.h" 35 #include "ui/gfx/size_conversions.h"
36 #include "ui/gfx/skbitmap_operations.h" 36 #include "ui/gfx/skbitmap_operations.h"
37 37
38 #if defined(OS_CHROMEOS) 38 #if defined(OS_CHROMEOS)
39 #include "ui/base/l10n/l10n_util.h" 39 #include "ui/base/l10n/l10n_util.h"
40 #include "ui/gfx/platform_font_pango.h" 40 #include "ui/gfx/platform_font_pango.h"
41 #endif 41 #endif
42 42
43 #if defined(OS_WIN) 43 #if defined(OS_WIN)
44 #include "ui/base/win/dpi_setup.h"
44 #include "ui/gfx/win/dpi.h" 45 #include "ui/gfx/win/dpi.h"
45 #endif 46 #endif
46 47
47 #if defined(OS_MACOSX) && !defined(OS_IOS) 48 #if defined(OS_MACOSX) && !defined(OS_IOS)
48 #include "base/mac/mac_util.h" 49 #include "base/mac/mac_util.h"
49 #endif 50 #endif
50 51
51 namespace ui { 52 namespace ui {
52 53
53 namespace { 54 namespace {
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 if (display.device_scale_factor() > 1.0) { 556 if (display.device_scale_factor() > 1.0) {
556 DCHECK_EQ(2.0, display.device_scale_factor()); 557 DCHECK_EQ(2.0, display.device_scale_factor());
557 supported_scale_factors.push_back(SCALE_FACTOR_200P); 558 supported_scale_factors.push_back(SCALE_FACTOR_200P);
558 } else { 559 } else {
559 supported_scale_factors.push_back(SCALE_FACTOR_100P); 560 supported_scale_factors.push_back(SCALE_FACTOR_100P);
560 } 561 }
561 #elif defined(OS_MACOSX) 562 #elif defined(OS_MACOSX)
562 if (base::mac::IsOSLionOrLater()) 563 if (base::mac::IsOSLionOrLater())
563 supported_scale_factors.push_back(SCALE_FACTOR_200P); 564 supported_scale_factors.push_back(SCALE_FACTOR_200P);
564 #elif defined(OS_WIN) 565 #elif defined(OS_WIN)
566 ui::win::InitDeviceScaleFactor();
565 // Have high-DPI resources for 140% and 180% scaling on Windows based on 567 // Have high-DPI resources for 140% and 180% scaling on Windows based on
566 // default scaling for Metro mode. Round to nearest supported scale in 568 // default scaling for Metro mode. Round to nearest supported scale in
567 // all cases. 569 // all cases.
568 if (gfx::IsInHighDPIMode()) { 570 if (gfx::IsInHighDPIMode()) {
569 supported_scale_factors.push_back(SCALE_FACTOR_140P); 571 supported_scale_factors.push_back(SCALE_FACTOR_140P);
570 supported_scale_factors.push_back(SCALE_FACTOR_180P); 572 supported_scale_factors.push_back(SCALE_FACTOR_180P);
571 } 573 }
572 #elif defined(OS_CHROMEOS) 574 #elif defined(OS_CHROMEOS)
573 // TODO(oshima): Include 200P only if the device support 200P 575 // TODO(oshima): Include 200P only if the device support 200P
574 supported_scale_factors.push_back(SCALE_FACTOR_200P); 576 supported_scale_factors.push_back(SCALE_FACTOR_200P);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 // static 800 // static
799 bool ResourceBundle::DecodePNG(const unsigned char* buf, 801 bool ResourceBundle::DecodePNG(const unsigned char* buf,
800 size_t size, 802 size_t size,
801 SkBitmap* bitmap, 803 SkBitmap* bitmap,
802 bool* fell_back_to_1x) { 804 bool* fell_back_to_1x) {
803 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); 805 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size);
804 return gfx::PNGCodec::Decode(buf, size, bitmap); 806 return gfx::PNGCodec::Decode(buf, size, bitmap);
805 } 807 }
806 808
807 } // namespace ui 809 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/test/test_aura_initializer.cc ('k') | ui/base/win/dpi_setup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698