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

Unified Diff: src/core/SkBitmap.cpp

Issue 2000713003: Add SkColorSpace to SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@public
Patch Set: Ref counting fixes and other fixes Created 4 years, 7 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
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 3bb763b4f43cf65f7117dbcdb79cbe8f444b79bb..8c91efa9fa4d8154d08d99b592c8c581031562d7 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -29,11 +29,13 @@ static bool reset_return_false(SkBitmap* bm) {
}
SkBitmap::SkBitmap() {
+ this->fInfo = SkImageInfo::MakeUnknown();
msarett 2016/05/26 13:43:05 I could also add a reset() function to SkImageInfo
sk_bzero(this, sizeof(*this));
}
SkBitmap::SkBitmap(const SkBitmap& src) {
SkDEBUGCODE(src.validate();)
+ this->fInfo = SkImageInfo::MakeUnknown();
sk_bzero(this, sizeof(*this));
*this = src;
SkDEBUGCODE(this->validate();)
@@ -49,6 +51,7 @@ SkBitmap::~SkBitmap() {
SkBitmap& SkBitmap::operator=(const SkBitmap& src) {
if (this != &src) {
this->freePixels();
+ this->fInfo = src.fInfo;
memcpy(this, &src, sizeof(src));
// inc src reference counts
@@ -97,6 +100,7 @@ void SkBitmap::swap(SkBitmap& other) {
void SkBitmap::reset() {
this->freePixels();
+ this->fInfo = SkImageInfo::MakeUnknown();
sk_bzero(this, sizeof(*this));
}
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/core/SkImageInfo.cpp » ('j') | src/core/SkMipMap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698