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

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

Issue 10378009: Get rid of Image::Image(SkBitmap*) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: k Created 8 years, 7 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 | « chrome/tools/profiles/generate_profile.cc ('k') | ui/gfx/image/image.h » ('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 #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
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
OLDNEW
« no previous file with comments | « chrome/tools/profiles/generate_profile.cc ('k') | ui/gfx/image/image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698