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

Side by Side Diff: include/core/SkBitmap.h

Issue 1159183003: Revert[6] of add asserts around results from requestLock (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: check for success in new tests Created 5 years, 6 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 | « no previous file | include/core/SkPixelRef.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 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 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 #ifndef SkBitmap_DEFINED 8 #ifndef SkBitmap_DEFINED
9 #define SkBitmap_DEFINED 9 #define SkBitmap_DEFINED
10 10
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 isOpaque ? kOpaque_SkAlphaType : kPr emul_SkAlphaType); 266 isOpaque ? kOpaque_SkAlphaType : kPr emul_SkAlphaType);
267 this->allocPixels(info); 267 this->allocPixels(info);
268 } 268 }
269 269
270 /** 270 /**
271 * Install a pixelref that wraps the specified pixels and rowBytes, and 271 * Install a pixelref that wraps the specified pixels and rowBytes, and
272 * optional ReleaseProc and context. When the pixels are no longer 272 * optional ReleaseProc and context. When the pixels are no longer
273 * referenced, if releaseProc is not null, it will be called with the 273 * referenced, if releaseProc is not null, it will be called with the
274 * pixels and context as parameters. 274 * pixels and context as parameters.
275 * On failure, the bitmap will be set to empty and return false. 275 * On failure, the bitmap will be set to empty and return false.
276 *
277 * If specified, the releaseProc will always be called, even on failure. It is also possible
278 * for success but the releaseProc is immediately called (e.g. valid Info b ut NULL pixels).
276 */ 279 */
277 bool installPixels(const SkImageInfo&, void* pixels, size_t rowBytes, SkColo rTable*, 280 bool installPixels(const SkImageInfo&, void* pixels, size_t rowBytes, SkColo rTable*,
278 void (*releaseProc)(void* addr, void* context), void* con text); 281 void (*releaseProc)(void* addr, void* context), void* con text);
279 282
280 /** 283 /**
281 * Call installPixels with no ReleaseProc specified. This means that the 284 * Call installPixels with no ReleaseProc specified. This means that the
282 * caller must ensure that the specified pixels are valid for the lifetime 285 * caller must ensure that the specified pixels are valid for the lifetime
283 * of the created bitmap (and its pixelRef). 286 * of the created bitmap (and its pixelRef).
284 */ 287 */
285 bool installPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) { 288 bool installPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) {
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 792
790 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { 793 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
791 SkASSERT(fPixels); 794 SkASSERT(fPixels);
792 SkASSERT(kIndex_8_SkColorType == this->colorType()); 795 SkASSERT(kIndex_8_SkColorType == this->colorType());
793 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height()); 796 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height());
794 SkASSERT(fColorTable); 797 SkASSERT(fColorTable);
795 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; 798 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)];
796 } 799 }
797 800
798 #endif 801 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkPixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698