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

Unified Diff: src/core/SkBitmap.cpp

Issue 387083002: Remove kImageIsImmutable_Flag. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase + better validation for Flags. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkBitmap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 1d68aee97542f4852511ff9ae06efff52d5e7a49..e675db280040c713f6c392badc863b5eb0fceddb 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -486,15 +486,12 @@ bool SkBitmap::copyPixelsTo(void* const dst, size_t dstSize,
///////////////////////////////////////////////////////////////////////////////
bool SkBitmap::isImmutable() const {
- return fPixelRef ? fPixelRef->isImmutable() :
- fFlags & kImageIsImmutable_Flag;
+ return fPixelRef ? fPixelRef->isImmutable() : false;
}
void SkBitmap::setImmutable() {
if (fPixelRef) {
fPixelRef->setImmutable();
- } else {
- fFlags |= kImageIsImmutable_Flag;
}
}
@@ -1332,11 +1329,11 @@ void SkBitmap::validate() const {
}
SkASSERT(fInfo.validRowBytes(fRowBytes));
- uint8_t allFlags = kImageIsVolatile_Flag | kImageIsImmutable_Flag;
+ uint8_t allFlags = kImageIsVolatile_Flag;
#ifdef SK_BUILD_FOR_ANDROID
allFlags |= kHasHardwareMipMap_Flag;
#endif
- SkASSERT(fFlags <= allFlags);
+ SkASSERT((~allFlags & fFlags) == 0);
SkASSERT(fPixelLockCount >= 0);
if (fPixels) {
« no previous file with comments | « include/core/SkBitmap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698