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

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

Issue 1314583003: Replace SkPin32 with SkTPin and remove. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment. Created 5 years, 3 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
« no previous file with comments | « include/core/SkTypes.h ('k') | src/core/SkFontStyle.cpp » ('j') | 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 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 SkASSERT(fInfo.alphaType() == kOpaque_SkAlphaType || 192 SkASSERT(fInfo.alphaType() == kOpaque_SkAlphaType ||
193 fInfo.alphaType() == kUnpremul_SkAlphaType); 193 fInfo.alphaType() == kUnpremul_SkAlphaType);
194 break; 194 break;
195 } 195 }
196 } 196 }
197 } 197 }
198 #endif 198 #endif
199 199
200 if (pr) { 200 if (pr) {
201 const SkImageInfo& info = pr->info(); 201 const SkImageInfo& info = pr->info();
202 fPixelRefOrigin.set(SkPin32(dx, 0, info.width()), SkPin32(dy, 0, info.he ight())); 202 fPixelRefOrigin.set(SkTPin(dx, 0, info.width()), SkTPin(dy, 0, info.heig ht()));
203 } else { 203 } else {
204 // ignore dx,dy if there is no pixelref 204 // ignore dx,dy if there is no pixelref
205 fPixelRefOrigin.setZero(); 205 fPixelRefOrigin.setZero();
206 } 206 }
207 207
208 if (fPixelRef != pr) { 208 if (fPixelRef != pr) {
209 this->freePixels(); 209 this->freePixels();
210 SkASSERT(nullptr == fPixelRef); 210 SkASSERT(nullptr == fPixelRef);
211 211
212 SkSafeRef(pr); 212 SkSafeRef(pr);
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 /////////////////////////////////////////////////////////////////////////////// 1300 ///////////////////////////////////////////////////////////////////////////////
1301 1301
1302 #ifdef SK_DEBUG 1302 #ifdef SK_DEBUG
1303 void SkImageInfo::validate() const { 1303 void SkImageInfo::validate() const {
1304 SkASSERT(fWidth >= 0); 1304 SkASSERT(fWidth >= 0);
1305 SkASSERT(fHeight >= 0); 1305 SkASSERT(fHeight >= 0);
1306 SkASSERT(SkColorTypeIsValid(fColorType)); 1306 SkASSERT(SkColorTypeIsValid(fColorType));
1307 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); 1307 SkASSERT(SkAlphaTypeIsValid(fAlphaType));
1308 } 1308 }
1309 #endif 1309 #endif
OLDNEW
« no previous file with comments | « include/core/SkTypes.h ('k') | src/core/SkFontStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698