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

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

Issue 308003020: Pass the device scale factor in the command line to renderer processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed presubmit warnings Created 6 years, 6 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 | « content/public/common/content_switches.cc ('k') | ui/gfx/win/dpi.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 <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/big_endian.h" 10 #include "base/big_endian.h"
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 default_to_100P = false; 598 default_to_100P = false;
599 } 599 }
600 } 600 }
601 if (default_to_100P) 601 if (default_to_100P)
602 supported_scale_factors.push_back(SCALE_FACTOR_100P); 602 supported_scale_factors.push_back(SCALE_FACTOR_100P);
603 #endif 603 #endif
604 ui::SetSupportedScaleFactors(supported_scale_factors); 604 ui::SetSupportedScaleFactors(supported_scale_factors);
605 #if defined(OS_WIN) 605 #if defined(OS_WIN)
606 // Must be called _after_ supported scale factors are set since it 606 // Must be called _after_ supported scale factors are set since it
607 // uses them. 607 // uses them.
608 ui::win::InitDeviceScaleFactor(); 608 // Don't initialize the device scale factor if it has already been
609 // initialized.
610 if (!gfx::win::IsDeviceScaleFactorSet())
611 ui::win::InitDeviceScaleFactor();
609 #endif 612 #endif
610 } 613 }
611 614
612 void ResourceBundle::FreeImages() { 615 void ResourceBundle::FreeImages() {
613 images_.clear(); 616 images_.clear();
614 } 617 }
615 618
616 void ResourceBundle::AddDataPackFromPathInternal(const base::FilePath& path, 619 void ResourceBundle::AddDataPackFromPathInternal(const base::FilePath& path,
617 ScaleFactor scale_factor, 620 ScaleFactor scale_factor,
618 bool optional) { 621 bool optional) {
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 // static 819 // static
817 bool ResourceBundle::DecodePNG(const unsigned char* buf, 820 bool ResourceBundle::DecodePNG(const unsigned char* buf,
818 size_t size, 821 size_t size,
819 SkBitmap* bitmap, 822 SkBitmap* bitmap,
820 bool* fell_back_to_1x) { 823 bool* fell_back_to_1x) {
821 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); 824 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size);
822 return gfx::PNGCodec::Decode(buf, size, bitmap); 825 return gfx::PNGCodec::Decode(buf, size, bitmap);
823 } 826 }
824 827
825 } // namespace ui 828 } // namespace ui
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | ui/gfx/win/dpi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698