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

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

Issue 11301007: Load the resources for max scale factor first. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « ui/base/layout_unittest.cc ('k') | 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 "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <map> 10 #include <map>
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 // Returns false if the resource does not exist. 303 // Returns false if the resource does not exist.
304 // 304 //
305 // If the call succeeds, |fell_back_to_1x| indicates whether Chrome's custom 305 // If the call succeeds, |fell_back_to_1x| indicates whether Chrome's custom
306 // csCl PNG chunk is present (added by GRIT if it falls back to a 100% image). 306 // csCl PNG chunk is present (added by GRIT if it falls back to a 100% image).
307 bool LoadBitmap(const ResourceHandle& data_handle, 307 bool LoadBitmap(const ResourceHandle& data_handle,
308 int resource_id, 308 int resource_id,
309 SkBitmap* bitmap, 309 SkBitmap* bitmap,
310 bool* fell_back_to_1x) const; 310 bool* fell_back_to_1x) const;
311 311
312 // Fills the |bitmap| given the |resource_id| and |scale_factor|. 312 // Fills the |bitmap| given the |resource_id| and |scale_factor|.
313 // Returns false if the resource does not exist. 313 // Returns false if the resource does not exist. This may fall back to
314 // the data pack with SCALE_FACTOR_NONE, and when this happens,
315 // |scale_factor| will be set to SCALE_FACTOR_100P.
314 bool LoadBitmap(int resource_id, 316 bool LoadBitmap(int resource_id,
315 ScaleFactor scale_factor, 317 ScaleFactor* scale_factor,
316 SkBitmap* bitmap, 318 SkBitmap* bitmap,
317 bool* fell_back_to_1x) const; 319 bool* fell_back_to_1x) const;
318 320
319 // Returns an empty image for when a resource cannot be loaded. This is a 321 // Returns an empty image for when a resource cannot be loaded. This is a
320 // bright red bitmap. 322 // bright red bitmap.
321 gfx::Image& GetEmptyImage(); 323 gfx::Image& GetEmptyImage();
322 324
323 const FilePath& GetOverriddenPakPath(); 325 const FilePath& GetOverriddenPakPath();
324 326
325 // This pointer is guaranteed to outlive the ResourceBundle instance and may 327 // This pointer is guaranteed to outlive the ResourceBundle instance and may
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 362
361 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); 363 DISALLOW_COPY_AND_ASSIGN(ResourceBundle);
362 }; 364 };
363 365
364 } // namespace ui 366 } // namespace ui
365 367
366 // TODO(beng): Someday, maybe, get rid of this. 368 // TODO(beng): Someday, maybe, get rid of this.
367 using ui::ResourceBundle; 369 using ui::ResourceBundle;
368 370
369 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 371 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
OLDNEW
« no previous file with comments | « ui/base/layout_unittest.cc ('k') | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698