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

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

Issue 2406763002: In test code, allow any 100% data pack to provide fallbacks. (Closed)
Patch Set: separate loop Created 4 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
« no previous file with comments | « no previous file | ui/base/resource/resource_bundle.cc » ('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 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 5 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 // If the call succeeds, |fell_back_to_1x| indicates whether Chrome's custom 348 // If the call succeeds, |fell_back_to_1x| indicates whether Chrome's custom
349 // csCl PNG chunk is present (added by GRIT if it falls back to a 100% image). 349 // csCl PNG chunk is present (added by GRIT if it falls back to a 100% image).
350 bool LoadBitmap(const ResourceHandle& data_handle, 350 bool LoadBitmap(const ResourceHandle& data_handle,
351 int resource_id, 351 int resource_id,
352 SkBitmap* bitmap, 352 SkBitmap* bitmap,
353 bool* fell_back_to_1x) const; 353 bool* fell_back_to_1x) const;
354 354
355 // Fills the |bitmap| given the |resource_id| and |scale_factor|. 355 // Fills the |bitmap| given the |resource_id| and |scale_factor|.
356 // Returns false if the resource does not exist. This may fall back to 356 // Returns false if the resource does not exist. This may fall back to
357 // the data pack with SCALE_FACTOR_NONE, and when this happens, 357 // the data pack with SCALE_FACTOR_NONE, and when this happens,
358 // |scale_factor| will be set to SCALE_FACTOR_100P. 358 // |scale_factor| will be set to SCALE_FACTOR_NONE.
oshima 2016/10/24 18:07:09 Thank you for catching this. Looks like I forgot t
359 bool LoadBitmap(int resource_id, 359 bool LoadBitmap(int resource_id,
360 ScaleFactor* scale_factor, 360 ScaleFactor* scale_factor,
361 SkBitmap* bitmap, 361 SkBitmap* bitmap,
362 bool* fell_back_to_1x) const; 362 bool* fell_back_to_1x) const;
363 363
364 // Returns true if missing scaled resources should be visually indicated when 364 // Returns true if missing scaled resources should be visually indicated when
365 // drawing the fallback (e.g., by tinting the image). 365 // drawing the fallback (e.g., by tinting the image).
366 static bool ShouldHighlightMissingScaledResources(); 366 static bool ShouldHighlightMissingScaledResources();
367 367
368 // Returns true if the data in |buf| is a PNG that has the special marker 368 // Returns true if the data in |buf| is a PNG that has the special marker
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 422
423 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); 423 DISALLOW_COPY_AND_ASSIGN(ResourceBundle);
424 }; 424 };
425 425
426 } // namespace ui 426 } // namespace ui
427 427
428 // TODO(beng): Someday, maybe, get rid of this. 428 // TODO(beng): Someday, maybe, get rid of this.
429 using ui::ResourceBundle; 429 using ui::ResourceBundle;
430 430
431 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 431 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
OLDNEW
« no previous file with comments | « no previous file | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698