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

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

Issue 27156003: linux_aura: Enable HIDPI support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated after review. 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
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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 // Have high-DPI resources for 140% and 180% scaling on Windows based on 566 // Have high-DPI resources for 140% and 180% scaling on Windows based on
567 // default scaling for Metro mode. Round to nearest supported scale in 567 // default scaling for Metro mode. Round to nearest supported scale in
568 // all cases. 568 // all cases.
569 if (gfx::IsInHighDPIMode()) { 569 if (gfx::IsInHighDPIMode()) {
570 supported_scale_factors.push_back(SCALE_FACTOR_140P); 570 supported_scale_factors.push_back(SCALE_FACTOR_140P);
571 supported_scale_factors.push_back(SCALE_FACTOR_180P); 571 supported_scale_factors.push_back(SCALE_FACTOR_180P);
572 } 572 }
573 #elif defined(OS_CHROMEOS) 573 #elif defined(OS_CHROMEOS)
574 // TODO(oshima): Include 200P only if the device support 200P 574 // TODO(oshima): Include 200P only if the device support 200P
575 supported_scale_factors.push_back(SCALE_FACTOR_200P); 575 supported_scale_factors.push_back(SCALE_FACTOR_200P);
576 #elif defined(OS_LINUX) && defined(USE_AURA)
577 // Provide same UX as on Win desktops.
578 supported_scale_factors.push_back(SCALE_FACTOR_140P);
579 supported_scale_factors.push_back(SCALE_FACTOR_180P);
oshima 2013/10/22 05:35:10 FYI: These scale factors will use 200P assets with
Elliot Glaysher 2013/10/22 17:40:18 IIRC, there are only a few assets that linux_aura
Mikhail 2013/10/23 17:15:02 Should it be a stopper for this CL?
Elliot Glaysher 2013/10/23 17:51:19 It shouldn't block the patch, but it should (possi
oshima 2013/10/23 18:10:59 sg
576 #endif 580 #endif
577 ui::SetSupportedScaleFactors(supported_scale_factors); 581 ui::SetSupportedScaleFactors(supported_scale_factors);
578 #if defined(OS_WIN) 582 #if defined(OS_WIN)
579 // Must be called _after_ supported scale factors are set since it 583 // Must be called _after_ supported scale factors are set since it
580 // uses them. 584 // uses them.
581 ui::win::InitDeviceScaleFactor(); 585 ui::win::InitDeviceScaleFactor();
582 #endif 586 #endif
583 } 587 }
584 588
585 void ResourceBundle::FreeImages() { 589 void ResourceBundle::FreeImages() {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 // static 808 // static
805 bool ResourceBundle::DecodePNG(const unsigned char* buf, 809 bool ResourceBundle::DecodePNG(const unsigned char* buf,
806 size_t size, 810 size_t size,
807 SkBitmap* bitmap, 811 SkBitmap* bitmap,
808 bool* fell_back_to_1x) { 812 bool* fell_back_to_1x) {
809 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); 813 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size);
810 return gfx::PNGCodec::Decode(buf, size, bitmap); 814 return gfx::PNGCodec::Decode(buf, size, bitmap);
811 } 815 }
812 816
813 } // namespace ui 817 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_screen_x11.cc » ('j') | ui/views/widget/desktop_aura/desktop_screen_x11.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698