diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-20 05:03:53 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-20 05:05:15 +0000 |
commit | c9b525341a8275143cb0305cc05287bfd3c5566b (patch) | |
tree | 18a90cc329a7b9831006f2f8c79a20941b8985d3 /pdf | |
parent | 469239e77f20c4ab2656f0f69b8793076a867120 (diff) | |
download | chromium_src-c9b525341a8275143cb0305cc05287bfd3c5566b.zip chromium_src-c9b525341a8275143cb0305cc05287bfd3c5566b.tar.gz chromium_src-c9b525341a8275143cb0305cc05287bfd3c5566b.tar.bz2 |
pdf: Use the default resource if high-dpi resources are unavailable.
BUG=401242
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/484393002
Cr-Commit-Position: refs/heads/master@{#290766}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/instance.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pdf/instance.cc b/pdf/instance.cc index cda0c58..acf19fc 100644 --- a/pdf/instance.cc +++ b/pdf/instance.cc @@ -2504,10 +2504,14 @@ double Instance::CalculateZoom(uint32 control_id) const { } pp::ImageData Instance::CreateResourceImage(PP_ResourceImage image_id) { - if (hidpi_enabled_) - return pp::PDF::GetResourceImageForScale(this, image_id, device_scale_); + pp::ImageData resource_data; + if (hidpi_enabled_) { + resource_data = + pp::PDF::GetResourceImageForScale(this, image_id, device_scale_); + } - return pp::PDF::GetResourceImage(this, image_id); + return resource_data.data() ? resource_data + : pp::PDF::GetResourceImage(this, image_id); } std::string Instance::GetLocalizedString(PP_ResourceString id) { |