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

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

Issue 11028064: Resize images for hi-dpi based on a custom PNG chunk added by GRIT r78, and roll GRIT r78 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: back out libpng/PNGCodec changes, scan for special chunks by hand (and rebase) Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/base/resource/resource_bundle.cc » ('j') | ui/base/resource/resource_bundle.cc » ('J')
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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // resource pack is loaded. 278 // resource pack is loaded.
279 void LoadTestResources(const FilePath& path, const FilePath& locale_path); 279 void LoadTestResources(const FilePath& path, const FilePath& locale_path);
280 280
281 // Unload the locale specific strings and prepares to load new ones. See 281 // Unload the locale specific strings and prepares to load new ones. See
282 // comments for ReloadLocaleResources(). 282 // comments for ReloadLocaleResources().
283 void UnloadLocaleResources(); 283 void UnloadLocaleResources();
284 284
285 // Initialize all the gfx::Font members if they haven't yet been initialized. 285 // Initialize all the gfx::Font members if they haven't yet been initialized.
286 void LoadFontsIfNecessary(); 286 void LoadFontsIfNecessary();
287 287
288 // Creates and returns a new SkBitmap given the data file to look in and the 288 // Fills the |bitmap| given the data file to look in and the |resource_id|.
289 // |resource_id|. It's up to the caller to free the returned bitmap when 289 // Returns false if the resource does not exist.
290 // done. 290 //
291 SkBitmap* LoadBitmap(const ResourceHandle& dll_inst, int resource_id) const; 291 // If the call succeeds and |fell_back_to_1x| is not NULL, it is set to true
oshima 2012/10/16 23:12:09 fell_back_to_1x must not be NULL now, correct?
benrg 2012/10/17 15:57:25 Fixed.
292 // if Chrome's custom csCl PNG chunk is present (indicating that GRIT fell
293 // back to the 100% image), false if not.
294 bool LoadBitmap(const ResourceHandle& data_handle,
295 int resource_id,
296 SkBitmap* bitmap,
297 bool* fell_back_to_1x) const;
292 298
293 // Creates and returns a new SkBitmap for |resource_id| and |scale_factor|. 299 // Fills the |bitmap| given the |resource_id| and |scale_factor|.
294 // Returns NULL if the resource does not exist. 300 // Returns false if the resource does not exist.
295 SkBitmap* LoadBitmap(int resource_id, ScaleFactor scale_factor) const; 301 bool LoadBitmap(int resource_id,
302 ScaleFactor scale_factor,
303 SkBitmap* bitmap,
304 bool* fell_back_to_1x) const;
296 305
297 // Returns an empty image for when a resource cannot be loaded. This is a 306 // Returns an empty image for when a resource cannot be loaded. This is a
298 // bright red bitmap. 307 // bright red bitmap.
299 gfx::Image& GetEmptyImage(); 308 gfx::Image& GetEmptyImage();
300 309
301 const FilePath& GetOverriddenPakPath(); 310 const FilePath& GetOverriddenPakPath();
302 311
303 // This pointer is guaranteed to outlive the ResourceBundle instance and may 312 // This pointer is guaranteed to outlive the ResourceBundle instance and may
304 // be NULL. 313 // be NULL.
305 Delegate* delegate_; 314 Delegate* delegate_;
(...skipping 29 matching lines...) Expand all
335 344
336 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); 345 DISALLOW_COPY_AND_ASSIGN(ResourceBundle);
337 }; 346 };
338 347
339 } // namespace ui 348 } // namespace ui
340 349
341 // TODO(beng): Someday, maybe, get rid of this. 350 // TODO(beng): Someday, maybe, get rid of this.
342 using ui::ResourceBundle; 351 using ui::ResourceBundle;
343 352
344 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 353 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
OLDNEW
« no previous file with comments | « no previous file | ui/base/resource/resource_bundle.cc » ('j') | ui/base/resource/resource_bundle.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698