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 #include "ui/base/resource/resource_bundle.h" | 5 #include "ui/base/resource/resource_bundle.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 | 458 |
459 NOTREACHED() << "Unable to decode theme image resource " << resource_id; | 459 NOTREACHED() << "Unable to decode theme image resource " << resource_id; |
460 return NULL; | 460 return NULL; |
461 } | 461 } |
462 | 462 |
463 gfx::Image& ResourceBundle::GetEmptyImage() { | 463 gfx::Image& ResourceBundle::GetEmptyImage() { |
464 base::AutoLock lock(*images_and_fonts_lock_); | 464 base::AutoLock lock(*images_and_fonts_lock_); |
465 | 465 |
466 if (empty_image_.IsEmpty()) { | 466 if (empty_image_.IsEmpty()) { |
467 // The placeholder bitmap is bright red so people notice the problem. | 467 // The placeholder bitmap is bright red so people notice the problem. |
468 SkBitmap* bitmap = new SkBitmap(); | 468 SkBitmap bitmap; |
469 bitmap->setConfig(SkBitmap::kARGB_8888_Config, 32, 32); | 469 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 32, 32); |
470 bitmap->allocPixels(); | 470 bitmap.allocPixels(); |
471 bitmap->eraseARGB(255, 255, 0, 0); | 471 bitmap.eraseARGB(255, 255, 0, 0); |
472 empty_image_ = gfx::Image(bitmap); | 472 empty_image_ = gfx::Image(bitmap); |
473 } | 473 } |
474 return empty_image_; | 474 return empty_image_; |
475 } | 475 } |
476 | 476 |
477 } // namespace ui | 477 } // namespace ui |
OLD | NEW |