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

Unified Diff: pdf/instance.cc

Issue 484393002: pdf: Use the default resource if high-dpi resources are unavailable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/instance.cc
diff --git a/pdf/instance.cc b/pdf/instance.cc
index cda0c588a665b6a7d9579fa1770681d27461581d..acf19fc816cf5060621b57126b2275d9a12ddca5 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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698