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

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

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: GetNativeScreen Created 4 years, 11 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
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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 if (gfx::Display::HasForceDeviceScaleFactor()) { 618 if (gfx::Display::HasForceDeviceScaleFactor()) {
619 display_density = gfx::Display::GetForcedDeviceScaleFactor(); 619 display_density = gfx::Display::GetForcedDeviceScaleFactor();
620 } else { 620 } else {
621 gfx::DeviceDisplayInfo device_info; 621 gfx::DeviceDisplayInfo device_info;
622 display_density = device_info.GetDIPScale(); 622 display_density = device_info.GetDIPScale();
623 } 623 }
624 const ScaleFactor closest = FindClosestScaleFactorUnsafe(display_density); 624 const ScaleFactor closest = FindClosestScaleFactorUnsafe(display_density);
625 if (closest != SCALE_FACTOR_100P) 625 if (closest != SCALE_FACTOR_100P)
626 supported_scale_factors.push_back(closest); 626 supported_scale_factors.push_back(closest);
627 #elif defined(OS_IOS) 627 #elif defined(OS_IOS)
628 gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); 628 gfx::Display display = gfx::Screen::GetScreen()->GetPrimaryDisplay();
629 if (display.device_scale_factor() > 2.0) { 629 if (display.device_scale_factor() > 2.0) {
630 DCHECK_EQ(3.0, display.device_scale_factor()); 630 DCHECK_EQ(3.0, display.device_scale_factor());
631 supported_scale_factors.push_back(SCALE_FACTOR_300P); 631 supported_scale_factors.push_back(SCALE_FACTOR_300P);
632 } else if (display.device_scale_factor() > 1.0) { 632 } else if (display.device_scale_factor() > 1.0) {
633 DCHECK_EQ(2.0, display.device_scale_factor()); 633 DCHECK_EQ(2.0, display.device_scale_factor());
634 supported_scale_factors.push_back(SCALE_FACTOR_200P); 634 supported_scale_factors.push_back(SCALE_FACTOR_200P);
635 } else { 635 } else {
636 supported_scale_factors.push_back(SCALE_FACTOR_100P); 636 supported_scale_factors.push_back(SCALE_FACTOR_100P);
637 } 637 }
638 #elif defined(OS_MACOSX) 638 #elif defined(OS_MACOSX)
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 // static 919 // static
920 bool ResourceBundle::DecodePNG(const unsigned char* buf, 920 bool ResourceBundle::DecodePNG(const unsigned char* buf,
921 size_t size, 921 size_t size,
922 SkBitmap* bitmap, 922 SkBitmap* bitmap,
923 bool* fell_back_to_1x) { 923 bool* fell_back_to_1x) {
924 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); 924 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size);
925 return gfx::PNGCodec::Decode(buf, size, bitmap); 925 return gfx::PNGCodec::Decode(buf, size, bitmap);
926 } 926 }
927 927
928 } // namespace ui 928 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698