OLD | NEW |
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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 size_t size, | 346 size_t size, |
347 SkBitmap* bitmap, | 347 SkBitmap* bitmap, |
348 bool* fell_back_to_1x); | 348 bool* fell_back_to_1x); |
349 | 349 |
350 // Returns an empty image for when a resource cannot be loaded. This is a | 350 // Returns an empty image for when a resource cannot be loaded. This is a |
351 // bright red bitmap. | 351 // bright red bitmap. |
352 gfx::Image& GetEmptyImage(); | 352 gfx::Image& GetEmptyImage(); |
353 | 353 |
354 const base::FilePath& GetOverriddenPakPath(); | 354 const base::FilePath& GetOverriddenPakPath(); |
355 | 355 |
356 // Platform specific image scaling is done here. Currently only implemented | |
357 // for Windows. | |
358 // |image| is the bitmap to be scaled. | |
359 // |loaded_image_scale| is the current scale of the bitmap. | |
360 // |desired_scale| is the desired scale of the bitmap. | |
361 // Returns the scaled bitmap or null bitmap if scaling is disabled. | |
362 static SkBitmap PlatformScaleImage(const SkBitmap& image, | |
363 float loaded_image_scale, | |
364 float desired_scale); | |
365 | |
366 // This pointer is guaranteed to outlive the ResourceBundle instance and may | 356 // This pointer is guaranteed to outlive the ResourceBundle instance and may |
367 // be NULL. | 357 // be NULL. |
368 Delegate* delegate_; | 358 Delegate* delegate_; |
369 | 359 |
370 // Protects |images_| and font-related members. | 360 // Protects |images_| and font-related members. |
371 scoped_ptr<base::Lock> images_and_fonts_lock_; | 361 scoped_ptr<base::Lock> images_and_fonts_lock_; |
372 | 362 |
373 // Protects |locale_resources_data_|. | 363 // Protects |locale_resources_data_|. |
374 scoped_ptr<base::Lock> locale_resources_data_lock_; | 364 scoped_ptr<base::Lock> locale_resources_data_lock_; |
375 | 365 |
(...skipping 27 matching lines...) Expand all Loading... |
403 | 393 |
404 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 394 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
405 }; | 395 }; |
406 | 396 |
407 } // namespace ui | 397 } // namespace ui |
408 | 398 |
409 // TODO(beng): Someday, maybe, get rid of this. | 399 // TODO(beng): Someday, maybe, get rid of this. |
410 using ui::ResourceBundle; | 400 using ui::ResourceBundle; |
411 | 401 |
412 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 402 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
OLD | NEW |