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

Side by Side Diff: src/core/SkBitmap.cpp

Issue 15536007: Add prototype for warning. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 } 860 }
861 return y * bm.rowBytes() + x; 861 return y * bm.rowBytes() + x;
862 } 862 }
863 863
864 /** 864 /**
865 * Using the pixelRefOffset(), rowBytes(), and Config of bm, determine the (x, y) coordinate of the 865 * Using the pixelRefOffset(), rowBytes(), and Config of bm, determine the (x, y) coordinate of the
866 * upper left corner of bm relative to its SkPixelRef. 866 * upper left corner of bm relative to its SkPixelRef.
867 * x and y must be non-NULL. 867 * x and y must be non-NULL.
868 */ 868 */
869 bool get_upper_left_from_offset(SkBitmap::Config config, size_t offset, size_t r owBytes, 869 bool get_upper_left_from_offset(SkBitmap::Config config, size_t offset, size_t r owBytes,
870 int32_t* x, int32_t* y);
871 bool get_upper_left_from_offset(SkBitmap::Config config, size_t offset, size_t r owBytes,
870 int32_t* x, int32_t* y) { 872 int32_t* x, int32_t* y) {
871 SkASSERT(x != NULL && y != NULL); 873 SkASSERT(x != NULL && y != NULL);
872 if (0 == offset) { 874 if (0 == offset) {
873 *x = *y = 0; 875 *x = *y = 0;
874 return true; 876 return true;
875 } 877 }
876 // Use integer division to find the correct y position. 878 // Use integer division to find the correct y position.
877 *y = SkToS32(offset / rowBytes); 879 *y = SkToS32(offset / rowBytes);
878 // The remainder will be the x position, after we reverse get_sub_offset. 880 // The remainder will be the x position, after we reverse get_sub_offset.
879 *x = SkToS32(offset % rowBytes); 881 *x = SkToS32(offset % rowBytes);
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 if (NULL != uri) { 1675 if (NULL != uri) {
1674 str->appendf(" uri:\"%s\"", uri); 1676 str->appendf(" uri:\"%s\"", uri);
1675 } else { 1677 } else {
1676 str->appendf(" pixelref:%p", pr); 1678 str->appendf(" pixelref:%p", pr);
1677 } 1679 }
1678 } 1680 }
1679 1681
1680 str->append(")"); 1682 str->append(")");
1681 } 1683 }
1682 #endif 1684 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698