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

Side by Side Diff: ui/gfx/skbitmap_operations.cc

Issue 9720040: ui/gfx: Do not use the deprecated SkBitmap::getConfig() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « ui/gfx/icon_util.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gfx/skbitmap_operations.h" 5 #include "ui/gfx/skbitmap_operations.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 (*line_proc)(hsl_shift, pixels, tinted_pixels, bitmap.width()); 567 (*line_proc)(hsl_shift, pixels, tinted_pixels, bitmap.width());
568 } 568 }
569 569
570 return shifted; 570 return shifted;
571 } 571 }
572 572
573 // static 573 // static
574 SkBitmap SkBitmapOperations::CreateTiledBitmap(const SkBitmap& source, 574 SkBitmap SkBitmapOperations::CreateTiledBitmap(const SkBitmap& source,
575 int src_x, int src_y, 575 int src_x, int src_y,
576 int dst_w, int dst_h) { 576 int dst_w, int dst_h) {
577 DCHECK(source.getConfig() == SkBitmap::kARGB_8888_Config); 577 DCHECK(source.config() == SkBitmap::kARGB_8888_Config);
578 578
579 SkBitmap cropped; 579 SkBitmap cropped;
580 cropped.setConfig(SkBitmap::kARGB_8888_Config, dst_w, dst_h, 0); 580 cropped.setConfig(SkBitmap::kARGB_8888_Config, dst_w, dst_h, 0);
581 cropped.allocPixels(); 581 cropped.allocPixels();
582 cropped.eraseARGB(0, 0, 0, 0); 582 cropped.eraseARGB(0, 0, 0, 0);
583 583
584 SkAutoLockPixels lock_source(source); 584 SkAutoLockPixels lock_source(source);
585 SkAutoLockPixels lock_cropped(cropped); 585 SkAutoLockPixels lock_cropped(cropped);
586 586
587 // Loop through the pixels of the original bitmap. 587 // Loop through the pixels of the original bitmap.
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 uint32* image_row = image.getAddr32(0, y); 731 uint32* image_row = image.getAddr32(0, y);
732 for (int x = 0; x < image.width(); ++x) { 732 for (int x = 0; x < image.width(); ++x) {
733 uint32* dst = transposed.getAddr32(y, x); 733 uint32* dst = transposed.getAddr32(y, x);
734 *dst = image_row[x]; 734 *dst = image_row[x];
735 } 735 }
736 } 736 }
737 737
738 return transposed; 738 return transposed;
739 } 739 }
740 740
OLDNEW
« no previous file with comments | « ui/gfx/icon_util.cc ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698