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

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

Issue 2177063002: lockPixelsAreWritable is deprecated (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update test Created 4 years, 5 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 | src/core/SkBitmapDevice.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 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 a given image. 448 a given image.
449 */ 449 */
450 void unlockPixels() const; 450 void unlockPixels() const;
451 451
452 /** 452 /**
453 * Some bitmaps can return a copy of their pixels for lockPixels(), but 453 * Some bitmaps can return a copy of their pixels for lockPixels(), but
454 * that copy, if modified, will not be pushed back. These bitmaps should 454 * that copy, if modified, will not be pushed back. These bitmaps should
455 * not be used as targets for a raster device/canvas (since all pixels 455 * not be used as targets for a raster device/canvas (since all pixels
456 * modifications will be lost when unlockPixels() is called.) 456 * modifications will be lost when unlockPixels() is called.)
457 */ 457 */
458 // DEPRECATED
458 bool lockPixelsAreWritable() const; 459 bool lockPixelsAreWritable() const;
459 460
460 bool requestLock(SkAutoPixmapUnlock* result) const; 461 bool requestLock(SkAutoPixmapUnlock* result) const;
461 462
462 /** Call this to be sure that the bitmap is valid enough to be drawn (i.e. 463 /** Call this to be sure that the bitmap is valid enough to be drawn (i.e.
463 it has non-null pixels, and if required by its colortype, it has a 464 it has non-null pixels, and if required by its colortype, it has a
464 non-null colortable. Returns true if all of the above are met. 465 non-null colortable. Returns true if all of the above are met.
465 */ 466 */
466 bool readyToDraw() const { 467 bool readyToDraw() const {
467 return this->getPixels() != NULL && 468 return this->getPixels() != NULL &&
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 826
826 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { 827 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
827 SkASSERT(fPixels); 828 SkASSERT(fPixels);
828 SkASSERT(kIndex_8_SkColorType == this->colorType()); 829 SkASSERT(kIndex_8_SkColorType == this->colorType());
829 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height()); 830 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th is->height());
830 SkASSERT(fColorTable); 831 SkASSERT(fColorTable);
831 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; 832 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)];
832 } 833 }
833 834
834 #endif 835 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkBitmapDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698