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

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

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 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 | « gm/xfermodes3.cpp ('k') | include/core/SkCanvas.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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 * modifications will be lost when unlockPixels() is called.) 437 * modifications will be lost when unlockPixels() is called.)
438 */ 438 */
439 bool lockPixelsAreWritable() const; 439 bool lockPixelsAreWritable() const;
440 440
441 /** Call this to be sure that the bitmap is valid enough to be drawn (i.e. 441 /** Call this to be sure that the bitmap is valid enough to be drawn (i.e.
442 it has non-null pixels, and if required by its colortype, it has a 442 it has non-null pixels, and if required by its colortype, it has a
443 non-null colortable. Returns true if all of the above are met. 443 non-null colortable. Returns true if all of the above are met.
444 */ 444 */
445 bool readyToDraw() const { 445 bool readyToDraw() const {
446 return this->getPixels() != NULL && 446 return this->getPixels() != NULL &&
447 (this->colorType() != kIndex_8_SkColorType || NULL != fColorTable ); 447 (this->colorType() != kIndex_8_SkColorType || fColorTable);
448 } 448 }
449 449
450 /** Returns the pixelRef's texture, or NULL 450 /** Returns the pixelRef's texture, or NULL
451 */ 451 */
452 GrTexture* getTexture() const; 452 GrTexture* getTexture() const;
453 453
454 /** Return the bitmap's colortable, if it uses one (i.e. colorType is 454 /** Return the bitmap's colortable, if it uses one (i.e. colorType is
455 Index_8) and the pixels are locked. 455 Index_8) and the pixels are locked.
456 Otherwise returns NULL. Does not affect the colortable's 456 Otherwise returns NULL. Does not affect the colortable's
457 reference count. 457 reference count.
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 874
875 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { 875 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
876 SkASSERT(fPixels); 876 SkASSERT(fPixels);
877 SkASSERT(kIndex_8_SkColorType == this->colorType()); 877 SkASSERT(kIndex_8_SkColorType == this->colorType());
878 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height()); 878 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height());
879 SkASSERT(fColorTable); 879 SkASSERT(fColorTable);
880 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; 880 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)];
881 } 881 }
882 882
883 #endif 883 #endif
OLDNEW
« no previous file with comments | « gm/xfermodes3.cpp ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698