| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // Platform specific image scaling is done here. Currently only implemented | 356 // Platform specific image scaling is done here. Currently only implemented |
| 357 // for Windows. | 357 // for Windows. |
| 358 // |image| is the bitmap to be scaled. | 358 // |image| is the bitmap to be scaled. |
| 359 // |loaded_image_scale| is the current scale of the bitmap. | 359 // |loaded_image_scale| is the current scale of the bitmap. |
| 360 // |desired_scale| is the desired scale of the bitmap. | 360 // |desired_scale| is the desired scale of the bitmap. |
| 361 // Returns the scaled bitmap or the original bitmap. | 361 // Returns the scaled bitmap or the original bitmap. |
| 362 static SkBitmap PlatformScaleImage(const SkBitmap& image, | 362 static SkBitmap PlatformScaleImage(const SkBitmap& image, |
| 363 float loaded_image_scale, | 363 float loaded_image_scale, |
| 364 float desired_scale); | 364 float desired_scale); |
| 365 | 365 |
| 366 // Returns the scale to be used for loading an image. In all platforms except | |
| 367 // windows this is based on the scale factors of the loaded resource packs. | |
| 368 // On Windows this returns the device scale factor if high dpi is enabled. | |
| 369 float PlatformGetImageScale(); | |
| 370 | |
| 371 // This pointer is guaranteed to outlive the ResourceBundle instance and may | 366 // This pointer is guaranteed to outlive the ResourceBundle instance and may |
| 372 // be NULL. | 367 // be NULL. |
| 373 Delegate* delegate_; | 368 Delegate* delegate_; |
| 374 | 369 |
| 375 // Protects |images_| and font-related members. | 370 // Protects |images_| and font-related members. |
| 376 scoped_ptr<base::Lock> images_and_fonts_lock_; | 371 scoped_ptr<base::Lock> images_and_fonts_lock_; |
| 377 | 372 |
| 378 // Protects |locale_resources_data_|. | 373 // Protects |locale_resources_data_|. |
| 379 scoped_ptr<base::Lock> locale_resources_data_lock_; | 374 scoped_ptr<base::Lock> locale_resources_data_lock_; |
| 380 | 375 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 408 | 403 |
| 409 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 404 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
| 410 }; | 405 }; |
| 411 | 406 |
| 412 } // namespace ui | 407 } // namespace ui |
| 413 | 408 |
| 414 // TODO(beng): Someday, maybe, get rid of this. | 409 // TODO(beng): Someday, maybe, get rid of this. |
| 415 using ui::ResourceBundle; | 410 using ui::ResourceBundle; |
| 416 | 411 |
| 417 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 412 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
| OLD | NEW |